@Override protected void configureCache(ConfigurationBuilder builder) { // To force a shared cache store, make sure storeName property // for dummy store is the same for all nodes builder.clustering().stateTransfer().fetchInMemoryState(false) .persistence().addStore(DummyInMemoryStoreConfigurationBuilder.class).shared(true).preload(true). storeName(getClass().getName()); }
@Override protected void configureCache(ConfigurationBuilder builder) { // Explicitly disable fetching in-memory state in order // to fetch it from the persistence layer builder.clustering().stateTransfer().fetchInMemoryState(true) .persistence().passivation(true) .addStore(DummyInMemoryStoreConfigurationBuilder.class) .shared(false) .preload(true) .fetchPersistentState(true); }
@Override protected void createCacheManagers() throws Throwable { ConfigurationBuilder cfg = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true); cfg.clustering() .stateTransfer().fetchInMemoryState(true) .persistence() .addStore(DummyInMemoryStoreConfigurationBuilder.class) .purgeOnStartup(true); // ensure the data container contains minimal data so the store will need to be accessed to get the rest cfg.locking().concurrencyLevel(1).dataContainer().memory().size(1L); createClusteredCaches(2, cfg); } }
@Override protected void createCacheManagers() { tmpDir = new File(TestingUtil.tmpDirectory(this.getClass())); Util.recursiveFileRemove(tmpDir); // reproduce the MODE-1754 config as closely as possible builder = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, true, true); builder.transaction().transactionMode(TransactionMode.TRANSACTIONAL).lockingMode(LockingMode.PESSIMISTIC) .transactionManagerLookup(new EmbeddedTransactionManagerLookup()) .memory().size(1000) .locking().lockAcquisitionTimeout(20000) .concurrencyLevel(5000) // lowering this to 50 makes the test pass also on 5.2 but it's just a temporary workaround .useLockStriping(false).isolationLevel(IsolationLevel.READ_COMMITTED) .dataContainer().storeAsBinary() .clustering().remoteTimeout(20000) .stateTransfer().timeout(240000).fetchInMemoryState(false).chunkSize(10000) .persistence().passivation(false).addSingleFileStore().location(new File(tmpDir, "store0").getAbsolutePath()).shared(false).preload(false) .fetchPersistentState(true) .ignoreModifications(false) .purgeOnStartup(false); createCluster(builder, 1); waitForClusterToForm(); }