@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, false); builder.clustering() .hash().numOwners(2) .stateTransfer().fetchInMemoryState(true); createClusteredCaches(3, builder); }
.numSegments(40) .consistentHashFactory(new SyncConsistentHashFactory()) .stateTransfer() .fetchInMemoryState(false) .timeout(config.getClusterTimeout())
private ConfigurationBuilder configuration() { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, false); builder.clustering() .hash() .numSegments(1) .numOwners(1) .consistentHashFactory(new SingleKeyConsistentHashFactory()) .stateTransfer() .timeout(30, TimeUnit.SECONDS); return builder; }
@Override protected void createCacheManagers() throws Throwable { cchf = new ControlledConsistentHashFactory.Default(new int[][]{{0, 1}, {1, 2}, {2, 3}, {3, 0}}); configBuilder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC); configBuilder.clustering().partitionHandling().whenSplit(PartitionHandling.DENY_READ_WRITES); configBuilder.clustering().hash().numSegments(4).stateTransfer().timeout(30000); }
.numSegments(40) .consistentHashFactory(new SyncConsistentHashFactory()) .stateTransfer() .fetchInMemoryState(false) .eviction()
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); builder.transaction() .useSynchronization(false) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .recovery().disable(); builder.clustering() .hash().numOwners(2) .stateTransfer().fetchInMemoryState(true); createClusteredCaches(3, builder); }
@Override protected void createCacheManagers() throws Throwable { cacheConfigBuilder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true, true); cacheConfigBuilder.transaction().transactionMode(TransactionMode.TRANSACTIONAL) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .lockingMode(LockingMode.PESSIMISTIC) .clustering().hash().numOwners(10) // a number bigger than actual number of nodes will make this distributed cluster behave as if fully replicated .stateTransfer().fetchInMemoryState(true) .awaitInitialTransfer(true); // setting this to false will lead to test failure createCluster(cacheConfigBuilder, 2); waitForClusterToForm(); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); builder.transaction() .useSynchronization(false) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .recovery().disable(); builder.clustering() .hash().numOwners(3).numSegments(1).consistentHashFactory(consistentHashFactory) .stateTransfer().fetchInMemoryState(true); builder.locking().isolationLevel(IsolationLevel.READ_COMMITTED); createClusteredCaches(4, builder); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(true); builder.clustering().cacheMode(CacheMode.DIST_SYNC) .l1().disable() .clustering().stateTransfer().fetchInMemoryState(true) .locking().useLockStriping(false) .clustering().hash().numOwners(3).numSegments(60) .stateTransfer().chunkSize(50); createCluster(builder, 4); c0 = cache(0); c1 = cache(1); c2 = cache(2); c3 = cache(3); waitForClusterToForm(); log.debug("Rehash is complete!"); expected = new HashMap<Integer, BigObject>(); }
protected ConfigurationBuilder buildConfiguration() { ConfigurationBuilder c = getDefaultClusteredCacheConfig(cacheMode, true); c.transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .useSynchronization(useSynchronization) .lockingMode(lockingMode) .recovery().disable() .clustering() .l1().disable() .hash().numOwners(3) .stateTransfer().fetchInMemoryState(false) .locking().isolationLevel(IsolationLevel.READ_COMMITTED); return c; }
private static ConfigurationBuilder config() { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); builder.transaction() .useSynchronization(false) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .recovery().disable(); builder.locking().lockAcquisitionTimeout(1, TimeUnit.MINUTES).isolationLevel(IsolationLevel.READ_COMMITTED); builder.clustering() .remoteTimeout(1, TimeUnit.MINUTES) .hash().numOwners(1).numSegments(1) .consistentHashFactory(new ControlledConsistentHashFactory.Default(0)) .stateTransfer().fetchInMemoryState(false); return builder; }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder configuration = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true); configuration.locking() .useLockStriping(false) .isolationLevel(IsolationLevel.READ_COMMITTED) .lockAcquisitionTimeout(20000); configuration.transaction() .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .lockingMode(LockingMode.PESSIMISTIC) .useSynchronization(false) .recovery() .disable(); configuration.clustering() .hash() .numSegments(60) .stateTransfer() .fetchInMemoryState(false); viewLatch = new CountDownLatch(1); GlobalConfigurationBuilder global = new GlobalConfigurationBuilder(); global.transport().transport(new DelayedViewJGroupsTransport(viewLatch)); addClusterEnabledCacheManager(global, configuration); addClusterEnabledCacheManager(configuration); addClusterEnabledCacheManager(configuration); }
@Override protected ConfigurationBuilder createConfigurationBuilder(boolean isOptimistic) { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true, true); builder.transaction().transactionMode(TransactionMode.TRANSACTIONAL) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()); if (isOptimistic) { builder.transaction().lockingMode(LockingMode.OPTIMISTIC) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ); } else { builder.transaction().lockingMode(LockingMode.PESSIMISTIC); } builder.clustering().l1().disable().locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); builder.clustering().hash().numSegments(10) .stateTransfer().fetchInMemoryState(true).awaitInitialTransfer(false); return builder; } }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(cacheMode, transactional, transactional); builder.clustering().hash().numSegments(3) .stateTransfer().fetchInMemoryState(true) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); if (transactional) { builder.transaction().transactionMode(TransactionMode.TRANSACTIONAL) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .lockingMode(lockingMode); } if (biasAcquisition != null) { builder.clustering().biasAcquisition(biasAcquisition); } createCluster(builder, 3); waitForClusterToForm(); c0 = advancedCache(0); c1 = advancedCache(1); c2 = advancedCache(2); }