I use Jboss 6. There is file infinispan-configs.xml which comes with infinispan. If you are useing entity cache you can change the config maxEntries. this will tell the eviction thread to leave the number of entries 'maxEntries'
in cache after doing pruning to cache. The maxEntries should be in power of 2
<eviction wakeUpInterval="0" maxEntries="131072" strategy="LRU"/>
Also these is size function in which you can use
I have entity cache named as "infinispan.infinicache.ReviewEntity"
so what I did
@Resource(name = "CacheManager/entity", mappedName = "java:CacheManager/entity")
protected EmbeddedCacheManager cm;
System.out.println("Size of cache ReviewEntity "+cm.getCache("infinispan.infinicache.ReviewEntity").size());
I hope this helps
Thanks Meena. But if I am using it in clustered mode, can I configure the way keys would be distributed amongst various nodes.
i.e. If have Node 1 and Node 2 in a clustered in distributed mode, then I would want 1 GB from Node 1 to be used and 2GB from Node2.
1 of 1 people found this helpful
I think eviction policy is local policy on each node. So i think it can be possible, you can try that. In waht mode are you runing Infinispan? Invalidation or replication. If you are runing in invalidation than it makes sense to have different size of each cache node. While in Replication I do not think it helps to have cache of different size.
Thanks. I can try that. We are running it in distributed mode.