public class RedisClusterNode extends Object implements Serializable, RedisNodeDescription
RedisClusterNode
is identified by its nodeId
. A
RedisClusterNode
can be a responsible master
for zero to
16384
slots, a slave of one master
of carry
different flags
.Modifier and Type | Class and Description |
---|---|
static class |
RedisClusterNode.NodeFlag
Redis Cluster node flags.
|
RedisInstance.Role
Constructor and Description |
---|
RedisClusterNode() |
RedisClusterNode(RedisURI uri,
String nodeId,
boolean connected,
String slaveOf,
long pingSentTimestamp,
long pongReceivedTimestamp,
long configEpoch,
List<Integer> slots,
Set<RedisClusterNode.NodeFlag> flags) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
long |
getConfigEpoch() |
Set<RedisClusterNode.NodeFlag> |
getFlags() |
String |
getNodeId() |
long |
getPingSentTimestamp() |
long |
getPongReceivedTimestamp() |
RedisInstance.Role |
getRole()
Returns the
RedisInstance.Role of the Redis Cluster node based on the
flags . |
String |
getSlaveOf() |
List<Integer> |
getSlots() |
RedisURI |
getUri() |
int |
hashCode() |
boolean |
isConnected() |
void |
setConfigEpoch(long configEpoch)
Sets the
configEpoch . |
void |
setConnected(boolean connected)
Sets the
connected flag. |
void |
setFlags(Set<RedisClusterNode.NodeFlag> flags)
Set of
node flags . |
void |
setNodeId(String nodeId)
Sets
nodeId . |
void |
setPingSentTimestamp(long pingSentTimestamp)
Sets the last
pingSentTimestamp . |
void |
setPongReceivedTimestamp(long pongReceivedTimestamp)
Sets the last
pongReceivedTimestamp . |
void |
setSlaveOf(String slaveOf)
Sets the replication source.
|
void |
setSlots(List<Integer> slots)
Sets the list of slots for which this
RedisClusterNode is the
RedisClusterNode.NodeFlag.MASTER . |
void |
setUri(RedisURI uri)
Sets thhe connection point details.
|
String |
toString() |
public RedisURI getUri()
getUri
in interface RedisNodeDescription
public void setUri(RedisURI uri)
uri
- the RedisURI
, must not be nullpublic String getNodeId()
public void setNodeId(String nodeId)
nodeId
.nodeId
- the nodeId
public boolean isConnected()
public void setConnected(boolean connected)
connected
flag. The connected
flag describes whether the node which provided details about the
node is connected to the particular RedisClusterNode
.connected
- the connected
flagpublic String getSlaveOf()
public void setSlaveOf(String slaveOf)
slaveOf
- the replication source, can be nullpublic long getPingSentTimestamp()
public void setPingSentTimestamp(long pingSentTimestamp)
pingSentTimestamp
.pingSentTimestamp
- the last pingSentTimestamp
public long getPongReceivedTimestamp()
public void setPongReceivedTimestamp(long pongReceivedTimestamp)
pongReceivedTimestamp
.pongReceivedTimestamp
- the last pongReceivedTimestamp
public long getConfigEpoch()
public void setConfigEpoch(long configEpoch)
configEpoch
.configEpoch
- the configEpoch
public void setSlots(List<Integer> slots)
RedisClusterNode
is the
RedisClusterNode.NodeFlag.MASTER
. The list is empty if this node
is not a master or the node is not responsible for any slots at all.slots
- list of slots, must not be null but may be emptypublic Set<RedisClusterNode.NodeFlag> getFlags()
public void setFlags(Set<RedisClusterNode.NodeFlag> flags)
node flags
.flags
- the set of node flags.public RedisInstance.Role getRole()
RedisInstance.Role
of the Redis Cluster node based on the
flags
.getRole
in interface RedisInstance
Copyright © 2016. All rights reserved.