Package org.redisson.redisnode
Class RedisNode
java.lang.Object
org.redisson.redisnode.RedisNode
- All Implemented Interfaces:
RedisClusterMaster,RedisClusterMasterAsync,RedisClusterNode,RedisClusterNodeAsync,RedisClusterSlave,RedisClusterSlaveAsync,RedisMaster,RedisMasterAsync,RedisNode,RedisNodeAsync,RedisSlave,RedisSlaveAsync
public class RedisNode
extends Object
implements RedisClusterMaster, RedisClusterSlave, RedisMaster, RedisSlave, RedisClusterMasterAsync, RedisClusterSlaveAsync, RedisMasterAsync, RedisSlaveAsync
- Author:
- Nikita Koksharov
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.redisson.api.redisnode.RedisNode
RedisNode.InfoSection -
Constructor Summary
ConstructorsConstructorDescriptionRedisNode(RedisClient client, CommandAsyncExecutor commandExecutor, NodeType type) -
Method Summary
Modifier and TypeMethodDescriptionvoidclusterAddSlots(int... slots) Adds slots to this Redis nodeclusterAddSlotsAsync(int... slots) Adds slots to this Redis nodelongclusterCountFailureReports(String nodeId) Returns number of failure reports for Redis node by defined idReturns number of failure reports for Redis node by defined idlongclusterCountKeysInSlot(int slot) Counts keys in defined slotclusterCountKeysInSlotAsync(int slot) Counts keys in defined slotvoidclusterDeleteSlots(int... slots) Removes slots from this Redis nodeclusterDeleteSlotsAsync(int... slots) Removes slots from this Redis nodevoidRemoves all slots from this Redis nodeRemoves all slots from this Redis nodevoidclusterForget(String nodeId) Removes Redis node by defined id from ClusterclusterForgetAsync(String nodeId) Removes Redis node by defined id from ClusterclusterGetKeysInSlot(int slot, int count) Returns keys in defines slot limited by countclusterGetKeysInSlotAsync(int slot, int count) Returns keys in defines slot limited by countReturns id of this Redis nodeReturns id of this Redis nodeReturns cluster information reported by this Redis nodeReturns cluster information reported by this Redis nodevoidclusterMeet(String address) Joins Redis node by the defined address to ClusterclusterMeetAsync(String address) Joins Redis node by the defined address to ClustervoidclusterReplicate(String nodeId) Reconfigures this Redis node as replica of Redis node by defined id.clusterReplicateAsync(String nodeId) Reconfigures this Redis node as replica of Redis node by defined id.voidclusterSetSlot(int slot, SetSlotCommand command) Sets slot to this Redis node according to defined commandvoidclusterSetSlot(int slot, SetSlotCommand command, String nodeId) Sets slot to this Redis node according to defined commandclusterSetSlotAsync(int slot, SetSlotCommand command) Sets slot to this Redis node according to defined commandclusterSetSlotAsync(int slot, SetSlotCommand command, String nodeId) Sets slot to this Redis node according to defined commandReturn Redis Cluster slots mapped to Redis nodesReturn Redis Cluster slots mapped to Redis nodesbooleangetAddr()Get Redis node addressGet value of Redis configuration parameter.getConfigAsync(String parameter) Get value of Redis configuration parameter.Returns Redis memory statisticsReturns Redis memory statisticsinthashCode()info(RedisNode.InfoSection section) Returns information about Redis node.infoAsync(RedisNode.InfoSection section) Returns information about Redis node.booleanping()Ping Redis node.booleanPing Redis node with specified timeout.Ping Redis node.Ping Redis node with specified timeout.voidSet value of Redis configuration parameter.setConfigAsync(String parameter, String value) Set value of Redis configuration parameter.time()Returns current Redis server time in secondsReturns current Redis server time in secondstoString()
-
Constructor Details
-
RedisNode
-
-
Method Details
-
getClient
-
getAddr
Description copied from interface:RedisNodeGet Redis node address -
pingAsync
Description copied from interface:RedisNodeAsyncPing Redis node. Default timeout is 1000 milliseconds- Specified by:
pingAsyncin interfaceRedisNodeAsync- Returns:
trueif "PONG" reply received,falseotherwise
-
pingAsync
Description copied from interface:RedisNodeAsyncPing Redis node with specified timeout.- Specified by:
pingAsyncin interfaceRedisNodeAsync- Parameters:
timeout- - ping timeouttimeUnit- - timeout unit- Returns:
trueif "PONG" reply received,falseotherwise
-
ping
public boolean ping()Description copied from interface:RedisNodePing Redis node. Default timeout is 1000 milliseconds -
ping
Description copied from interface:RedisNodePing Redis node with specified timeout. -
hashCode
public int hashCode() -
equals
-
timeAsync
Description copied from interface:RedisNodeAsyncReturns current Redis server time in seconds- Specified by:
timeAsyncin interfaceRedisNodeAsync- Returns:
- time in seconds
-
time
Description copied from interface:RedisNodeReturns current Redis server time in seconds -
toString
-
clusterInfoAsync
Description copied from interface:RedisClusterNodeAsyncReturns cluster information reported by this Redis node- Specified by:
clusterInfoAsyncin interfaceRedisClusterNodeAsync- Returns:
- cluster information
-
clusterInfo
Description copied from interface:RedisClusterNodeReturns cluster information reported by this Redis node- Specified by:
clusterInfoin interfaceRedisClusterNode- Returns:
- cluster information
-
clusterId
Description copied from interface:RedisClusterNodeReturns id of this Redis node- Specified by:
clusterIdin interfaceRedisClusterNode- Returns:
- Redis node Id
-
clusterAddSlots
public void clusterAddSlots(int... slots) Description copied from interface:RedisClusterNodeAdds slots to this Redis node- Specified by:
clusterAddSlotsin interfaceRedisClusterNode- Parameters:
slots- slots to add
-
clusterReplicate
Description copied from interface:RedisClusterNodeReconfigures this Redis node as replica of Redis node by defined id.- Specified by:
clusterReplicatein interfaceRedisClusterNode- Parameters:
nodeId- Redis node Id
-
clusterForget
Description copied from interface:RedisClusterNodeRemoves Redis node by defined id from Cluster- Specified by:
clusterForgetin interfaceRedisClusterNode
-
clusterDeleteSlots
public void clusterDeleteSlots(int... slots) Description copied from interface:RedisClusterNodeRemoves slots from this Redis node- Specified by:
clusterDeleteSlotsin interfaceRedisClusterNode- Parameters:
slots- slots to remove
-
clusterCountKeysInSlot
public long clusterCountKeysInSlot(int slot) Description copied from interface:RedisClusterNodeCounts keys in defined slot- Specified by:
clusterCountKeysInSlotin interfaceRedisClusterNode- Parameters:
slot- slot- Returns:
- keys amount
-
clusterGetKeysInSlot
Description copied from interface:RedisClusterNodeReturns keys in defines slot limited by count- Specified by:
clusterGetKeysInSlotin interfaceRedisClusterNode- Parameters:
slot- slotcount- limits keys amount- Returns:
- keys
-
clusterSetSlot
Description copied from interface:RedisClusterNodeSets slot to this Redis node according to defined command- Specified by:
clusterSetSlotin interfaceRedisClusterNode- Parameters:
slot- slotcommand- slot command
-
clusterSetSlot
Description copied from interface:RedisClusterNodeSets slot to this Redis node according to defined command- Specified by:
clusterSetSlotin interfaceRedisClusterNode- Parameters:
slot- slotcommand- slot commandnodeId- Redis node id
-
clusterMeet
Description copied from interface:RedisClusterNodeJoins Redis node by the defined address to ClusterAddress example:
redis://127.0.0.1:9233- Specified by:
clusterMeetin interfaceRedisClusterNode- Parameters:
address- Redis node address
-
clusterCountFailureReports
Description copied from interface:RedisClusterNodeReturns number of failure reports for Redis node by defined id- Specified by:
clusterCountFailureReportsin interfaceRedisClusterNode- Parameters:
nodeId- Redis node id- Returns:
- amount of failure reports
-
clusterFlushSlots
public void clusterFlushSlots()Description copied from interface:RedisClusterNodeRemoves all slots from this Redis node- Specified by:
clusterFlushSlotsin interfaceRedisClusterNode
-
clusterSlots
Description copied from interface:RedisClusterNodeReturn Redis Cluster slots mapped to Redis nodes- Specified by:
clusterSlotsin interfaceRedisClusterNode- Returns:
- slots mapping
-
info
Description copied from interface:RedisNodeReturns information about Redis node. -
getMemoryStatistics
Description copied from interface:RedisNodeReturns Redis memory statistics- Specified by:
getMemoryStatisticsin interfaceRedisNode- Returns:
- statistics info map
-
getMemoryStatisticsAsync
Description copied from interface:RedisNodeAsyncReturns Redis memory statistics- Specified by:
getMemoryStatisticsAsyncin interfaceRedisNodeAsync- Returns:
- statistics info map
-
clusterIdAsync
Description copied from interface:RedisClusterNodeAsyncReturns id of this Redis node- Specified by:
clusterIdAsyncin interfaceRedisClusterNodeAsync- Returns:
- Redis node Id
-
clusterAddSlotsAsync
Description copied from interface:RedisClusterNodeAsyncAdds slots to this Redis node- Specified by:
clusterAddSlotsAsyncin interfaceRedisClusterNodeAsync- Parameters:
slots- slots to add- Returns:
- void
-
clusterReplicateAsync
Description copied from interface:RedisClusterNodeAsyncReconfigures this Redis node as replica of Redis node by defined id.- Specified by:
clusterReplicateAsyncin interfaceRedisClusterNodeAsync- Parameters:
nodeId- Redis node Id- Returns:
- void
-
clusterForgetAsync
Description copied from interface:RedisClusterNodeAsyncRemoves Redis node by defined id from Cluster- Specified by:
clusterForgetAsyncin interfaceRedisClusterNodeAsync- Returns:
- void
-
clusterDeleteSlotsAsync
Description copied from interface:RedisClusterNodeAsyncRemoves slots from this Redis node- Specified by:
clusterDeleteSlotsAsyncin interfaceRedisClusterNodeAsync- Parameters:
slots- slots to remove- Returns:
- void
-
clusterCountKeysInSlotAsync
Description copied from interface:RedisClusterNodeAsyncCounts keys in defined slot- Specified by:
clusterCountKeysInSlotAsyncin interfaceRedisClusterNodeAsync- Parameters:
slot- slot- Returns:
- keys amount
-
clusterGetKeysInSlotAsync
Description copied from interface:RedisClusterNodeAsyncReturns keys in defines slot limited by count- Specified by:
clusterGetKeysInSlotAsyncin interfaceRedisClusterNodeAsync- Parameters:
slot- slotcount- limits keys amount- Returns:
- keys
-
clusterSetSlotAsync
Description copied from interface:RedisClusterNodeAsyncSets slot to this Redis node according to defined command- Specified by:
clusterSetSlotAsyncin interfaceRedisClusterNodeAsync- Parameters:
slot- slotcommand- slot command- Returns:
- void
-
clusterSetSlotAsync
Description copied from interface:RedisClusterNodeAsyncSets slot to this Redis node according to defined command- Specified by:
clusterSetSlotAsyncin interfaceRedisClusterNodeAsync- Parameters:
slot- slotcommand- slot commandnodeId- Redis node id- Returns:
- void
-
clusterMeetAsync
Description copied from interface:RedisClusterNodeAsyncJoins Redis node by the defined address to ClusterAddress example:
redis://127.0.0.1:9233- Specified by:
clusterMeetAsyncin interfaceRedisClusterNodeAsync- Parameters:
address- Redis node address- Returns:
- void
-
clusterCountFailureReportsAsync
Description copied from interface:RedisClusterNodeAsyncReturns number of failure reports for Redis node by defined id- Specified by:
clusterCountFailureReportsAsyncin interfaceRedisClusterNodeAsync- Parameters:
nodeId- Redis node id- Returns:
- amount of failure reports
-
clusterFlushSlotsAsync
Description copied from interface:RedisClusterNodeAsyncRemoves all slots from this Redis node- Specified by:
clusterFlushSlotsAsyncin interfaceRedisClusterNodeAsync- Returns:
- void
-
clusterSlotsAsync
Description copied from interface:RedisClusterNodeAsyncReturn Redis Cluster slots mapped to Redis nodes- Specified by:
clusterSlotsAsyncin interfaceRedisClusterNodeAsync- Returns:
- slots mapping
-
infoAsync
Description copied from interface:RedisNodeAsyncReturns information about Redis node.- Specified by:
infoAsyncin interfaceRedisNodeAsync- Parameters:
section- - section of information- Returns:
- information map
-
getConfig
Description copied from interface:RedisNodeGet value of Redis configuration parameter. -
setConfig
Description copied from interface:RedisNodeSet value of Redis configuration parameter. -
getConfigAsync
Description copied from interface:RedisNodeAsyncGet value of Redis configuration parameter.- Specified by:
getConfigAsyncin interfaceRedisNodeAsync- Parameters:
parameter- - name of parameter- Returns:
- value of parameter
-
setConfigAsync
Description copied from interface:RedisNodeAsyncSet value of Redis configuration parameter.- Specified by:
setConfigAsyncin interfaceRedisNodeAsync- Parameters:
parameter- - name of parametervalue- - value of parameter- Returns:
- void
-