2 Replies Latest reply on Mar 30, 2009 4:28 AM by Jorge Morales

    Feature request for eviction policies

    Jorge Morales Master

      Hi,
      We are heavily using JBC, and think it is great. We have currently updated to version 3, and want to know if it is possible to implements some way an special behaviour we have, or if it could be a feature request, if it is likely to enhance the system for anybody.

      We have organized the cache like this:

      /OBJECTS/OBJECTS_1/a
       b
       c
      /OBJECTS/OBJECTS_2/a1
       b1
       c1
      
      

      We are putting objects (but not explicitly creating regions) and we want that every time we create a new region (under /OBJECTS/), like /OBJECTS/OBJECTS_1 an eviction policy of 10 max nodes be assigned to this region, so we can have a cache with regions of 10.
      Now we have a cache listener, and every time a node is created we check if it is a new region, and create the eviction policy explicitly.

      Is there a easier or better way to handle this?

        • 1. Re: Feature request for eviction policies
          Elias Ross Master

          Thinking outloud: Using a listener to dynamically add regions sounds fine, although each region has its own overhead, that is storage and CPU costs. Maybe 1000s of regions is fine, but what about 10000 or more? And you might want to consider what happens when a region is empty, i.e. consider how region de-allocation works.

          It might be easier to extend and/or implement your own eviction policy that tracks regions. I would probably prototype and test your solution than go to the trouble to implement a new eviction strategy, however.

          • 2. Re: Feature request for eviction policies
            Jorge Morales Master

            From what you say, I guess, that whenever I add a new Node, which is not in a previously created Region, JBC dos not create any Region`s specific infrastructure, so it is applying whatever configuration is configured for a topper lever region.
            Is this infrastructure so costly in means of memory?
            If I do a remove on Cache.ROOT, is all this infrastructure removed and freed? Also for subregions?
            I guess that it is not possible to create a RegionCreated event in cache listener, since creating a node with a new FQN (a region that was not explicitly created) is not creating any region infrastructure?