Class TopologyInfo
- java.lang.Object
-
- org.infinispan.client.hotrod.impl.TopologyInfo
-
@NotThreadSafe public final class TopologyInfo extends Object
Maintains topology information about caches.- Author:
- gustavonalle, Dan Berindei
-
-
Constructor Summary
Constructors Constructor Description TopologyInfo(Configuration configuration, ClusterInfo clusterInfo)
-
Method Summary
-
-
-
Constructor Detail
-
TopologyInfo
public TopologyInfo(Configuration configuration, ClusterInfo clusterInfo)
-
-
Method Detail
-
getPrimarySegmentsByServer
public Map<SocketAddress,Set<Integer>> getPrimarySegmentsByServer(byte[] cacheName)
-
getServers
public List<InetSocketAddress> getServers(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(WrappedBytes cacheName)
-
getOrCreateCacheInfo
public CacheInfo getOrCreateCacheInfo(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(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(WrappedBytes cacheName, CacheInfo oldCacheInfo, CacheInfo newCacheInfo)
-
forEachCache
public void forEachCache(BiConsumer<WrappedBytes,CacheInfo> action)
-
-