@Override public void accept(ConfigurationBuilder builder) { builder.clustering() .cacheMode(this.mode) .remoteTimeout(this.remoteTimeout, TimeUnit.MILLISECONDS) ; super.accept(builder); } }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder builderUsed = new ConfigurationBuilder(); builderUsed.clustering().cacheMode(CacheMode.DIST_SYNC); createClusteredCaches(3, CACHE_NAME, builderUsed); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = new ConfigurationBuilder(); builder.memory().storageType(StorageType.BINARY) .clustering() .cacheMode(CacheMode.REPL_SYNC) .stateTransfer().fetchInMemoryState(false); createCluster(builder, 2); }
@Override protected void createCacheManagers() throws Throwable { builderUsed = new ConfigurationBuilder(); builderUsed.clustering().cacheMode(CacheMode.INVALIDATION_SYNC); createClusteredCaches(3, CACHE_NAME, builderUsed); }
public static <K, V> DataContainer<K, V> createDataContainer(ConfigurationBuilder builder, long size, Predicate<K> evictable) { EntrySizeCalculator<? super K, ? super InternalCacheEntry<K, V>> calculator = (key, entry) -> evictable.test(key) ? 1 : 0; return builder.clustering().cacheMode().needsStateTransfer() ? new BoundedSegmentedDataContainer<>(builder.clustering().hash().create().numSegments(), size, calculator) : new EvictableDataContainer<>(size, calculator); } }
/** * Testing putIfAbsent's behaviour in DIST_SYNC cache. */ public void testonInfinispanDIST_SYNC() throws Exception { System.out.println("Running test on Infinispan, DIST_SYNC:"); ConfigurationBuilder c = new ConfigurationBuilder(); c.clustering().cacheMode(CacheMode.DIST_SYNC); testConcurrentLockingOnMultipleManagers(c); }
@Override public void accept(ConfigurationBuilder builder) { super.accept(builder); builder.clustering().cacheMode(CacheMode.LOCAL); // Auto-enable simple cache optimization if cache is non-transactional and non-persistent builder.simpleCache((this.memory().storageType() == StorageType.OBJECT) && !this.transaction().transactionMode().isTransactional() && !this.persistence().usingStores()); } }
/** * Testing putIfAbsent's behaviour in REPL_SYNC cache. */ public void testonInfinispanREPL_SYNC() throws Exception { System.out.println("Running test on Infinispan, REPL_SYNC:"); ConfigurationBuilder c = new ConfigurationBuilder(); c.clustering().cacheMode(CacheMode.REPL_SYNC); testConcurrentLockingOnMultipleManagers(c); }
@SuppressWarnings("deprecation") @Override public void accept(ConfigurationBuilder builder) { ClusteringConfigurationBuilder clustering = builder.clustering(); CacheMode mode = clustering.cacheMode(); clustering.cacheMode(mode.needsStateTransfer() ? CacheMode.REPL_SYNC : CacheMode.LOCAL); // don't use DefaultConsistentHashFactory for REPL caches (WFLY-9276) clustering.hash().consistentHashFactory(null); clustering.l1().disable(); // Workaround for ISPN-8722 AttributeSet attributes = TemplateConfigurationServiceConfigurator.getAttributes(clustering); attributes.attribute(ClusteringConfiguration.BIAS_ACQUISITION).reset(); attributes.attribute(ClusteringConfiguration.BIAS_LIFESPAN).reset(); attributes.attribute(ClusteringConfiguration.INVALIDATION_BATCH_SIZE).reset(); // Ensure we use the default data container builder.dataContainer().dataContainer(null); // Disable expiration builder.expiration().lifespan(-1).maxIdle(-1); // Disable eviction builder.memory().size(-1).evictionStrategy(EvictionStrategy.MANUAL); builder.persistence().clearStores(); StateTransferConfigurationBuilder stateTransfer = clustering.stateTransfer().fetchInMemoryState(mode.needsStateTransfer()); attributes = TemplateConfigurationServiceConfigurator.getAttributes(stateTransfer); attributes.attribute(StateTransferConfiguration.AWAIT_INITIAL_TRANSFER).reset(); attributes.attribute(StateTransferConfiguration.TIMEOUT).reset(); } }
/** * Testing putIfAbsent's behaviour in REPL_ASYNC cache. */ public void testonInfinispanREPL_ASYNC() throws Exception { System.out.println("Running test on Infinispan, REPL_ASYNC:"); ConfigurationBuilder c = new ConfigurationBuilder(); c.clustering().cacheMode(CacheMode.REPL_ASYNC); testConcurrentLockingOnMultipleManagers(c); }
@SuppressWarnings("deprecation") @Override public void accept(ConfigurationBuilder builder) { ClusteringConfigurationBuilder clustering = builder.clustering(); CacheMode mode = clustering.cacheMode(); clustering.cacheMode(mode.needsStateTransfer() ? CacheMode.REPL_SYNC : CacheMode.LOCAL); // don't use DefaultConsistentHashFactory for REPL caches (WFLY-9276) clustering.hash().consistentHashFactory(null); clustering.l1().disable(); // Workaround for ISPN-8722 AttributeSet attributes = TemplateConfigurationServiceConfigurator.getAttributes(clustering); attributes.attribute(ClusteringConfiguration.BIAS_ACQUISITION).reset(); attributes.attribute(ClusteringConfiguration.BIAS_LIFESPAN).reset(); attributes.attribute(ClusteringConfiguration.INVALIDATION_BATCH_SIZE).reset(); // Ensure we use the default data container builder.dataContainer().dataContainer(null); // Disable expiration builder.expiration().lifespan(-1).maxIdle(-1); // Disable eviction builder.memory().size(-1).evictionStrategy(EvictionStrategy.MANUAL); builder.persistence().clearStores(); StateTransferConfigurationBuilder stateTransfer = clustering.stateTransfer().fetchInMemoryState(mode.needsStateTransfer()); attributes = TemplateConfigurationServiceConfigurator.getAttributes(stateTransfer); attributes.attribute(StateTransferConfiguration.AWAIT_INITIAL_TRANSFER).reset(); attributes.attribute(StateTransferConfiguration.TIMEOUT).reset(); } }
@Override protected void createCacheManagers() throws Throwable { builderUsed = new ConfigurationBuilder(); builderUsed.clustering().cacheMode(CacheMode.REPL_SYNC); createClusteredCaches(3, CACHE_NAME, builderUsed); }
@Override protected ConfigurationBuilder defaultRecoveryConfig() { ConfigurationBuilder configuration = super.defaultRecoveryConfig(); configuration.clustering().cacheMode(CacheMode.REPL_SYNC); return configuration; }
@Test(expectedExceptions = CacheConfigurationException.class) public void testWrongCacheModeConfiguration() throws Exception { ConfigurationBuilder config = new ConfigurationBuilder(); config.clustering().cacheMode(CacheMode.REPL_ASYNC); TestCacheManagerFactory.createCacheManager(config); }
private ConfigurationBuilder createClusterConfiguration(CacheMode cacheMode) { ConfigurationBuilder builder = createPersistenceConfiguration(); builder.clustering().cacheMode(cacheMode); return builder; }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(); configurationBuilder.clustering().cacheMode(CacheMode.REPL_SYNC); createCluster(configurationBuilder, 2); }
@Override protected ConfigurationBuilder defaultRecoveryConfig() { ConfigurationBuilder configuration = super.defaultRecoveryConfig(); configuration.clustering().cacheMode(CacheMode.REPL_SYNC); return configuration; }
protected ConfigurationBuilder getConfigurationBuilder() { ConfigurationBuilder c = new ConfigurationBuilder(); c.clustering().cacheMode(CacheMode.DIST_SYNC); c.transaction().transactionMode(TransactionMode.NON_TRANSACTIONAL); return c; }
@Override protected ConfigurationBuilder buildConfiguration() { ConfigurationBuilder builder = super.buildConfiguration(); builder.clustering() .cacheMode(CacheMode.DIST_SYNC) .hash().numOwners(1); return builder; } }
private ConfigurationBuilder getConfigurationBuilder() { ConfigurationBuilder c = new ConfigurationBuilder(); c.clustering().cacheMode(CacheMode.DIST_SYNC); c.transaction().transactionMode(TransactionMode.NON_TRANSACTIONAL); return c; }