Examples of unsafe()


Examples of org.infinispan.configuration.cache.ConfigurationBuilder.unsafe()

      String cacheNameConfig = "notCreatedOnAllNodes";
      Cache c = cache(0, cacheName());
      MapReduceTask<String, String, String, Integer> t = new MapReduceTask<String, String, String, Integer>(c, true,
            false);
      ConfigurationBuilder cacheConfig = new ConfigurationBuilder();
      cacheConfig.unsafe().unreliableReturnValues(true).clustering().cacheMode(CacheMode.DIST_SYNC).hash().numOwners(2)
            .sync();

      //define configuration only on first node
      Iterator<EmbeddedCacheManager> iterator = getCacheManagers().iterator();
      iterator.next().defineConfiguration(cacheNameConfig, cacheConfig.build());
View Full Code Here

Examples of org.infinispan.configuration.cache.ConfigurationBuilder.unsafe()

   protected MapReduceTask<String, String, String, Integer> createMapReduceTask(Cache c) {
      //run distributed reduce with per task cache - cache specified by the user
      MapReduceTask<String, String, String, Integer> t = new MapReduceTask<String, String, String, Integer>(c, true,
            false);
      ConfigurationBuilder cacheConfig = new ConfigurationBuilder();
      cacheConfig.unsafe().unreliableReturnValues(true)
      .clustering().cacheMode(CacheMode.DIST_SYNC).hash().numOwners(2).sync();

      //In the real world people will define configurations using xml files
      defineConfigurationOnAllManagers(intermediateCacheNameConfig, cacheConfig);
      return t.usingSharedIntermediateCache(intermediateCacheName, intermediateCacheNameConfig);
View Full Code Here

Examples of org.infinispan.configuration.cache.ConfigurationBuilder.unsafe()

      String cacheNameConfig = "notCreatedOnAllNodes";
      Cache c = cache(0, cacheName());
      MapReduceTask<String, String, String, Integer> t = new MapReduceTask<String, String, String, Integer>(c, true,
            false);
      ConfigurationBuilder cacheConfig = new ConfigurationBuilder();
      cacheConfig.unsafe().unreliableReturnValues(true).clustering().cacheMode(CacheMode.DIST_SYNC).hash().numOwners(2)
            .sync();

      //define configuration only on first node
      Iterator<EmbeddedCacheManager> iterator = getCacheManagers().iterator();
      iterator.next().defineConfiguration(cacheNameConfig, cacheConfig.build());
View Full Code Here

Examples of org.infinispan.configuration.cache.ConfigurationBuilder.unsafe()

   @Override
   protected void createCacheManagers() throws Throwable {
      ConfigurationBuilder builder = hotRodCacheConfiguration(
            getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, false));
      builder.clustering().hash().numOwners(1);
      builder.unsafe().unreliableReturnValues(true);
      addClusterEnabledCacheManager(builder);
      addClusterEnabledCacheManager(builder);
      addClusterEnabledCacheManager(builder);

      hotRodServer1 = TestHelper.startHotRodServer(manager(0));
View Full Code Here

Examples of org.infinispan.configuration.cache.ConfigurationBuilder.unsafe()

         ParseUtils.requireNoNamespaceAttribute(reader, i);
         String value = replaceProperties(reader.getAttributeValue(i));
         Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
         switch (attribute) {
            case UNRELIABLE_RETURN_VALUES:
               builder.unsafe().unreliableReturnValues(Boolean.parseBoolean(value));
               break;
            default:
               throw ParseUtils.unexpectedAttribute(reader, i);
         }
      }
View Full Code Here

Examples of org.infinispan.configuration.cache.ConfigurationBuilder.unsafe()

         ParseUtils.requireNoNamespaceAttribute(reader, i);
         String value = replaceProperties(reader.getAttributeValue(i));
         Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
         switch (attribute) {
            case UNRELIABLE_RETURN_VALUES:
               builder.unsafe().unreliableReturnValues(Boolean.parseBoolean(value));
               break;
            default:
               throw ParseUtils.unexpectedAttribute(reader, i);
         }
      }
View Full Code Here

Examples of org.infinispan.configuration.cache.ConfigurationBuilder.unsafe()

      k1 = new MagicKey(cache(1));
   }

   protected ConfigurationBuilder createConfiguration() {
      ConfigurationBuilder config = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true);
      config
         .unsafe().unreliableReturnValues(true)
         .clustering().hash().numOwners(1)
         .deadlockDetection().enable()
         .transaction().lockingMode(LockingMode.PESSIMISTIC);
      return config;
View Full Code Here

Examples of org.infinispan.configuration.cache.ConfigurationBuilder.unsafe()

      if (lockingMode != null) {
         configuration.transaction().lockingMode(lockingMode);
      }
      configuration.clustering().hash().numOwners(numOwners);
      if (!testRetVals) {
         configuration.unsafe().unreliableReturnValues(true);
         // we also need to use repeatable read for tests to work when we dont have reliable return values, since the
         // tests repeatedly queries changes
         configuration.locking().isolationLevel(IsolationLevel.REPEATABLE_READ);
      }
      if (tx) {
View Full Code Here

Examples of org.infinispan.configuration.cache.ConfigurationBuilder.unsafe()

      if (lockingMode != null) {
         configuration.transaction().lockingMode(lockingMode);
      }
      configuration.clustering().hash().numOwners(numOwners);
      if (!testRetVals) {
         configuration.unsafe().unreliableReturnValues(true);
         // we also need to use repeatable read for tests to work when we dont have reliable return values, since the
         // tests repeatedly queries changes
         configuration.locking().isolationLevel(IsolationLevel.REPEATABLE_READ);
      }
      if (tx) {
View Full Code Here

Examples of org.infinispan.configuration.cache.ConfigurationBuilder.unsafe()

         ParseUtils.requireNoNamespaceAttribute(reader, i);
         String value = replaceProperties(reader.getAttributeValue(i));
         Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
         switch (attribute) {
            case UNRELIABLE_RETURN_VALUES:
               builder.unsafe().unreliableReturnValues(Boolean.parseBoolean(value));
               break;
            default:
               throw ParseUtils.unexpectedAttribute(reader, i);
         }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.