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, org.infinispan.client.hotrod.impl.topology.ClusterInfo clusterInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.infinispan.client.hotrod.impl.consistenthash.SegmentConsistentHash
createConsistentHash(int numSegments, short hashFunctionVersion, SocketAddress[][] segmentOwners)
void
forEachCache(BiConsumer<WrappedBytes,org.infinispan.client.hotrod.impl.topology.CacheInfo> action)
Collection<InetSocketAddress>
getAllServers()
org.infinispan.client.hotrod.impl.topology.CacheInfo
getCacheInfo(WrappedBytes cacheName)
CacheTopologyInfo
getCacheTopologyInfo(byte[] cacheName)
org.infinispan.client.hotrod.impl.topology.ClusterInfo
getCluster()
org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashFactory
getConsistentHashFactory()
org.infinispan.client.hotrod.impl.topology.CacheInfo
getOrCreateCacheInfo(WrappedBytes cacheName)
Map<SocketAddress,Set<Integer>>
getPrimarySegmentsByServer(byte[] cacheName)
List<InetSocketAddress>
getServers(WrappedBytes cacheName)
int
getTopologyAge()
void
reset(WrappedBytes cacheName)
Reset a single ache to the initial server list.void
switchCluster(org.infinispan.client.hotrod.impl.topology.ClusterInfo newCluster)
Switch to another cluster and update the topologies of all caches with its initial server list.void
updateCacheInfo(WrappedBytes cacheName, org.infinispan.client.hotrod.impl.topology.CacheInfo oldCacheInfo, org.infinispan.client.hotrod.impl.topology.CacheInfo newCacheInfo)
-
-
-
Constructor Detail
-
TopologyInfo
public TopologyInfo(Configuration configuration, org.infinispan.client.hotrod.impl.topology.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 org.infinispan.client.hotrod.impl.consistenthash.SegmentConsistentHash createConsistentHash(int numSegments, short hashFunctionVersion, SocketAddress[][] segmentOwners)
-
getConsistentHashFactory
public org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashFactory getConsistentHashFactory()
-
getCacheTopologyInfo
public CacheTopologyInfo getCacheTopologyInfo(byte[] cacheName)
-
getCacheInfo
public org.infinispan.client.hotrod.impl.topology.CacheInfo getCacheInfo(WrappedBytes cacheName)
-
getOrCreateCacheInfo
public org.infinispan.client.hotrod.impl.topology.CacheInfo getOrCreateCacheInfo(WrappedBytes cacheName)
-
switchCluster
public void switchCluster(org.infinispan.client.hotrod.impl.topology.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 org.infinispan.client.hotrod.impl.topology.ClusterInfo getCluster()
-
getTopologyAge
public int getTopologyAge()
-
updateCacheInfo
public void updateCacheInfo(WrappedBytes cacheName, org.infinispan.client.hotrod.impl.topology.CacheInfo oldCacheInfo, org.infinispan.client.hotrod.impl.topology.CacheInfo newCacheInfo)
-
forEachCache
public void forEachCache(BiConsumer<WrappedBytes,org.infinispan.client.hotrod.impl.topology.CacheInfo> action)
-
-