@Override public LockingConfiguration get() { return new ConfigurationBuilder().locking() .lockAcquisitionTimeout(this.timeout) .concurrencyLevel(this.concurrency) .isolationLevel(this.isolation) .useLockStriping(this.striping) .create(); }
@Override public LockingConfiguration get() { return new ConfigurationBuilder().locking() .lockAcquisitionTimeout(this.timeout) .concurrencyLevel(this.concurrency) .isolationLevel(this.isolation) .useLockStriping(this.striping) .create(); }
@Override void configure(ConfigurationBuilder builder) { builder.locking().useLockStriping(false); builder.transaction().transactionMode(TransactionMode.TRANSACTIONAL); } },
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder cfg = new ConfigurationBuilder(); cfg.locking().useLockStriping(false); return TestCacheManagerFactory.createCacheManager(cfg); }
@Override void configure(ConfigurationBuilder builder) { builder.locking().useLockStriping(true); builder.transaction().transactionMode(TransactionMode.NON_TRANSACTIONAL); } },
@Override void configure(ConfigurationBuilder builder) { builder.locking().useLockStriping(true); builder.transaction().transactionMode(TransactionMode.TRANSACTIONAL); } },
@Override void configure(ConfigurationBuilder builder) { builder.locking().useLockStriping(false); builder.transaction().transactionMode(TransactionMode.NON_TRANSACTIONAL); } };
@Override protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder config = getDefaultStandaloneCacheConfig(true); config .transaction().lockingMode(LockingMode.PESSIMISTIC) .locking().useLockStriping(false).lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(config); cache = cm.getCache(); return cm; }
@Override protected void createCacheManagers() throws Throwable { configuration = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC); configuration.transaction().transactionMode(TransactionMode.TRANSACTIONAL); configuration.locking().lockAcquisitionTimeout(60000).useLockStriping(false); configuration.clustering().stateTransfer().timeout(30, SECONDS); addClusterEnabledCacheManager(configuration); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.INVALIDATION_SYNC, true, true); builder.transaction().useSynchronization(false) .lockingMode(LockingMode.PESSIMISTIC) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()) .useLockStriping(false); createCluster(builder, 2); waitForClusterToForm(); }
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 EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder cfg = new ConfigurationBuilder(); cfg.memory().size(CACHE_SIZE).evictionType(EvictionType.COUNT).storageType(StorageType.BINARY) .expiration().wakeUpInterval(100L) .locking().useLockStriping(false) // to minimise chances of deadlock in the unit test .build(); cacheManager = TestCacheManagerFactory.createCacheManager(cfg); cache = cacheManager.getCache(); return cacheManager; }
protected ConfigurationBuilder configure() { ConfigurationBuilder configuration = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); configuration.locking().useLockStriping(false) .transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .useSynchronization(false) .recovery().enable() .clustering().stateTransfer().fetchInMemoryState(false); return configuration; }
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 }
protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder cfgBuilder = new ConfigurationBuilder(); cfgBuilder.memory().size(128) // 128 max entries .expiration().wakeUpInterval(100L) .locking().useLockStriping(false) // to minimize chances of deadlock in the unit test .invocationBatching().enable(true); EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(cfgBuilder); cache = cm.getCache(); cache.addListener(new EvictionFunctionalTest.EvictionListener()); return cm; }
protected ConfigurationBuilder defaultRecoveryConfig() { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); builder.transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .useSynchronization(false) .recovery().enable() .locking().useLockStriping(false) .clustering().hash().numOwners(2) .l1().disable() .stateTransfer().fetchInMemoryState(false); return builder; }
protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(false); builder.memory().size(CACHE_SIZE).storageType(getStorageType()) .expiration().wakeUpInterval(100L).locking() .useLockStriping(false) // to minimize chances of deadlock in the unit test .invocationBatching(); EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(builder); cache = cm.getCache(); evictionListener = new EvictionListener(); cache.addListener(evictionListener); TestingUtil.replaceComponent(cm, TimeService.class, timeService = new ControlledTimeService(), true); return cm; }
private ConfigurationBuilder makeCfg() { ConfigurationBuilder cfg = new ConfigurationBuilder(); cfg.transaction() .transactionMode(TransactionMode.TRANSACTIONAL).invocationBatching().enable() .clustering().cacheMode(CacheMode.REPL_SYNC) .clustering().sync() .stateTransfer().fetchInMemoryState(true) .transaction().lockingMode(LockingMode.PESSIMISTIC) .locking().isolationLevel(IsolationLevel.READ_COMMITTED).useLockStriping(false) .customInterceptors().addInterceptor() .interceptor(new ProtobufMetadataManagerInterceptor()).after(PessimisticLockingInterceptor.class); return cfg; }
@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); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder defaultConfig = getDefaultConfig(); defaultConfig.transaction().transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()) .useLockStriping(false); addClusterEnabledCacheManager(defaultConfig); addClusterEnabledCacheManager(defaultConfig); lm0 = TestingUtil.extractLockManager(cache(0)); lm1 = TestingUtil.extractLockManager(cache(1)); txTable0 = TestingUtil.getTransactionTable(cache(0)); txTable1 = TestingUtil.getTransactionTable(cache(1)); tm = cache(0).getAdvancedCache().getTransactionManager(); TestingUtil.blockUntilViewReceived(cache(0), 2); }