@Override public void accept(ConfigurationBuilder builder) { builder.clustering() .cacheMode(this.mode) .remoteTimeout(this.remoteTimeout, TimeUnit.MILLISECONDS) ; super.accept(builder); } }
@Override public void accept(ConfigurationBuilder builder) { builder.clustering() .cacheMode(this.mode) .remoteTimeout(this.remoteTimeout, TimeUnit.MILLISECONDS) ; super.accept(builder); } }
@Override protected void decorate(ConfigurationBuilder builder) { // Enable L1 builder.clustering().l1().enable(); builder.clustering().remoteTimeout(100, TimeUnit.MINUTES); }
@Override protected void decorate(ConfigurationBuilder builder) { // Enable L1 builder.clustering().l1().enable(); builder.clustering().remoteTimeout(100, TimeUnit.MINUTES); } }
protected ConfigurationBuilder getBaseConfigBuilder(CacheMode cacheMode) { ConfigurationBuilder configBuilder = getDefaultClusteredCacheConfig(cacheMode, false); HashConfigurationBuilder hashConfigurationBuilder = configBuilder .clustering() .remoteTimeout(getRemoteTimeoutInMinutes(), TimeUnit.MINUTES) .hash().numSegments(getNumSegments()).numOwners(getNumOwners()); if (getIndexManager().equals(AffinityIndexManager.class.getName())) { hashConfigurationBuilder.keyPartitioner(new AffinityPartitioner()); } return configBuilder; }
@Override protected void createCacheManagers() throws Throwable { builderUsed = new ConfigurationBuilder(); builderUsed.clustering().cacheMode(cacheMode); builderUsed.clustering().stateTransfer().chunkSize(25000); // Uncomment this line to make it transactional // builderUsed.transaction().transactionMode(TransactionMode.TRANSACTIONAL); // This is increased just for the put all command when doing full tracing builderUsed.clustering().remoteTimeout(30000); createClusteredCaches(CACHE_COUNT, CACHE_NAME, builderUsed); }
public void testGetAllVersionsTimeout() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC); builder.clustering().remoteTimeout(5000).stateTransfer().fetchInMemoryState(true); String cacheName = CACHE_NAME + "2"; defineConfigurationOnAllManagers(cacheName, builder); waitForClusterToForm(cacheName); dropClusteredGetCommands(); Exceptions.expectException(CacheException.class, ".* encountered when attempting '.*.' on cache '.*.'", () -> getAllVersions(0, "Test")); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC); // cache stop takes quite long when the view splits builder.clustering().stateTransfer().timeout(10, TimeUnit.SECONDS); builder.clustering().remoteTimeout(5, TimeUnit.SECONDS); createCluster(builder, 3); waitForClusterToForm(); key = getKeyForCache(cache(1), cache(2)); }
private Cache getCache() { GlobalConfigurationBuilder gc = GlobalConfigurationBuilder.defaultClusteredBuilder(); ConfigurationBuilder c = new ConfigurationBuilder(); c.clustering().cacheMode(CacheMode.REPL_SYNC) .remoteTimeout(30000) .transaction().invocationBatching().enable() .locking().lockAcquisitionTimeout(60000).useLockStriping(false); EmbeddedCacheManager container = TestCacheManagerFactory.createClusteredCacheManager(gc, c); cacheContainers.add(container); container.defineConfiguration("TestCache", c.build()); return container.getCache("TestCache"); } }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.SCATTERED_SYNC, false); builder.clustering().biasAcquisition(BiasAcquisition.ON_WRITE).remoteTimeout(1000); createCluster(builder, 3); TestingUtil.wrapComponent(cache(0), RpcManager.class, rpcManager -> rpcManager0 = new FailingRpcManager(rpcManager)); cache(1); // just touch to start it TestingUtil.wrapComponent(cache(2), RpcManager.class, rpcManager -> rpcManager2 = new CountingRpcManager(rpcManager)); }
protected void createCacheManagers() throws Throwable { configurationBuilder = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true); configurationBuilder.transaction() .lockingMode(LockingMode.PESSIMISTIC) .useSynchronization(false) .recovery().disable(); configurationBuilder.clustering().remoteTimeout(30000); configurationBuilder.clustering().stateTransfer().chunkSize(20); configurationBuilder.locking().useLockStriping(false); // reduces the odd chance of a key collision and deadlock }
private ConfigurationBuilder getClusteredCfg(CacheMode mode, boolean l1) { ConfigurationBuilder cfg = getBaseCfg(); cfg .locking().lockAcquisitionTimeout(60000) .clustering().cacheMode(mode).remoteTimeout(60000).stateTransfer().fetchInMemoryState(false); if (mode.isDistributed()) { cfg.clustering().l1().enabled(l1).lifespan(120000); } return cfg; }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder cb = new ConfigurationBuilder(); cb.clustering().cacheMode(CacheMode.DIST_SYNC) .remoteTimeout(5000) .transaction().transactionMode(TransactionMode.TRANSACTIONAL).cacheStopTimeout(100); EmbeddedCacheManager cm1 = TestCacheManagerFactory.createClusteredCacheManager(cb); EmbeddedCacheManager cm2 = TestCacheManagerFactory.createClusteredCacheManager(cb); registerCacheManager(cm1, cm2); c1 = cm1.getCache(); c2 = cm2.getCache(); waitForClusterToForm(); }
@Override protected void createCacheManagers() throws Throwable { builderUsed = new ConfigurationBuilder(); builderUsed.clustering().cacheMode(cacheMode); builderUsed.clustering().hash().numOwners(3); builderUsed.clustering().stateTransfer().chunkSize(25000); // This is increased just for the put all command when doing full tracing builderUsed.clustering().remoteTimeout(12000000); // This way if an iterator gets stuck we know earlier builderUsed.clustering().stateTransfer().timeout(240, TimeUnit.SECONDS); createClusteredCaches(CACHE_COUNT, CACHE_NAME, builderUsed); }
@Override protected void createCacheManagers() throws Throwable { ControlledConsistentHashFactory consistentHashFactory = new ControlledConsistentHashFactory.Default(1, 2); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.clustering().cacheMode(CacheMode.DIST_SYNC); builder.clustering().remoteTimeout(2000); builder.clustering().hash().numSegments(1).consistentHashFactory(consistentHashFactory); builder.transaction().transactionMode(TransactionMode.TRANSACTIONAL); addClusterEnabledCacheManager(builder); addClusterEnabledCacheManager(builder); addClusterEnabledCacheManager(builder); waitForClusterToForm(); }
private ConfigurationBuilder buildConfig(Class<?> commandToBlock) { ConfigurationBuilder configurationBuilder = getDefaultClusteredCacheConfig( CacheMode.REPL_ASYNC, false); configurationBuilder.clustering().remoteTimeout(15000); // The coordinator will always be the primary owner configurationBuilder.clustering().hash().numSegments(1).consistentHashFactory(new ReplicatedControlledConsistentHashFactory(0)); configurationBuilder.clustering().stateTransfer().fetchInMemoryState(true); // We must block after the commit was replicated, but before the entries are committed configurationBuilder.customInterceptors() .addInterceptor().after(EntryWrappingInterceptor.class).interceptor(new DelayInterceptor(commandToBlock)); return configurationBuilder; }
@Override protected final void createCacheManagers() throws Throwable { ConfigurationBuilder dcc = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); dcc.transaction() .transactionProtocol(TransactionProtocol.TOTAL_ORDER) .useSynchronization(false) .recovery().disable(); dcc.locking().isolationLevel(IsolationLevel.REPEATABLE_READ); dcc.clustering().hash() .numOwners(1) .numSegments(60); dcc.clustering().remoteTimeout(1, TimeUnit.SECONDS); createCluster(dcc, 2); waitForClusterToForm(); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder config = getDefaultClusteredCacheConfig(cacheMode, true); config .locking().lockAcquisitionTimeout(LOCK_TIMEOUT) .clustering().remoteTimeout(REPL_TIMEOUT) .clustering().hash().numOwners(numOwners) .transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .transaction().completedTxTimeout(3600000); createCluster(config, 3); waitForClusterToForm(); failPrepareInterceptor = new FailPrepareInterceptor(); advancedCache(2).addInterceptor(failPrepareInterceptor, 1); }
@Override protected void createCacheManagers() throws Throwable { ControlledConsistentHashFactory consistentHashFactory = new ControlledConsistentHashFactory.Default(1, 2); ConfigurationBuilder builder = new ConfigurationBuilder(); builder.clustering().cacheMode(CacheMode.DIST_SYNC); builder.clustering().remoteTimeout(2000); builder.clustering().hash().numSegments(1).consistentHashFactory(consistentHashFactory); builder.transaction().transactionMode(TransactionMode.TRANSACTIONAL); builder.transaction().completedTxTimeout(COMPLETED_TX_TIMEOUT); addClusterEnabledCacheManager(builder); addClusterEnabledCacheManager(builder); addClusterEnabledCacheManager(builder); waitForClusterToForm(); }
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; }