Package org.jboss.cache.util.internals

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


      c1 = (CacheSPI) new UnitTestCacheFactory<Object, Object>().createCache(c, false, getClass());
      c2 = (CacheSPI) new UnitTestCacheFactory<Object, Object>().createCache(c.clone(), false, getClass());

      c1.start();
      c2.start();
      ec1 = new EvictionController(c1);
      ec2 = new EvictionController(c2);
      TestingUtil.blockUntilViewsReceived(60000, c1, c2);
      registerCaches(c1, c2);
   }
View Full Code Here


      evConfig.addEvictionRegionConfig(new EvictionRegionConfig(Fqn.fromString("/org/jboss/test/data"), new LFUAlgorithmConfig(maxNodesR2, minNodesR2)));
      config.setEvictionConfig(evConfig);
      config.setTransactionManagerLookupClass("org.jboss.cache.transaction.DummyTransactionManagerLookup");
      config.setIsolationLevel(IsolationLevel.SERIALIZABLE);
      cache = (CacheSPI<Object, Object>) new UnitTestCacheFactory<Object, Object>().createCache(config, true, getClass());
      evController = new EvictionController(cache);
   }
View Full Code Here

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

      new EvictionController(cache).startEviction();

      for (int i = 0; i < 5; i++)
      {
         Fqn f = Fqn.fromString(rootStr + i);
         assert null == cache.getNode(f) : f + " should be null";
View Full Code Here

      assert n != null;
      val = (String) n.get(rootStr + "7");
      assertNotNull("Node should not be empty ", val);
      retrieverThread.interrupt();
      retrieverThread.join();
      new EvictionController(cache).startEviction(true);
      assert waitForEviction(cache, 30, TimeUnit.SECONDS, Fqn.fromString(rootStr + 7));
      val = (String) cache.get(rootStr + "7", rootStr + "7");
      assertNull("Node should be empty ", val);
   }
View Full Code Here

      Fqn fqn1 = Fqn.fromString(str1);
      String str2 = rootStr + "7/7";
      Fqn fqn2 = Fqn.fromString(str2);
      cache.get(fqn1, str1);// just to keep it fresh
      cache.get(fqn2, str2);// just to keep it fresh
      new EvictionController(cache).startEviction();
      cache.get(fqn1, str1);// just to keep it fresh
      cache.get(fqn2, str2);// just to keep it fresh
      new EvictionController(cache).startEviction();
      String val = (String) cache.get(rootStr + "7/7", rootStr + "7/7");
      assertNotNull("Node should not be empty ", val);
      cache.removeNode(fqn1);
      TestingUtil.sleepThread(wakeupIntervalMillis + 500);
      new EvictionController(cache).startEviction();
      val = (String) cache.get(rootStr + "7/7", rootStr + "7/7");
      assertNull("Node should be empty ", val);
   }
View Full Code Here

      {
         Fqn f = Fqn.fromString("/base/" + i);
         cache.put(f, "key", "base" + i);
      }

      new EvictionController(cache).startEviction();
      assert ew.waitForEviction(30, TimeUnit.SECONDS);

      assertEquals(baseRegionMaxNodes, cache.getRoot().getChild(Fqn.fromString("/base")).getChildren().size());

   }
View Full Code Here

   @BeforeMethod(alwaysRun = true)
   public void setUp() throws Exception
   {
      initCache();
      wakeupIntervalMillis = cache.getConfiguration().getEvictionConfig().getWakeupInterval();
      evController = new EvictionController(cache);
   }
View Full Code Here

      cache.put("/org/jboss/test/data/b", "/org/jboss/test/data/b", "/org/jboss/test/data/b");
      cache.put("/org/jboss/test/data/c", "/org/jboss/test/data/c", "/org/jboss/test/data/c");
      cache.put("/org/jboss/test/data/d", "/org/jboss/test/data/d", "/org/jboss/test/data/d");
      cache.put("/org/jboss/test/data/e", "/org/jboss/test/data/e", "/org/jboss/test/data/e");

      EvictionController ec = new EvictionController(cache);
      ec.startEviction();

      cache.put("/org/jboss/test/data/f", "/org/jboss/test/data/f", "/org/jboss/test/data/f");
      cache.put("/org/jboss/test/data/g", "/org/jboss/test/data/g", "/org/jboss/test/data/g");
      cache.put("/org/jboss/test/data/h", "/org/jboss/test/data/h", "/org/jboss/test/data/h");
      assertNotNull(cache.get("/org/jboss/test/data/a", "/org/jboss/test/data/a"));
      assertNotNull(cache.get("/org/jboss/test/data/b", "/org/jboss/test/data/b"));

      ec.startEviction();

      assertNull(cache.get("/org/jboss/test/data/a", "/org/jboss/test/data/a"));
      assertNull(cache.get("/org/jboss/test/data/b", "/org/jboss/test/data/b"));
   }
View Full Code Here

      cache.put("/org/jboss/test/data/b", "/org/jboss/test/data/b", "/org/jboss/test/data/b");
      cache.put("/org/jboss/test/data/c", "/org/jboss/test/data/c", "/org/jboss/test/data/c");
      cache.put("/org/jboss/test/data/d", "/org/jboss/test/data/d", "/org/jboss/test/data/d");
      cache.put("/org/jboss/test/data/e", "/org/jboss/test/data/e", "/org/jboss/test/data/e");

      EvictionController ec = new EvictionController(cache);
      ec.startEviction();


      cache.removeNode("/org/jboss/test/data/d");
      cache.removeNode("/org/jboss/test/data/e");
      cache.put("/org/jboss/test/data/f", "/org/jboss/test/data/f", "/org/jboss/test/data/f");
      cache.put("/org/jboss/test/data/g", "/org/jboss/test/data/g", "/org/jboss/test/data/g");

      ec.startEviction();

      assertNull(cache.get("/org/jboss/test/data/d", "/org/jboss/test/data/d"));
      assertNull(cache.get("/org/jboss/test/data/e", "/org/jboss/test/data/e"));

      assertNotNull(cache.get("/org/jboss/test/data/f", "/org/jboss/test/data/f"));
View Full Code Here

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

      EvictionController evController = new EvictionController(cache);
      evController.startEviction();

      TestingUtil.sleepThread(200); // small grace period

      for (int i = 0; i < 10; i++)
      {
View Full Code Here

TOP

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

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.