Package org.jboss.cache.util.internals

Examples of org.jboss.cache.util.internals.EvictionController$Signaller


      cacheConfig.setCacheMode(Configuration.CacheMode.LOCAL);
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(cacheConfig, false, getClass());
      cache.getConfiguration().getEvictionConfig().setWakeupInterval(1000);
      createNewRegion();
      cache.start();
      evController = new EvictionController(cache);
   }
View Full Code Here


   public void setUp() throws Exception
   {
      cache1 = createCache(1, null, true, false);
      cache1.getConfiguration().setEvictionConfig(getEvictionConfig());
      cache1.start();
      ec1 = new EvictionController(cache1);

      cache2 = (CacheSPI) new UnitTestCacheFactory<Object, Object>().createCache(cache1.getConfiguration().clone(), getClass());
      ec2 = new EvictionController(cache2);
      waitForSingleBuddy(cache1, cache2);

      TestingUtil.blockUntilViewsReceived(60000, cache1, cache2);
   }
View Full Code Here

   public void testEvictionOccurence() throws Exception
   {
      cache.put("/timeBased/test", "key", "value");
      assertTrue(cache.exists("/timeBased/test"));
      TestingUtil.sleepThread(2000);
      new EvictionController(cache).startEviction();
      assertTrue(!cache.exists("/timeBased/test"));
   }
View Full Code Here

      // in case any waiting threads in subclasses are waiting for the cache to be initialised
      cacheInitialisedLatch.countDown();

      assert cache.get(fqn, "k") != null : "Node should be in the cache";

      new EvictionController(cache).startEviction();

      assert cache.get(fqn, "k") != null : "Node should still be in cache due to a minTTL of 3 secs";

      // the last cache.get() would have updated the last modified tstamp so we need to wait at least 3 secs (+1 sec maybe for the eviction thread)
      // to make sure this is evicted.
      new EvictionController(cache).startEviction(true);
      assert waitForEviction(cache, 5, TimeUnit.SECONDS, fqn);

      assert cache.get(fqn, "k") == null : "Node should have been evicted";
   }
View Full Code Here

      EvictionConfig econf = new EvictionConfig(eRC);
      econf.setWakeupInterval(0);
      conf.setEvictionConfig(econf);
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(conf, false, getClass());
      cache.start();
      ec = new EvictionController(cache);

      future = System.currentTimeMillis() + 1500;
      past = System.currentTimeMillis() - 1500;
   }
View Full Code Here

   {
      try
      {
         log.info("update 1 from future to past");
         cache.put(fqn1, ExpirationAlgorithmConfig.EXPIRATION_KEY, future);
         new EvictionController(cache).startEviction();
         assertNotNull(cache.getNode(fqn1));
         cache.put(fqn1, ExpirationAlgorithmConfig.EXPIRATION_KEY, past);
         new EvictionController(cache).startEviction();
         assertNull(cache.getNode(fqn1));
      }
      finally
      {
         cache.removeNode(Fqn.ROOT);
View Full Code Here

      EvictionRegionConfig evictionRegionConfig = c.getEvictionConfig().getEvictionRegionConfig("/org/jboss/test/data");
      LRUAlgorithmConfig evictionAlgorithmConfig = (LRUAlgorithmConfig) evictionRegionConfig.getEvictionAlgorithmConfig();
      evictionAlgorithmConfig.setTimeToLive(-1);
      additionalConfiguration(c);
      final Cache<Object, Object> cache2 = new UnitTestCacheFactory<Object, Object>().createCache(c, getClass());
      EvictionController ec2 = new EvictionController(cache2);
      caches.put("evict2", cache2);

      assert cache2.getRoot().getChild(Fqn.fromString("/org/jboss/test/data/")).getChildren().size() == 10;
      ec2.startEviction();
      assert cache2.getRoot().getChild(Fqn.fromString("/org/jboss/test/data/")).getChildren().size() == 5;
   }
View Full Code Here

         {
            fail("Failed to insert data" + e);
            e.printStackTrace();
         }
      }
      EvictionController evictionController = new EvictionController(cache);
      evictionController.startEviction();

      try
      {
         String val = (String) cache.get(rootStr + "3", rootStr + "3");
         assertNull("DataNode should be empty ", val);
View Full Code Here

         String str = rootStr + i;
         Fqn fqn = Fqn.fromString(str);
         cache.put(fqn, str, str);
      }

      EvictionController evictionController = new EvictionController(cache);
      evictionController.startEviction();
      // wait a few secs for eviction to complete
//      TestingUtil.sleepThread(500);
      assertEquals("Number of nodes", maxNodes + 2, cache.getNumberOfNodes());
      for (int i = 0; i < maxNodes; i++)
      {
View Full Code Here

            fail("Failed to insert data" + e);
            e.printStackTrace();
         }
      }

      EvictionController evictionController = new EvictionController(cache);
      evictionController.startEviction();
      try
      {
         for (int i = 0; i < 5; i++)
         {
            String str = rootStr + Integer.toString(i);
View Full Code Here

TOP

Related Classes of org.jboss.cache.util.internals.EvictionController$Signaller

Copyright © 2018 www.massapicom. 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.