1 Reply Latest reply on Feb 25, 2012 5:29 AM by Galder Zamarreño

    Cache vs TreeCache  - node count within branch & deletion

    Will Tatam Newbie

      At the moment I'm just using the regular Cache<String,Object> rather than TreeCache but from looking in the JMX console it appears that despite presenting an interface that appears much like Map<String,Object> in reality infinispan is storing the results in much more of a tree form.

       

      I am storing my results with a key of /a/b/c/d with a single key and the value is my object.

       

      If I'm waiting to be able to see how many objects I have stored inside the entire /a/b branch and be able to delete all of these entries in an efficient manner, what would be the code to do this ?

      Also, would I be better using the tree api ?

        • 1. Re: Cache vs TreeCache  - node count within branch & deletion
          Galder Zamarreño Master

          Will Tatam wrote:

           

          At the moment I'm just using the regular Cache<String,Object> rather than TreeCache but from looking in the JMX console it appears that despite presenting an interface that appears much like Map<String,Object> in reality infinispan is storing the results in much more of a tree form.

          ^ no idea what you're talking about :|

          I am storing my results with a key of /a/b/c/d with a single key and the value is my object.

           

          If I'm waiting to be able to see how many objects I have stored inside the entire /a/b branch and be able to delete all of these entries in an efficient manner, what would be the code to do this ?

          Also, would I be better using the tree api ?

          If you have some kind of tree structure, using the Cache api as is won't help you much without work on your side to figure out parent/child relationships. Tree api looks more suited.

           

          What are these keys to be precise? If you explain the actual use case, we might be able to help you even further.