@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder dcc = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); dcc.clustering().l1().disable().hash().numOwners(1); createCluster(dcc, 2); waitForClusterToForm(); }
.l1() .lifespan(5, TimeUnit.MINUTES) .hash() .numOwners(2) .numSegments(40)
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder config = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, transactional); config.clustering().l1().enable().hash().numOwners(1); createCluster(config, 2); waitForClusterToForm(); k0 = getKeyForCache(0); }
.l1() .lifespan(5, TimeUnit.MINUTES) .hash() .numOwners(2) .numSegments(40)
protected ConfigurationBuilder createConfig() { ConfigurationBuilder cfg = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); cfg .transaction().lockingMode(LockingMode.PESSIMISTIC) .clustering().l1().disable().hash().numOwners(1) .locking().lockAcquisitionTimeout(TestingUtil.shortTimeoutMillis()); return cfg; }
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; }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder config = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, true); config.clustering().l1().enable().hash().numOwners(1); config.locking().isolationLevel(IsolationLevel.READ_COMMITTED); createCluster(config, 2); manager(0).defineConfiguration("second", config.build()); manager(1).defineConfiguration("second", config.build()); manager(0).startCaches(CacheContainer.DEFAULT_CACHE_NAME, "second"); manager(1).startCaches(CacheContainer.DEFAULT_CACHE_NAME, "second"); waitForClusterToForm(CacheContainer.DEFAULT_CACHE_NAME, "second"); cache(0).put("k","v"); cache(0,"second").put("k","v"); assert cache(1).get("k").equals("v"); assert cache(1, "second").get("k").equals("v"); k0 = new MagicKey(cache(0)); }