1 Reply Latest reply on Dec 28, 2005 9:50 PM by ben.wang

    Eviction for keys

    ask10000

      I have only one node in my TreeCache. I add all the objects in the same node.

      for(int i=0;i<10000;i++){
       cache.put("/a", new String("key" + i), new String("value" + i);
      }
      


      How do I configure my eviction policy so that I have only 500 key-value pairs in memory and the rest passivated to disk. All the configurations I could see were for nodes rather than keys. Has anybody implemented an eviction policy for this kinda requirement?


        • 1. Re: Eviction for keys

          I think using just one node in treecache kind of defeats the purpose. you should consider putting it under different nodes. Concurrency will be much better that way. If you really cant, consider hash your keys to dividie them into different buckets, for example.

          Cuurrently we don't support key based eviction, although there is a jira issue for it.

          -Ben