Package org.jboss.cache

Examples of org.jboss.cache.Region.registerEvictionEvent()


            parent.addChild(fqn.getLastElement(), target);
            // JBCACHE-913
            Region region = cache.getRegion(fqn, false);
            if (region != null && region.getEvictionRegionConfig() != null)
            {
               region.registerEvictionEvent(fqn, EvictionEvent.Type.ADD_NODE_EVENT, attrs == null ? 0 : attrs.size());
            }
         }

         // Recursively call, which will walk down the tree
         // and return the next NodeData that's a child of our parent
View Full Code Here


      Fqn fqn1 = Fqn.fromString("/a/b/c");
      Fqn fqn2 = Fqn.fromString("/a/b/d");
      Fqn fqn3 = Fqn.fromString("/a/b/e");

      Region region = regionManager.getRegion("/a/b", true);
      region.registerEvictionEvent(fqn1, EvictionEvent.Type.ADD_NODE_EVENT);
      region.registerEvictionEvent(fqn2, EvictionEvent.Type.ADD_NODE_EVENT);
      region.registerEvictionEvent(fqn3, EvictionEvent.Type.ADD_NODE_EVENT);

      assertEquals("queue size ", 3, getQueueSize((RegionImpl) region));
      EvictionEvent node = takeLastEvent((RegionImpl) region);
View Full Code Here

      Fqn fqn2 = Fqn.fromString("/a/b/d");
      Fqn fqn3 = Fqn.fromString("/a/b/e");

      Region region = regionManager.getRegion("/a/b", true);
      region.registerEvictionEvent(fqn1, EvictionEvent.Type.ADD_NODE_EVENT);
      region.registerEvictionEvent(fqn2, EvictionEvent.Type.ADD_NODE_EVENT);
      region.registerEvictionEvent(fqn3, EvictionEvent.Type.ADD_NODE_EVENT);

      assertEquals("queue size ", 3, getQueueSize((RegionImpl) region));
      EvictionEvent node = takeLastEvent((RegionImpl) region);
      Fqn fqn = node.getFqn();
View Full Code Here

      Fqn fqn3 = Fqn.fromString("/a/b/e");

      Region region = regionManager.getRegion("/a/b", true);
      region.registerEvictionEvent(fqn1, EvictionEvent.Type.ADD_NODE_EVENT);
      region.registerEvictionEvent(fqn2, EvictionEvent.Type.ADD_NODE_EVENT);
      region.registerEvictionEvent(fqn3, EvictionEvent.Type.ADD_NODE_EVENT);

      assertEquals("queue size ", 3, getQueueSize((RegionImpl) region));
      EvictionEvent node = takeLastEvent((RegionImpl) region);
      Fqn fqn = node.getFqn();
      assertEquals("DataNode retrieved should be FILO ", fqn, fqn1);
View Full Code Here

      Fqn fqn1 = Fqn.fromString("/a/b/c");
      Fqn fqn2 = Fqn.fromString("/a/b/d");
      Fqn fqn3 = Fqn.fromString("/a/b/e");

      Region region = regionManager.getRegion("/a/b", true);
      region.registerEvictionEvent(fqn1, EvictionEvent.Type.REMOVE_NODE_EVENT);
      region.registerEvictionEvent(fqn2, EvictionEvent.Type.ADD_NODE_EVENT);
      region.registerEvictionEvent(fqn3, EvictionEvent.Type.VISIT_NODE_EVENT);

      assertEquals("RemovedNode queue size ", 3, getQueueSize((RegionImpl) region));
      EvictionEvent.Type event = takeLastEvent((RegionImpl) region).getEventType();
View Full Code Here

      Fqn fqn2 = Fqn.fromString("/a/b/d");
      Fqn fqn3 = Fqn.fromString("/a/b/e");

      Region region = regionManager.getRegion("/a/b", true);
      region.registerEvictionEvent(fqn1, EvictionEvent.Type.REMOVE_NODE_EVENT);
      region.registerEvictionEvent(fqn2, EvictionEvent.Type.ADD_NODE_EVENT);
      region.registerEvictionEvent(fqn3, EvictionEvent.Type.VISIT_NODE_EVENT);

      assertEquals("RemovedNode queue size ", 3, getQueueSize((RegionImpl) region));
      EvictionEvent.Type event = takeLastEvent((RegionImpl) region).getEventType();
      assertEquals("DataNode retrieved should be: ", EvictionEvent.Type.REMOVE_NODE_EVENT, event);
View Full Code Here

      Fqn fqn3 = Fqn.fromString("/a/b/e");

      Region region = regionManager.getRegion("/a/b", true);
      region.registerEvictionEvent(fqn1, EvictionEvent.Type.REMOVE_NODE_EVENT);
      region.registerEvictionEvent(fqn2, EvictionEvent.Type.ADD_NODE_EVENT);
      region.registerEvictionEvent(fqn3, EvictionEvent.Type.VISIT_NODE_EVENT);

      assertEquals("RemovedNode queue size ", 3, getQueueSize((RegionImpl) region));
      EvictionEvent.Type event = takeLastEvent((RegionImpl) region).getEventType();
      assertEquals("DataNode retrieved should be: ", EvictionEvent.Type.REMOVE_NODE_EVENT, event);
      takeLastEvent((RegionImpl) region);
View Full Code Here

      Region region = regionManager.getRegion("/a/b", true);
      // This should succeed, alhtough it will produce warning over the threshold.
      for (int i = 0; i < EvictionConfig.EVENT_QUEUE_SIZE_DEFAULT - 1; i++)
      {
         region.registerEvictionEvent(fqn2, EvictionEvent.Type.ADD_NODE_EVENT);
      }

   }

   void log(String msg)
View Full Code Here

      region.setEvictionRegionConfig(new EvictionRegionConfig(region.getFqn(), new MockEvictionAlgorithmConfig()));

      for (int i = 0; i < (recycleQueueCapacity + 1); i++)
      {
         Fqn fqn = Fqn.fromString("/a/b/c/" + Integer.toString(i + 1));
         region.registerEvictionEvent(fqn, EvictionEvent.Type.ADD_NODE_EVENT);
      }

      ExecutorService executor = Executors.newSingleThreadExecutor();
      Future<Void> future = executor.submit(new ProcessEvictionRegion((RegionImpl) region, algorithm));
View Full Code Here

            parent.addChild(fqn.getLastElement(), target);
            // JBCACHE-913
            Region region = cache.getRegion(fqn, false);
            if (region != null && region.getEvictionRegionConfig() != null)
            {
               region.registerEvictionEvent(fqn, EvictionEvent.Type.ADD_NODE_EVENT, attrs == null ? 0 : attrs.size(), null, null);
            }
         }

         // Recursively call, which will walk down the tree
         // and return the next NodeData that's a child of our parent
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.