Package org.infinispan.configuration.cache

Examples of org.infinispan.configuration.cache.ConfigurationBuilder.eviction()


   public void testPreloadingWithEvictionAndOneMaxEntry() throws Exception {
      ConfigurationBuilder preloadingCfg = new ConfigurationBuilder();
      preloadingCfg.read(cfg.build());
      preloadingCfg.persistence().clearStores().addStore(DummyInMemoryStoreConfigurationBuilder.class).preload(true).storeName("preloadingCache_3");
      preloadingCfg.eviction().strategy(EvictionStrategy.LIRS).maxEntries(1);
      doPreloadingTestWithEviction(preloadingCfg.build(), "preloadingCache_3");
   }

   public void testPreloadingWithEviction() throws Exception {
      ConfigurationBuilder preloadingCfg = new ConfigurationBuilder();
View Full Code Here


   public void testPreloadingWithEviction() throws Exception {
      ConfigurationBuilder preloadingCfg = new ConfigurationBuilder();
      preloadingCfg.read(cfg.build());
      preloadingCfg.persistence().clearStores().addStore(DummyInMemoryStoreConfigurationBuilder.class).preload(true).storeName("preloadingCache_4");
      preloadingCfg.eviction().strategy(EvictionStrategy.LIRS).maxEntries(3);
      doPreloadingTestWithEviction(preloadingCfg.build(), "preloadingCache_4");
   }

   public void testPurgeOnStartup() throws PersistenceException {
      ConfigurationBuilder purgingCfg = new ConfigurationBuilder();
View Full Code Here

      new File(tmpDirectory).mkdirs();
   }

   public void testCheckThreadLocalLeaks() throws Exception {
      final ConfigurationBuilder builder = new ConfigurationBuilder();
      builder
            .eviction().strategy(EvictionStrategy.LRU).maxEntries(4096)
            .locking().concurrencyLevel(2048)
            .persistence().passivation(false)
               .addSingleFileStore().location(tmpDirectory).shared(false).preload(true);
View Full Code Here


   @Override
   protected EmbeddedCacheManager createCacheManager() throws Exception {
      ConfigurationBuilder cfg = new ConfigurationBuilder();
      cfg.eviction().strategy(EvictionStrategy.LRU).maxEntries(CACHE_SIZE) // CACHE_SIZE max entries
         .expiration().wakeUpInterval(100L)
         .locking().useLockStriping(false) // to minimise chances of deadlock in the unit test
         .storeAsBinary()
         .build();
      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(cfg);
View Full Code Here

@CleanupAfterMethod
public class EvictionDuringBatchTest extends SingleCacheManagerTest {

   protected EmbeddedCacheManager createCacheManager() throws Exception {
      ConfigurationBuilder cfgBuilder = new ConfigurationBuilder();
      cfgBuilder.eviction().strategy(EvictionStrategy.LRU).maxEntries(128) // 128 max entries
            .expiration().wakeUpInterval(100L)
            .locking().useLockStriping(false) // to minimize chances of deadlock in the unit test
            .invocationBatching().enable(true);
      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(cfgBuilder);
      cache = cm.getCache();
View Full Code Here

   final CountDownLatch activationWait = new CountDownLatch(1);

   @Override
   protected EmbeddedCacheManager createCacheManager() throws Exception {
      ConfigurationBuilder builder = new ConfigurationBuilder();
      builder.eviction().strategy(EvictionStrategy.LRU).maxEntries(1)
         .jmxStatistics().enable()
         .persistence()
            .passivation(true)
            .addStore(DummyInMemoryStoreConfigurationBuilder.class);
View Full Code Here

   }

   public void testDefineMultipleCachesWithEviction() {
      for (int i = 0; i < 50; i++) {
         ConfigurationBuilder cfg = new ConfigurationBuilder();
         cfg
            .eviction().strategy(EvictionStrategy.LIRS).maxEntries(128) // 128 max entries
            .expiration().wakeUpInterval(100L)
            .locking().useLockStriping(false); // to minimize chances of deadlock in the unit test

         String cacheName = Integer.toString(i);
View Full Code Here

      });
   }

   private Cache<String, Integer> configureAndBuildCache(int capacity) {
      ConfigurationBuilder config = new ConfigurationBuilder();
      config
         .eviction().maxEntries(capacity).strategy(EvictionStrategy.LRU)
         .expiration().wakeUpInterval(5000L).maxIdle(120000L);

      EmbeddedCacheManager cm = TestCacheManagerFactory.createCacheManager(config);
      cm.start();
View Full Code Here

public class LocalDeltaAwarePassivationTest extends LocalDeltaAwareEvictionTest {

   @Override
   protected void createCacheManagers() throws Throwable {
      ConfigurationBuilder configBuilder = TestCacheManagerFactory.getDefaultCacheConfiguration(true);
      configBuilder.eviction().maxEntries(1).strategy(EvictionStrategy.LRU)
            .persistence().passivation(true).addStore(DummyInMemoryStoreConfigurationBuilder.class);

      addClusterEnabledCacheManager(configBuilder);
   }
View Full Code Here

      protected final Cache<String, String> cache;
      protected final LockableStore store;

      private static ConfigurationBuilder config(boolean passivation) {
         ConfigurationBuilder config = new ConfigurationBuilder();
         config.eviction().maxEntries(1).persistence().passivation(passivation).addStore(LockableStoreConfigurationBuilder.class).async().enable();
         return config;
      }

      OneEntryCacheManagerCallable(boolean passivation) {
         super(TestCacheManagerFactory.createCacheManager(config(passivation)));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.