I've a requirement where i've to evict the data in the cache based on LRU.
I've used the following configuration in the cache-config.xml
<?xml version="1.0"?>
<cache-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config" xsi:schemaLocation="http://xmlns.oracle.com/coherence/coherence-cache-config coherence-cache-config.xsd">
<caching-scheme-mapping>
<cache-mapping>
<cache-name>hello-cache</cache-name>
<scheme-name>distributed</scheme-name>
</cache-mapping>
</caching-scheme-mapping>
<caching-schemes>
<distributed-scheme>
<scheme-name>distributed</scheme-name>
<service-name>DistributedCache</service-name>
<backing-map-scheme>
<local-scheme>
<scheme-ref>LocalSizeLimited</scheme-ref>
</local-scheme>
</backing-map-scheme>
<autostart>true</autostart>
</distributed-scheme>
<local-scheme>
<scheme-name>LocalSizeLimited</scheme-name>
<eviction-policy>LRU</eviction-policy>
<high-units>5</high-units>
<expiry-delay>2m</expiry-delay>
</local-scheme>
</caching-schemes>
</cache-config>
Here i've given the eviction policy as LRU and expiry delay as 2mins.
I've insert some datas in the cache as
k1=hello
k2=world
k3=sample
Now i'm using the key k2 often so the eviction should be as follows
first it should evict k1 and then k3 and then k2 after 2mins..
But the eviction occurs based on the data i insert
i.e. first k1 and then k2 and then k3...
So can any of u tell how to configure for evicting the data based on LRU.
Thanks
Godwin