javainfinispaninfinispan-9

Infinispan eviction with tree cache


I am searching for a way to make the default eviction of infinispan work with the TreeCache implementation. By now I searched the documentation and google but found nothing that fits my question. This is the current configuration of the cache in the infinispan xml:

<distributed-cache name="example">
    <transaction mode="BATCH" locking="PESSIMISTIC"/>
    <memory>
        <object size="10" />
    </memory>
</distributed-cache>

Now my question is, is there a simple way I just have not found by now or do I have to create my own EvictionManager and handle it by my self?


Solution

  • Unfortunately, TreeMap and eviction don't mix very well together. Eviction removes the least frequently used element (for on JVM heap storage). This can remove intermediate nodes of the TreeMap causing essentially linkage errors. All parent nodes would have to be accessed when a child node is accessed to try to guarantee consistency, causing a big performance impact (not implemented).