Search in sources :

Example 6 with DummyInMemoryStoreConfigurationBuilder

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;
}
Also used : ConfigurationBuilder(org.infinispan.configuration.cache.ConfigurationBuilder) DummyInMemoryStoreConfigurationBuilder(org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder) DummyInMemoryStore(org.infinispan.persistence.dummy.DummyInMemoryStore) PersistenceManager(org.infinispan.persistence.manager.PersistenceManager) DummyInMemoryStoreConfigurationBuilder(org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager) Person(org.infinispan.query.test.Person)

Example 7 with DummyInMemoryStoreConfigurationBuilder

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);
}
Also used : ConfigurationBuilder(org.infinispan.configuration.cache.ConfigurationBuilder) DummyInMemoryStoreConfigurationBuilder(org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder) DummyInMemoryStoreConfigurationBuilder(org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder)

Example 8 with DummyInMemoryStoreConfigurationBuilder

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);
}
Also used : DummyInMemoryStoreConfigurationBuilder(org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder)

Example 9 with DummyInMemoryStoreConfigurationBuilder

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);
    }
}
Also used : DummyInMemoryStoreConfigurationBuilder(org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder) ConfigurationBuilder(org.infinispan.configuration.cache.ConfigurationBuilder) DummyInMemoryStore(org.infinispan.persistence.dummy.DummyInMemoryStore) DummyInMemoryStoreConfigurationBuilder(org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager)

Example 10 with DummyInMemoryStoreConfigurationBuilder

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);
}
Also used : DummyInMemoryStoreConfigurationBuilder(org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder)

Aggregations

DummyInMemoryStoreConfigurationBuilder (org.infinispan.persistence.dummy.DummyInMemoryStoreConfigurationBuilder)11 ConfigurationBuilder (org.infinispan.configuration.cache.ConfigurationBuilder)8 EmbeddedCacheManager (org.infinispan.manager.EmbeddedCacheManager)4 DummyInMemoryStore (org.infinispan.persistence.dummy.DummyInMemoryStore)3 TransportFlags (org.infinispan.test.fwk.TransportFlags)2 AsyncNonBlockingStore (org.infinispan.persistence.async.AsyncNonBlockingStore)1 PersistenceManager (org.infinispan.persistence.manager.PersistenceManager)1 InitializationContext (org.infinispan.persistence.spi.InitializationContext)1 Person (org.infinispan.query.test.Person)1 CountMarshallingPojo (org.infinispan.test.data.CountMarshallingPojo)1