简体   繁体   English

如何获取Infinispan缓存群集中的所有缓存名称

[英]How to get all the cache names in an Infinispan cache cluster

I am using Infinispan with jgroups in java. 我在Java中将Infinispan与jgroups一起使用。 I want to get all the cache names in an infinispan cache cluster. 我想获取infinispan缓存群集中的所有缓存名称。 I have tried using DefaultCacheManager.getCacheNames(); 我尝试使用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. 但它仅提供从其调用的jvm上访问的缓存,而不是该集群中的所有缓存。

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(); 一旦我访问了该jvm上的缓存,它就会变得可用,并且它开始进入我从DefaultCacheManager.getCacheNames()获得的缓存列表中。

I am using the same config file for infinispan and jgroups(using tcp). 我正在为infinispan和jgroups使用同一配置文件(使用tcp)。

Please suggest a way by which I can get all the cache names in a cluster. 请提出一种获取集群中所有缓存名称的方法。

Thanks, Ankur 谢谢,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. 不过,这似乎并不是您的情况,因此,我能想到的最简单的方法是在Infinispan中执行Map / Reduce功能,以从集群中的各个节点检索缓存名称,然后进行整理。

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 有关更多信息,请参阅https://docs.jboss.org/author/display/ISPN/Infinispan+Distributed+Execution+Frameworkhttps://www.jboss.org/dms/judcon/presentations/Boston2011/JUDConBoston2011_day2track2session2.pdf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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