use of org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder in project infinispan by infinispan.
the class InvalidationPreloadTest method testPreloadOnStart.
public void testPreloadOnStart() throws PersistenceException {
ConfigurationBuilder configuration = new ConfigurationBuilder();
configuration.clustering().cacheMode(CacheMode.INVALIDATION_SYNC);
configuration.transaction().transactionMode(transactionMode());
DummyInMemoryStoreConfigurationBuilder dimsConfiguration = configuration.persistence().addStore(DummyInMemoryStoreConfigurationBuilder.class);
dimsConfiguration.storeName(getTestName()).preload(true).shared(shared);
EmbeddedCacheManager cm1 = addClusterEnabledCacheManager(TestDataSCI.INSTANCE, configuration, new TransportFlags().withFD(false));
Cache<String, String> c1 = cm1.getCache();
c1.put("k" + 0, "v" + 0);
assertKeys(c1);
cm1.stop();
EmbeddedCacheManager cm2 = addClusterEnabledCacheManager(TestDataSCI.INSTANCE, configuration, new TransportFlags().withFD(false));
Cache<String, String> c2 = cm2.getCache();
assertKeys(c2);
if (shared) {
EmbeddedCacheManager cm3 = addClusterEnabledCacheManager(TestDataSCI.INSTANCE, configuration, new TransportFlags().withFD(false));
Cache<String, String> c3 = cm3.getCache();
assertKeys(c3);
}
}
use of org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder in project infinispan by infinispan.
the class AsyncStoreTest method createStore.
private InitializationContext createStore() throws PersistenceException {
ConfigurationBuilder builder = TestCacheManagerFactory.getDefaultCacheConfiguration(false);
DummyInMemoryStoreConfigurationBuilder dummyCfg = builder.persistence().addStore(DummyInMemoryStoreConfigurationBuilder.class).storeName(AsyncStoreTest.class.getName()).segmented(false);
dummyCfg.async().enable();
InitializationContext ctx = PersistenceMockUtil.createContext(getClass(), builder.build(), marshaller);
DummyInMemoryStore underlying = new DummyInMemoryStore();
store = new AsyncNonBlockingStore(underlying);
CompletionStages.join(store.start(ctx));
return ctx;
}
use of org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder in project infinispan by infinispan.
the class StateTransferDistSharedCacheLoaderFunctionalTest method createCacheManager.
@Override
protected EmbeddedCacheManager createCacheManager(String cacheName) {
configurationBuilder.persistence().clearStores();
DummyInMemoryStoreConfigurationBuilder dimcs = new DummyInMemoryStoreConfigurationBuilder(configurationBuilder.persistence());
if (sharedCacheLoader.get()) {
dimcs.storeName(getClass().getName());
} else {
dimcs.storeName(getClass().getName() + id++);
}
dimcs.fetchPersistentState(false).purgeOnStartup(false).shared(sharedCacheLoader.get()).preload(true);
configurationBuilder.persistence().passivation(false).addStore(dimcs).fetchPersistentState(fetchPersistentState.get());
// Want to enable eviction, but don't actually evict anything
configurationBuilder.memory().size(INSERTION_COUNT * 10);
EmbeddedCacheManager cm = addClusterEnabledCacheManager(sci, configurationBuilder, new TransportFlags().withMerge(true));
cm.defineConfiguration(cacheName, configurationBuilder.build());
return cm;
}
use of org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder in project infinispan by infinispan.
the class WriteSkewWithPersistenceTest method createConfigurationBuilder.
@Override
protected ConfigurationBuilder createConfigurationBuilder() {
ConfigurationBuilder configurationBuilder = super.createConfigurationBuilder();
configurationBuilder.persistence().addStore(new DummyInMemoryStoreConfigurationBuilder(configurationBuilder.persistence()));
configurationBuilder.clustering().hash().groups().enabled();
return configurationBuilder;
}
use of org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder in project infinispan by infinispan.
the class StoreAsBinaryTest method testStores.
/**
* Run this on a separate cache as it creates and stops stores, which might affect other tests.
*/
public void testStores() {
ConfigurationBuilder cacheCofig = getDefaultClusteredCacheConfig(CacheMode.REPL_SYNC, false);
cacheCofig.memory().storageType(StorageType.BINARY);
DummyInMemoryStoreConfigurationBuilder dimcs = new DummyInMemoryStoreConfigurationBuilder(cacheCofig.persistence());
dimcs.storeName(getClass().getSimpleName());
cacheCofig.persistence().addStore(dimcs);
defineConfigurationOnAllManagers("replSync2", cacheCofig);
waitForClusterToForm("replSync2");
Cache<Object, Object> cache1 = cache(0, "replSync2");
Cache<Object, Object> cache2 = cache(1, "replSync2");
CountMarshallingPojo pojo = new CountMarshallingPojo(POJO_NAME, 1);
cache1.put("key", pojo);
assertEquals(pojo, cache2.get("key"));
}
Aggregations