Package org.infinispan.configuration.cache

Examples of org.infinispan.configuration.cache.Configuration.clustering()


  }

  public static void verifyConfiguredAsClustered(final Cache<?, ?> cache) {
    verifyConfiguredAsClustered( cache.getCacheManager() );
    final Configuration cacheConfiguration = cache.getCacheConfiguration();
    Assert.assertTrue( "This Cache is managed by a clustered CacheManager, but the Cache is having clustering disabled!", cacheConfiguration.clustering().cacheMode().isClustered() );
  }

  /**
   * For manual tests and debugging
   */
 
View Full Code Here


         Transport transport = getTransport();
         try {
            if (transport != null) {
               Configuration c = getConfiguration(cacheName);
               // Use sync replication timeout
               transport.invokeRemotely(null, cmd, ResponseMode.SYNCHRONOUS, c.clustering().sync().replTimeout(), false, null, false, false);
            }
            // Once sent to the cluster, remove the local cache
            cmd.perform(null);

            // Remove cache configuration and remove it from the computed cache name list
View Full Code Here

      withCacheManager(new CacheManagerCallable(TestCacheManagerFactory.fromXml("configs/as7/standalone.xml")) {

         @Override
         public void call() {
            Configuration c = cm.getCacheConfiguration("default");
            assert c.clustering().cacheMode().equals(CacheMode.LOCAL);
            assert c.locking().isolationLevel().equals(IsolationLevel.NONE);
            assert c.locking().lockAcquisitionTimeout() == 30000;
            assert c.locking().concurrencyLevel() == 1000;
            assert !c.locking().useLockStriping();
            assert c.transaction().transactionMode().equals(TransactionMode.NON_TRANSACTIONAL);
View Full Code Here

            assert fcsc.async().modificationQueueSize() == 1024;
            assert fcsc.async().shutdownTimeout() == 25000;
            assert fcsc.async().threadPoolSize() == 1;

            c = cm.getCacheConfiguration("distsync");
            assert c.clustering().cacheMode().equals(CacheMode.DIST_SYNC);
            assert c.locking().isolationLevel().equals(IsolationLevel.READ_COMMITTED);
            assert c.locking().lockAcquisitionTimeout() == 20000;
            assert c.locking().concurrencyLevel() == 500;
            assert c.locking().useLockStriping();
            assert c.transaction().recovery().enabled();
View Full Code Here

   }

   @Test
   public void testConsistentHash() {
      Configuration config = LegacyConfigurationAdaptor.adapt(new org.infinispan.config.Configuration());
      Assert.assertNull(config.clustering().hash().consistentHash());
   }

   @Test
   public void testDisableL1() {
      withCacheManager(new CacheManagerCallable(
View Full Code Here

   }

   public void testExpectedConfig() {
      Configuration cc = cache(0).getCacheConfiguration();
      assert !cc.locking().supportsConcurrentUpdates();
      assert cc.clustering().cacheMode().isDistributed();
      assert !cc.transaction().transactionMode().isTransactional();
   }
}
View Full Code Here

      ConfigurationBuilder cb = new ConfigurationBuilder();
      cb.clustering().cacheMode(CacheMode.DIST_SYNC);
      cb.clustering().hash().numOwners(5);

      Configuration c = cb.build();
      Assert.assertEquals(5, c.clustering().hash().numOwners());

      // negative test
      cb.clustering().hash().numOwners(0);
   }
View Full Code Here

      ConfigurationBuilder cb = new ConfigurationBuilder();
      cb.clustering().cacheMode(CacheMode.DIST_SYNC);
      cb.clustering().hash().numSegments(5);

      Configuration c = cb.build();
      Assert.assertEquals(5, c.clustering().hash().numSegments());

      // negative test
      cb.clustering().hash().numSegments(0);
   }
View Full Code Here

            assert globalCfg.transport().transport() instanceof JGroupsTransport;
            assert globalCfg.transport().clusterName().equals("demoCluster");

            Configuration cfg = cm.getDefaultCacheConfiguration();
            assert cfg.clustering().cacheMode() == CacheMode.REPL_SYNC;
         }

      });

   }
View Full Code Here

         assertReaperAndTimeoutInfo(defaultCfg);
      }


      Configuration c = cm.getCacheConfiguration("transactional");
      assert !c.clustering().cacheMode().isClustered();
      assert c.transaction().transactionManagerLookup() instanceof GenericTransactionManagerLookup;
      assert c.transaction().useEagerLocking();
      assert c.transaction().eagerLockingSingleNode();
      assert !c.transaction().syncRollbackPhase();
      if (!deprecated) {
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.