@Override protected PersistenceConfigurationBuilder createCacheStoreConfig(PersistenceConfigurationBuilder persistence, boolean preload) { persistence .addSingleFileStore() .location(tmpDirectory) .preload(preload); return persistence; }
.locking().concurrencyLevel(2048) .persistence().passivation(false) .addSingleFileStore().location(tmpDirectory).shared(false).preload(true);
private void enableTestJdbcStorage(ConfigurationBuilder configuration) throws Exception { configuration .persistence() .passivation(false) .addSingleFileStore() .preload(false) .shared(false) .location(tmpDirectory) .async() .enable() .threadPoolSize(1); }
protected EmbeddedCacheManager createCacheManager(int maxEntries) throws Exception { return new DefaultCacheManager( new GlobalConfigurationBuilder().build(), new ConfigurationBuilder() .memory().evictionType(EvictionType.COUNT).size(maxEntries) .persistence().passivation(true) .addSingleFileStore().location(storeDir.getAbsolutePath()).preload(true) .indexing().index(Index.ALL) .addIndexedEntity(Person.class) .addIndexedEntity(Car.class) .addProperty("default.directory_provider", "filesystem") .addProperty("default.indexBase", indexDir.getAbsolutePath()) .addProperty("lucene_version", "LUCENE_CURRENT") .build() ); }
public void testDocumentationPersistenceConfiguration() { ConfigurationBuilder builder = new ConfigurationBuilder(); builder.persistence() .passivation(false) .addSingleFileStore() .fetchPersistentState(true) .shared(false) .preload(true) .ignoreModifications(false) .purgeOnStartup(false) .location(System.getProperty("java.io.tmpdir")) .async() .enabled(true) .flushLockTimeout(15000) .threadPoolSize(5) .singleton() .enabled(true) .pushStateWhenCoordinator(true) .pushStateTimeout(20000); }
@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(); }
private EmbeddedCacheManager getCacheManager(boolean batchingEnabled) throws Exception { ConfigurationBuilder builder = new ConfigurationBuilder(); builder .persistence() .passivation(false) .addSingleFileStore() .location(TMP_DIR + File.separator + "cacheStore") .preload(false) .fetchPersistentState(true) .purgeOnStartup(false) .indexing() .index(Index.PRIMARY_OWNER) .addIndexedEntity(SEntity.class) .addProperty("default.directory_provider", "filesystem") .addProperty("lucene_version", "LUCENE_CURRENT") .addProperty("default.indexBase", TMP_DIR + File.separator + "idx"); if (batchingEnabled) { builder.invocationBatching().enable(); } else { builder.invocationBatching().disable(); } return TestCacheManagerFactory.createCacheManager(builder); }