3 Replies Latest reply on Jun 21, 2006 8:18 PM by sgielen

    Set MaxAgeSeconds for subnodes of region

    sgielen

      Is it possible to configure a standard LRU eviction policy so it only evicts subnodes of a region? For example, I have a region \customers and I would like to evict the subnodes created under \customers after 30 seconds, but want to keep the parent \customers node.

      I tried numerous things, but it keeps deleting the \customers node (as expected) instead of the individual subnodes.

      Is the only way to get this done to configure a region for every subnode created?

        • 1. Re: Set MaxAgeSeconds for subnodes of region

          In eviction policy configuration, you can have nested regions like:

          Region I:
          /customer

          Region II;
          /customers/children

          and they can have different policy applied to it. Please check the TreeCache documentation (Eviction section) for details.

          • 2. Re: Set MaxAgeSeconds for subnodes of region
            sgielen

            I read all the documentation and examples, but am still stuck.

            I understand your reply for scenarios where the subnodes are fixed and hence can be configured in a region. But what if the subnodes are created at run-time and can be named anything. As I understand we can't create regions at run-time and configure new subnodes that way.

            To use my example again:

            At start-up:

            /customer

            Client adds subnode at run-time:

            /customer/cust XYZ

            Now I need node 'cust XYZ' to expire after a set period without losing the 'customer' branch (so end up with start-up tree again).

            Is that possible?

            • 3. Re: Set MaxAgeSeconds for subnodes of region
              sgielen

              Found it!
              Problem was that I stored the customer subnodes as key-value pairs. Now that I stored them as nodes the eviction policy keeps track of the subnodes. Doh!