public class ClusterTopology extends Object
ClusterTopology holds snapshot like information about RedisClusterNodes.| Constructor and Description |
|---|
ClusterTopology(Set<RedisClusterNode> nodes)
Creates new instance of
ClusterTopology. |
| Modifier and Type | Method and Description |
|---|---|
Set<RedisClusterNode> |
getActiveMasterNodes()
Get all master nodes in cluster where
link-state is connected and flags does not contain
fail or fail?. |
Set<RedisClusterNode> |
getActiveNodes()
Get all nodes (master and slave) in cluster where
link-state is connected and flags does
not contain fail or fail?. |
RedisClusterNode |
getKeyServingMasterNode(byte[] key)
Get the
RedisClusterNode that is the current master serving the given key. |
Set<RedisClusterNode> |
getKeyServingNodes(byte[] key) |
Set<RedisClusterNode> |
getMasterNodes()
Get all master nodes in cluster.
|
Set<RedisClusterNode> |
getNodes()
Get all
RedisClusterNodes. |
Set<RedisClusterNode> |
getSlotServingNodes(int slot)
Get the
RedisClusterNodes (master and slave) serving s specific slot. |
RedisClusterNode |
lookup(RedisClusterNode node)
|
RedisClusterNode |
lookup(String nodeId)
Get the
RedisClusterNode matching given nodeId. |
RedisClusterNode |
lookup(String host,
int port)
Get the
RedisClusterNode matching given host and port. |
public ClusterTopology(@Nullable Set<RedisClusterNode> nodes)
ClusterTopology.nodes - can be null.public Set<RedisClusterNode> getNodes()
RedisClusterNodes.public Set<RedisClusterNode> getActiveNodes()
link-state is connected and flags does
not contain fail or fail?.public Set<RedisClusterNode> getActiveMasterNodes()
link-state is connected and flags does not contain
fail or fail?.public Set<RedisClusterNode> getMasterNodes()
public Set<RedisClusterNode> getSlotServingNodes(int slot)
RedisClusterNodes (master and slave) serving s specific slot.slot - public RedisClusterNode getKeyServingMasterNode(byte[] key)
RedisClusterNode that is the current master serving the given key.key - must not be null.ClusterStateFailureExceptionpublic RedisClusterNode lookup(String host, int port)
RedisClusterNode matching given host and port.host - must not be null.port - ClusterStateFailureExceptionpublic RedisClusterNode lookup(String nodeId)
RedisClusterNode matching given nodeId.nodeId - must not be null.ClusterStateFailureExceptionpublic RedisClusterNode lookup(RedisClusterNode node)
node - must not be nullClusterStateFailureExceptionpublic Set<RedisClusterNode> getKeyServingNodes(byte[] key)
key - must not be null.Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.