Class RedisClusterNode
java.lang.Object
org.springframework.data.redis.connection.RedisNode
org.springframework.data.redis.connection.RedisClusterNode
- All Implemented Interfaces:
NamedNode
Representation of a Redis server within the cluster.
- Since:
- 1.7
- Author:
- Christoph Strobl, Mark Paluch
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic classBuilder for creating newRedisClusterNode.static classNested classes/interfaces inherited from class RedisNode
RedisNode.NodeType, RedisNode.RedisNodeBuilder -
Field Summary
Fields inherited from class RedisNode
DEFAULT_PORT, DEFAULT_SENTINEL_PORT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates newRedisClusterNodewith an id and emptyRedisClusterNode.SlotRange.RedisClusterNode(String host, int port) Creates newRedisClusterNodewith emptyRedisClusterNode.SlotRange.RedisClusterNode(String host, int port, RedisClusterNode.SlotRange slotRange) Creates newRedisClusterNodewith givenRedisClusterNode.SlotRange.RedisClusterNode(RedisClusterNode.SlotRange slotRange) Creates newRedisClusterNodewith givenRedisClusterNode.SlotRange. -
Method Summary
Modifier and TypeMethodDescriptiongetFlags()@Nullable RedisClusterNode.LinkStateGet the servedRedisClusterNode.SlotRange.booleanbooleanGetRedisClusterNode.RedisClusterNodeBuilderfor creating newRedisClusterNode.booleanservesSlot(int slot) Determines whether thisRedisClusterNodemanages the identifiedslotin the cluster.toString()Methods inherited from class RedisNode
asString, equals, fromString, fromString, getHost, getId, getMasterId, getName, getPort, getPortOr, getRequiredHost, getRequiredPort, getType, hashCode, hasValidHost, isMaster, isReplica, newRedisNode, setId, setName
-
Constructor Details
-
RedisClusterNode
protected RedisClusterNode() -
RedisClusterNode
Creates newRedisClusterNodewith emptyRedisClusterNode.SlotRange.- Parameters:
host- must not be null.port-
-
RedisClusterNode
Creates newRedisClusterNodewith an id and emptyRedisClusterNode.SlotRange.- Parameters:
id- must not be null.
-
RedisClusterNode
Creates newRedisClusterNodewith givenRedisClusterNode.SlotRange.- Parameters:
slotRange- must not be null.
-
RedisClusterNode
Creates newRedisClusterNodewith givenRedisClusterNode.SlotRange.- Parameters:
host- must not be null.port-slotRange- must not be null.
-
-
Method Details
-
newRedisClusterNode
GetRedisClusterNode.RedisClusterNodeBuilderfor creating newRedisClusterNode.- Returns:
- never null.
-
getSlotRange
Get the servedRedisClusterNode.SlotRange.- Returns:
- never null.
-
servesSlot
public boolean servesSlot(int slot) Determines whether thisRedisClusterNodemanages the identifiedslotin the cluster.- Parameters:
slot-Integeridentifying the slot to evaluate.- Returns:
- true if slot is covered.
-
getLinkState
- Returns:
- can be null
-
isConnected
public boolean isConnected()- Returns:
- true if node is connected to cluster.
-
getFlags
- Returns:
- never null.
-
isMarkedAsFail
public boolean isMarkedAsFail()- Returns:
- true if node is marked as failing.
-
toString
-