@BeforeClass public void setUp() { // create cache configuration ConfigurationBuilder cb = new ConfigurationBuilder(); cb.clustering().invocationBatching().enable() .clustering().cacheMode(CacheMode.DIST_SYNC) .clustering().stateTransfer().timeout(10000) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ); configuration = cb.build(); mockExecutorService = mock(ExecutorService.class); cache = mock(Cache.class); when(cache.getName()).thenReturn("testCache"); rpcManager = mock(RpcManager.class); commandsFactory = mock(CommandsFactory.class); cacheNotifier = mock(ClusterCacheNotifier.class); persistenceManager = mock(PersistenceManager.class); dataContainer = mock(InternalDataContainer.class); transactionTable = mock(TransactionTable.class); stateTransferLock = mock(StateTransferLock.class); distributionManager = mock(DistributionManager.class); ef = mock(InternalEntryFactory.class); when(distributionManager.getCacheTopology()).thenAnswer(invocation -> cacheTopology); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder c = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true); c.clustering().stateTransfer().fetchInMemoryState(true) .locking().lockAcquisitionTimeout(1500); createClusteredCaches(2, c); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder c = getDefaultClusteredCacheConfig(isSync ? CacheMode.INVALIDATION_SYNC : CacheMode.INVALIDATION_ASYNC, false); c.clustering().stateTransfer().timeout(10000) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); createClusteredCaches(2, "invalidation", c); if (isSync) { c = getDefaultClusteredCacheConfig(CacheMode.INVALIDATION_SYNC, true); c.clustering().stateTransfer().timeout(10000) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); defineConfigurationOnAllManagers("invalidationTx", c); waitForClusterToForm("invalidationTx"); } }
.clustering().cacheMode(CacheMode.DIST_SYNC) .clustering().stateTransfer().timeout(10000) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()) .locking().isolationLevel(IsolationLevel.REPEATABLE_READ);
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; }
.clustering().cacheMode(CacheMode.REPL_SYNC).remoteTimeout(25000) .stateTransfer().awaitInitialTransfer(true).timeout(480000) .locking().useLockStriping(false).lockAcquisitionTimeout(10000).concurrencyLevel(500) .clustering().cacheMode(CacheMode.DIST_SYNC).remoteTimeout(25000) .stateTransfer().awaitInitialTransfer(true).timeout(480000) .locking().useLockStriping(false).lockAcquisitionTimeout(10000).concurrencyLevel(500) .clustering().cacheMode(CacheMode.REPL_SYNC).remoteTimeout(25000) .stateTransfer().awaitInitialTransfer(true).timeout(480000) .locking().useLockStriping(false).lockAcquisitionTimeout(10000).concurrencyLevel(500)
@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>(); }
@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); }