Package org.infinispan.hotrod.impl.cache
Class TopologyInfo
- java.lang.Object
-
- org.infinispan.hotrod.impl.cache.TopologyInfo
-
@NotThreadSafe public final class TopologyInfo extends Object
Maintains topology information about caches.
-
-
Constructor Summary
Constructors Constructor Description TopologyInfo(HotRodConfiguration configuration, ClusterInfo clusterInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SegmentConsistentHashcreateConsistentHash(int numSegments, short hashFunctionVersion, SocketAddress[][] segmentOwners)voidforEachCache(BiConsumer<org.infinispan.commons.marshall.WrappedBytes,CacheInfo> action)Collection<InetSocketAddress>getAllServers()CacheInfogetCacheInfo(org.infinispan.commons.marshall.WrappedBytes cacheName)CacheTopologyInfogetCacheTopologyInfo(byte[] cacheName)ClusterInfogetCluster()ConsistentHashFactorygetConsistentHashFactory()CacheInfogetOrCreateCacheInfo(org.infinispan.commons.marshall.WrappedBytes cacheName)Map<SocketAddress,Set<Integer>>getPrimarySegmentsByServer(byte[] cacheName)List<InetSocketAddress>getServers(org.infinispan.commons.marshall.WrappedBytes cacheName)intgetTopologyAge()voidreset(org.infinispan.commons.marshall.WrappedBytes cacheName)Reset a single ache to the initial server list.voidswitchCluster(ClusterInfo newCluster)Switch to another cluster and update the topologies of all caches with its initial server list.voidupdateCacheInfo(org.infinispan.commons.marshall.WrappedBytes cacheName, CacheInfo oldCacheInfo, CacheInfo newCacheInfo)
-
-
-
Constructor Detail
-
TopologyInfo
public TopologyInfo(HotRodConfiguration configuration, ClusterInfo clusterInfo)
-
-
Method Detail
-
getPrimarySegmentsByServer
public Map<SocketAddress,Set<Integer>> getPrimarySegmentsByServer(byte[] cacheName)
-
getServers
public List<InetSocketAddress> getServers(org.infinispan.commons.marshall.WrappedBytes cacheName)
-
getAllServers
public Collection<InetSocketAddress> getAllServers()
-
createConsistentHash
public SegmentConsistentHash createConsistentHash(int numSegments, short hashFunctionVersion, SocketAddress[][] segmentOwners)
-
getConsistentHashFactory
public ConsistentHashFactory getConsistentHashFactory()
-
getCacheTopologyInfo
public CacheTopologyInfo getCacheTopologyInfo(byte[] cacheName)
-
getCacheInfo
public CacheInfo getCacheInfo(org.infinispan.commons.marshall.WrappedBytes cacheName)
-
getOrCreateCacheInfo
public CacheInfo getOrCreateCacheInfo(org.infinispan.commons.marshall.WrappedBytes cacheName)
-
switchCluster
public void switchCluster(ClusterInfo newCluster)
Switch to another cluster and update the topologies of all caches with its initial server list.
-
reset
public void reset(org.infinispan.commons.marshall.WrappedBytes cacheName)
Reset a single ache to the initial server list.Useful if there are still live servers in the cluster, but all the server in this cache's current topology are unreachable.
-
getCluster
public ClusterInfo getCluster()
-
getTopologyAge
public int getTopologyAge()
-
updateCacheInfo
public void updateCacheInfo(org.infinispan.commons.marshall.WrappedBytes cacheName, CacheInfo oldCacheInfo, CacheInfo newCacheInfo)
-
forEachCache
public void forEachCache(BiConsumer<org.infinispan.commons.marshall.WrappedBytes,CacheInfo> action)
-
-