public EmbeddedCacheManager newCM() { ConfigurationBuilder c = new ConfigurationBuilder(); c.clustering().cacheMode(CacheMode.DIST_SYNC) .hash().numOwners(1) .clustering().l1().disable(); return TestCacheManagerFactory.createClusteredCacheManager(c); } }
.clustering().cacheMode(CacheMode.REPL_SYNC) .clustering().hash().numSegments(NUM_SEGMENTS) .clustering().stateTransfer().awaitInitialTransfer(false) .build();
@BeforeMethod protected void setUp() throws Exception { ConfigurationBuilder configurationBuilder = TestCacheManagerFactory.getDefaultCacheConfiguration(true); configurationBuilder.transaction().invocationBatching().enable() .clustering().cacheMode(CacheMode.DIST_SYNC) .clustering().hash().numOwners(1) .clustering().stateTransfer().fetchInMemoryState(false); manager1 = TestCacheManagerFactory.createClusteredCacheManager(configurationBuilder); manager1.defineConfiguration("test", configurationBuilder.build()); cache1 = manager1.getCache("test").getAdvancedCache(); ex1 = Executors.newSingleThreadExecutor(getTestThreadFactory("KeyGenerator1")); keyAffinityService1 = KeyAffinityServiceFactory.newLocalKeyAffinityService(cache1, new RndKeyGenerator(), ex1, KEY_QUEUE_SIZE); log.trace("Address for manager1: " + manager1.getAddress()); manager2 = TestCacheManagerFactory.createClusteredCacheManager(configurationBuilder); manager2.defineConfiguration("test", configurationBuilder.build()); cache2 = manager2.getCache("test").getAdvancedCache(); ex2 = Executors.newSingleThreadExecutor(getTestThreadFactory("KeyGenerator2")); keyAffinityService2 = KeyAffinityServiceFactory.newLocalKeyAffinityService(cache2, new RndKeyGenerator(), ex2, KEY_QUEUE_SIZE); log.trace("Address for manager2: " + manager2.getAddress()); TestingUtil.blockUntilViewsReceived(60000, cache1, cache2); Thread.sleep(5000); }
.clustering().cacheMode(CacheMode.REPL_SYNC) .clustering().hash().numSegments(NUM_SEGMENTS) .clustering().stateTransfer().awaitInitialTransfer(false) .build();
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder configuration = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); configuration.transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .useSynchronization(false) .recovery().enable() .locking().useLockStriping(false) .clustering().hash().numOwners(2) .clustering().l1().disable().stateTransfer().fetchInMemoryState(false); createCluster(configuration, 2); waitForClusterToForm(); advancedCache(1).getAsyncInterceptorChain().addInterceptorBefore(new ForceFailureInterceptor(), InvocationContextInterceptor.class); }