简体   繁体   中英

How to get all the cache names in an Infinispan cache cluster

I am using Infinispan with jgroups in java. I want to get all the cache names in an infinispan cache cluster. I have tried using DefaultCacheManager.getCacheNames(); but it gives only caches which are accessed on that the jvm from which it is called from and not all the caches in that cluster.

Once i access a cache on that jvm, it becomes available and the it starts coming in the cachelist which i get from DefaultCacheManager.getCacheNames();

I am using the same config file for infinispan and jgroups(using tcp).

Please suggest a way by which I can get all the cache names in a cluster.

Thanks, Ankur

Hmmm, normally you'll have all caches defined cluster wide, so getting the cache names in a node is good enough to know the caches that are available cluster wide.

This doesn't seem to be your case though, so the easiest thing I can think of is to do a Map/Reduce functionality in Infinispan to retrieve the cache names from individual nodes in the cluster and then collate them.

For more info, see https://docs.jboss.org/author/display/ISPN/Infinispan+Distributed+Execution+Framework and https://www.jboss.org/dms/judcon/presentations/Boston2011/JUDConBoston2011_day2track2session2.pdf

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM