use of org.infinispan.configuration.cache.ConfigurationBuilder in project indy by Commonjava.
the class StorageFileIOTest method setup.
@Before
public void setup() throws IOException {
storageRoot = temp.newFolder("data");
Properties storageProps = new Properties();
storageProps.setProperty(StorageFileIO.STORAGE_ROOT_DIR, storageRoot.getAbsolutePath());
Configuration dataConfig = new ConfigurationBuilder().persistence().passivation(true).addStore(CustomStoreConfigurationBuilder.class).customStoreClass(StorageFileIO.class).properties(storageProps).build();
String dataName = name.getMethodName() + "-data";
CACHE_MANAGER.defineConfiguration(dataName, dataConfig);
Configuration mdConfig = new ConfigurationBuilder().build();
String metadataName = name.getMethodName() + "-metadata";
CACHE_MANAGER.defineConfiguration(metadataName, mdConfig);
dataCache = CACHE_MANAGER.getCache(dataName);
fs = new GridFilesystem(dataCache, CACHE_MANAGER.getCache(metadataName));
}
use of org.infinispan.configuration.cache.ConfigurationBuilder in project adeptj-modules by AdeptJ.
the class InfinispanCacheProvider method initInfinispan.
protected void initInfinispan() {
long startTime = System.nanoTime();
if (this.cacheManager == null) {
Configuration defaultConfiguration = new ConfigurationBuilder().simpleCache(true).eviction().strategy(EvictionStrategy.LRU).type(EvictionType.COUNT).size(1000l).expiration().lifespan(60, TimeUnit.MINUTES).maxIdle(30, TimeUnit.MINUTES).build();
this.cacheManager = new DefaultCacheManager(defaultConfiguration);
LOGGER.info("Infinispan initialization took: [{}] ms!!", TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTime));
}
}
use of org.infinispan.configuration.cache.ConfigurationBuilder in project teiid by teiid.
the class HotRodTestServer method getConfigurationBuilder.
protected ConfigurationBuilder getConfigurationBuilder() {
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.indexing().index(Index.ALL).addProperty("default.directory_provider", "ram").addProperty("lucene_version", "LUCENE_CURRENT");
return builder;
}
use of org.infinispan.configuration.cache.ConfigurationBuilder in project galley by Commonjava.
the class NFSOwnerCacheProducer method getCacheMgr.
public EmbeddedCacheManager getCacheMgr() {
final EmbeddedCacheManager cacheManager = new DefaultCacheManager(new GlobalConfigurationBuilder().globalJmxStatistics().jmxDomain("org.commonjava.maven.galley").build());
// Want to enable dead lock check as lock will be used in FastLocalCacheProvider
// and also set transaction mode to PESSIMISTIC with DummyTransactionManger.
final Configuration configurationForNfs = new ConfigurationBuilder().eviction().strategy(EvictionStrategy.LRU).size(1000).type(EvictionType.COUNT).deadlockDetection().spinDuration(10, TimeUnit.SECONDS).enable().transaction().transactionManagerLookup(new DummyTransactionManagerLookup()).lockingMode(LockingMode.PESSIMISTIC).build();
cacheManager.defineConfiguration(CACHE_NAME, configurationForNfs);
// Default cache impl for the local file cache in FLCP, uses 7 day as an expiration duration, and trigger purge every 30 mins.
final Long expirationDuration = 7 * 24 * 3600 * 1000L;
Configuration configForLocalFile = new ConfigurationBuilder().eviction().strategy(EvictionStrategy.LRU).size(20000).type(EvictionType.COUNT).expiration().lifespan(expirationDuration).wakeUpInterval(30 * 60 * 1000L).maxIdle(expirationDuration).build();
cacheManager.defineConfiguration(DEFAULT_LOCAL_CACHE_FILE_NAME, configForLocalFile);
// A test cache impl to do unit-testing for this local file cache expiration for purging mechanism
Configuration configForLocalFileTest = new ConfigurationBuilder().eviction().strategy(EvictionStrategy.LRU).size(1000).type(EvictionType.COUNT).expiration().lifespan(1000L).wakeUpInterval(100L).maxIdle(1000L).build();
cacheManager.defineConfiguration(LOCAL_CACHE_FILE_NAME_FOR_TEST, configForLocalFileTest);
return cacheManager;
}
use of org.infinispan.configuration.cache.ConfigurationBuilder in project indy by Commonjava.
the class KojiMavenMetadataProviderTest method setupClass.
@BeforeClass
public static void setupClass() {
cacheManager = new DefaultCacheManager(new ConfigurationBuilder().simpleCache(true).build());
contentMetadata = cacheManager.getCache("content-metadata", true);
}
Aggregations