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
Modifier and TypeClassDescriptionstatic enum
static enum
static class
Builder for creating newRedisClusterNode
.static class
Nested classes/interfaces inherited from class org.springframework.data.redis.connection.RedisNode
RedisNode.NodeType, RedisNode.RedisNodeBuilder
-
Field Summary
Fields inherited from class org.springframework.data.redis.connection.RedisNode
DEFAULT_PORT, DEFAULT_SENTINEL_PORT
-
Constructor Summary
ModifierConstructorDescriptionprotected
Creates newRedisClusterNode
with an id and emptyRedisClusterNode.SlotRange
.RedisClusterNode
(String host, int port) Creates newRedisClusterNode
with emptyRedisClusterNode.SlotRange
.RedisClusterNode
(String host, int port, RedisClusterNode.SlotRange slotRange) Creates newRedisClusterNode
with givenRedisClusterNode.SlotRange
.RedisClusterNode
(RedisClusterNode.SlotRange slotRange) Creates newRedisClusterNode
with givenRedisClusterNode.SlotRange
. -
Method Summary
Modifier and TypeMethodDescriptiongetFlags()
Get the servedRedisClusterNode.SlotRange
.boolean
boolean
GetRedisClusterNode.RedisClusterNodeBuilder
for creating newRedisClusterNode
.boolean
servesSlot
(int slot) Determines whether thisRedisClusterNode
manages the identifiedslot
in the cluster.toString()
Methods inherited from class org.springframework.data.redis.connection.RedisNode
asString, equals, fromString, fromString, getHost, getId, getMasterId, getName, getPort, getType, hashCode, hasValidHost, isMaster, isReplica, newRedisNode, setId, setName
-
Constructor Details
-
RedisClusterNode
protected RedisClusterNode() -
RedisClusterNode
Creates newRedisClusterNode
with emptyRedisClusterNode.SlotRange
.- Parameters:
host
- must not be null.port
-
-
RedisClusterNode
Creates newRedisClusterNode
with an id and emptyRedisClusterNode.SlotRange
.- Parameters:
id
- must not be null.
-
RedisClusterNode
Creates newRedisClusterNode
with givenRedisClusterNode.SlotRange
.- Parameters:
slotRange
- must not be null.
-
RedisClusterNode
Creates newRedisClusterNode
with givenRedisClusterNode.SlotRange
.- Parameters:
host
- must not be null.port
-slotRange
- must not be null.
-
-
Method Details
-
newRedisClusterNode
GetRedisClusterNode.RedisClusterNodeBuilder
for creating newRedisClusterNode
.- Returns:
- never null.
-
getSlotRange
Get the servedRedisClusterNode.SlotRange
.- Returns:
- never null.
-
servesSlot
public boolean servesSlot(int slot) Determines whether thisRedisClusterNode
manages the identifiedslot
in the cluster.- Parameters:
slot
-Integer
identifying 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
-