use of org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder in project infinispan by infinispan.
the class IndexingWithPersistenceTest method createCacheManager.
@Override
protected EmbeddedCacheManager createCacheManager() throws Exception {
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.indexing().enable().storage(LOCAL_HEAP).addIndexedEntity(Person.class).addIndexedEntity(AnotherGrassEater.class);
builder.persistence().addStore(new DummyInMemoryStoreConfigurationBuilder(builder.persistence()));
EmbeddedCacheManager cacheManager = TestCacheManagerFactory.createCacheManager(QueryTestSCI.INSTANCE, builder);
cache = cacheManager.getCache();
PersistenceManager pm = TestingUtil.extractComponent(cache, PersistenceManager.class);
store = pm.getStores(DummyInMemoryStore.class).iterator().next();
return cacheManager;
}
use of org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder in project infinispan by infinispan.
the class SharedStoreInvalidationDuringRehashTest method buildCfg.
private Configuration buildCfg(final int index, boolean clustered, boolean preload) {
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.persistence().passivation(false);
DummyInMemoryStoreConfigurationBuilder dummyCB = cb.persistence().addStore(DummyInMemoryStoreConfigurationBuilder.class);
dummyCB.preload(preload).shared(true).purgeOnStartup(false);
dummyCB.storeName(SharedStoreInvalidationDuringRehashTest.class.getSimpleName());
if (clustered) {
cb.clustering().l1().disable();
cb.clustering().cacheMode(cacheMode);
// one owner!
cb.clustering().hash().numOwners(1);
cb.clustering().stateTransfer().fetchInMemoryState(true);
cb.clustering().hash().groups().enabled();
}
return cb.build(true);
}
use of org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder in project infinispan by infinispan.
the class AsyncStoreParallelIterationTest method configurePersistence.
@Override
protected void configurePersistence(ConfigurationBuilder cb) {
DummyInMemoryStoreConfigurationBuilder discb = cb.persistence().addStore(DummyInMemoryStoreConfigurationBuilder.class);
discb.async().enabled(true);
}
use of org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder in project infinispan by infinispan.
the class InitCountTest method test.
/**
* @param async set to true means the cache store instance is placed under an DelegatingCacheWriter
*/
private void test(boolean async) {
ConfigurationBuilder dcc = TestCacheManagerFactory.getDefaultCacheConfiguration(true);
DummyInMemoryStoreConfigurationBuilder builder = dcc.persistence().addStore(DummyInMemoryStoreConfigurationBuilder.class);
if (async) {
builder.async().enable();
}
EmbeddedCacheManager cacheManager = TestCacheManagerFactory.createCacheManager(dcc);
Cache<Object, Object> cache = cacheManager.getCache();
try {
DummyInMemoryStore dims = TestingUtil.getFirstStore(cache);
assertEquals(1, dims.getInitCount());
} finally {
TestingUtil.killCacheManagers(cacheManager);
}
}
use of org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder in project infinispan by infinispan.
the class StateTransferCacheLoaderFunctionalTest method createCacheManager.
@Override
protected EmbeddedCacheManager createCacheManager(String cacheName) {
configurationBuilder.persistence().clearStores();
// increment the DIMCS store id
DummyInMemoryStoreConfigurationBuilder dimcs = new DummyInMemoryStoreConfigurationBuilder(configurationBuilder.persistence());
dimcs.storeName("store number " + id++);
dimcs.fetchPersistentState(true).shared(sharedCacheLoader.get()).preload(true);
configurationBuilder.persistence().addStore(dimcs);
configurationBuilder.persistence();
return super.createCacheManager(cacheName);
}
Aggregations