public class ClusterTopology extends Object
ClusterTopology
holds snapshot like information about RedisClusterNode
s.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
RedisClusterNode s. |
Set<RedisClusterNode> |
getSlotServingNodes(int slot)
Get the
RedisClusterNode s (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()
RedisClusterNode
s.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)
RedisClusterNode
s (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.ClusterStateFailureException
public RedisClusterNode lookup(String host, int port)
RedisClusterNode
matching given host and port.host
- must not be null.port
- ClusterStateFailureException
public RedisClusterNode lookup(String nodeId)
RedisClusterNode
matching given nodeId.nodeId
- must not be null.ClusterStateFailureException
public RedisClusterNode lookup(RedisClusterNode node)
node
- must not be nullClusterStateFailureException
public Set<RedisClusterNode> getKeyServingNodes(byte[] key)
key
- must not be null.Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.