public class RedisNode extends Object implements RedisClusterMaster, RedisClusterSlave, RedisMaster, RedisSlave, RedisClusterMasterAsync, RedisClusterSlaveAsync, RedisMasterAsync, RedisSlaveAsync
RedisNode.InfoSection
Constructor and Description |
---|
RedisNode(RedisClient client,
CommandSyncService commandExecutor,
NodeType type) |
Modifier and Type | Method and Description |
---|---|
void |
clusterAddSlots(int... slots)
Adds slots to this Redis node
|
RFuture<Void> |
clusterAddSlotsAsync(int... slots)
Adds slots to this Redis node
|
long |
clusterCountFailureReports(String nodeId)
Returns number of failure reports for Redis node by defined id
|
RFuture<Long> |
clusterCountFailureReportsAsync(String nodeId)
Returns number of failure reports for Redis node by defined id
|
long |
clusterCountKeysInSlot(int slot)
Counts keys in defined slot
|
RFuture<Long> |
clusterCountKeysInSlotAsync(int slot)
Counts keys in defined slot
|
void |
clusterDeleteSlots(int... slots)
Removes slots from this Redis node
|
RFuture<Void> |
clusterDeleteSlotsAsync(int... slots)
Removes slots from this Redis node
|
void |
clusterFlushSlots()
Removes all slots from this Redis node
|
RFuture<Void> |
clusterFlushSlotsAsync()
Removes all slots from this Redis node
|
void |
clusterForget(String nodeId)
Removes Redis node by defined id from Cluster
|
RFuture<Void> |
clusterForgetAsync(String nodeId)
Removes Redis node by defined id from Cluster
|
List<String> |
clusterGetKeysInSlot(int slot,
int count)
Returns keys in defines slot limited by count
|
RFuture<List<String>> |
clusterGetKeysInSlotAsync(int slot,
int count)
Returns keys in defines slot limited by count
|
String |
clusterId()
Returns id of this Redis node
|
RFuture<String> |
clusterIdAsync()
Returns id of this Redis node
|
Map<String,String> |
clusterInfo()
Returns cluster information reported by this Redis node
|
RFuture<Map<String,String>> |
clusterInfoAsync()
Returns cluster information reported by this Redis node
|
void |
clusterMeet(String address)
Joins Redis node by the defined address to Cluster
Address example:
redis://127.0.0.1:9233 |
RFuture<Void> |
clusterMeetAsync(String address)
Joins Redis node by the defined address to Cluster
Address example:
redis://127.0.0.1:9233 |
void |
clusterReplicate(String nodeId)
Reconfigures this Redis node as replica of Redis node by defined id.
|
RFuture<Void> |
clusterReplicateAsync(String nodeId)
Reconfigures this Redis node as replica of Redis node by defined id.
|
void |
clusterSetSlot(int slot,
SetSlotCommand command)
Sets slot to this Redis node according to defined command
|
void |
clusterSetSlot(int slot,
SetSlotCommand command,
String nodeId)
Sets slot to this Redis node according to defined command
|
RFuture<Void> |
clusterSetSlotAsync(int slot,
SetSlotCommand command)
Sets slot to this Redis node according to defined command
|
RFuture<Void> |
clusterSetSlotAsync(int slot,
SetSlotCommand command,
String nodeId)
Sets slot to this Redis node according to defined command
|
Map<ClusterSlotRange,Set<String>> |
clusterSlots()
Return Redis Cluster slots mapped to Redis nodes
|
RFuture<Map<ClusterSlotRange,Set<String>>> |
clusterSlotsAsync()
Return Redis Cluster slots mapped to Redis nodes
|
boolean |
equals(Object obj) |
InetSocketAddress |
getAddr()
Get Redis node address
|
RedisClient |
getClient() |
Map<String,String> |
getConfig(String parameter)
Get value of Redis configuration parameter.
|
RFuture<Map<String,String>> |
getConfigAsync(String parameter)
Get value of Redis configuration parameter.
|
Map<String,String> |
getMemoryStatistics()
Returns Redis memory statistics
|
RFuture<Map<String,String>> |
getMemoryStatisticsAsync()
Returns Redis memory statistics
|
int |
hashCode() |
Map<String,String> |
info(RedisNode.InfoSection section)
Returns information about Redis node.
|
RFuture<Map<String,String>> |
infoAsync(RedisNode.InfoSection section)
Returns information about Redis node.
|
boolean |
ping()
Ping Redis node.
|
boolean |
ping(long timeout,
TimeUnit timeUnit)
Ping Redis node with specified timeout.
|
RFuture<Boolean> |
pingAsync()
Ping Redis node.
|
RFuture<Boolean> |
pingAsync(long timeout,
TimeUnit timeUnit)
Ping Redis node with specified timeout.
|
void |
setConfig(String parameter,
String value)
Set value of Redis configuration parameter.
|
RFuture<Void> |
setConfigAsync(String parameter,
String value)
Set value of Redis configuration parameter.
|
Time |
time()
Returns current Redis server time in seconds
|
RFuture<Time> |
timeAsync()
Returns current Redis server time in seconds
|
String |
toString() |
public RedisNode(RedisClient client, CommandSyncService commandExecutor, NodeType type)
public RedisClient getClient()
public InetSocketAddress getAddr()
RedisNode
public RFuture<Boolean> pingAsync()
RedisNodeAsync
pingAsync
in interface RedisNodeAsync
true
if "PONG" reply received, false
otherwisepublic RFuture<Boolean> pingAsync(long timeout, TimeUnit timeUnit)
RedisNodeAsync
pingAsync
in interface RedisNodeAsync
timeout
- - ping timeouttimeUnit
- - timeout unittrue
if "PONG" reply received, false
otherwisepublic boolean ping()
RedisNode
public boolean ping(long timeout, TimeUnit timeUnit)
RedisNode
public RFuture<Time> timeAsync()
RedisNodeAsync
timeAsync
in interface RedisNodeAsync
public Time time()
RedisNode
public RFuture<Map<String,String>> clusterInfoAsync()
RedisClusterNodeAsync
clusterInfoAsync
in interface RedisClusterNodeAsync
public Map<String,String> clusterInfo()
RedisClusterNode
clusterInfo
in interface RedisClusterNode
public String clusterId()
RedisClusterNode
clusterId
in interface RedisClusterNode
public void clusterAddSlots(int... slots)
RedisClusterNode
clusterAddSlots
in interface RedisClusterNode
slots
- slots to addpublic void clusterReplicate(String nodeId)
RedisClusterNode
clusterReplicate
in interface RedisClusterNode
nodeId
- Redis node Idpublic void clusterForget(String nodeId)
RedisClusterNode
clusterForget
in interface RedisClusterNode
public void clusterDeleteSlots(int... slots)
RedisClusterNode
clusterDeleteSlots
in interface RedisClusterNode
slots
- slots to removepublic long clusterCountKeysInSlot(int slot)
RedisClusterNode
clusterCountKeysInSlot
in interface RedisClusterNode
slot
- slotpublic List<String> clusterGetKeysInSlot(int slot, int count)
RedisClusterNode
clusterGetKeysInSlot
in interface RedisClusterNode
slot
- slotcount
- limits keys amountpublic void clusterSetSlot(int slot, SetSlotCommand command)
RedisClusterNode
clusterSetSlot
in interface RedisClusterNode
slot
- slotcommand
- slot commandpublic void clusterSetSlot(int slot, SetSlotCommand command, String nodeId)
RedisClusterNode
clusterSetSlot
in interface RedisClusterNode
slot
- slotcommand
- slot commandnodeId
- Redis node idpublic void clusterMeet(String address)
RedisClusterNode
Address example: redis://127.0.0.1:9233
clusterMeet
in interface RedisClusterNode
address
- Redis node addresspublic long clusterCountFailureReports(String nodeId)
RedisClusterNode
clusterCountFailureReports
in interface RedisClusterNode
nodeId
- Redis node idpublic void clusterFlushSlots()
RedisClusterNode
clusterFlushSlots
in interface RedisClusterNode
public Map<ClusterSlotRange,Set<String>> clusterSlots()
RedisClusterNode
clusterSlots
in interface RedisClusterNode
public Map<String,String> info(RedisNode.InfoSection section)
RedisNode
public Map<String,String> getMemoryStatistics()
RedisNode
getMemoryStatistics
in interface RedisNode
public RFuture<Map<String,String>> getMemoryStatisticsAsync()
RedisNodeAsync
getMemoryStatisticsAsync
in interface RedisNodeAsync
public RFuture<String> clusterIdAsync()
RedisClusterNodeAsync
clusterIdAsync
in interface RedisClusterNodeAsync
public RFuture<Void> clusterAddSlotsAsync(int... slots)
RedisClusterNodeAsync
clusterAddSlotsAsync
in interface RedisClusterNodeAsync
slots
- slots to addpublic RFuture<Void> clusterReplicateAsync(String nodeId)
RedisClusterNodeAsync
clusterReplicateAsync
in interface RedisClusterNodeAsync
nodeId
- Redis node Idpublic RFuture<Void> clusterForgetAsync(String nodeId)
RedisClusterNodeAsync
clusterForgetAsync
in interface RedisClusterNodeAsync
public RFuture<Void> clusterDeleteSlotsAsync(int... slots)
RedisClusterNodeAsync
clusterDeleteSlotsAsync
in interface RedisClusterNodeAsync
slots
- slots to removepublic RFuture<Long> clusterCountKeysInSlotAsync(int slot)
RedisClusterNodeAsync
clusterCountKeysInSlotAsync
in interface RedisClusterNodeAsync
slot
- slotpublic RFuture<List<String>> clusterGetKeysInSlotAsync(int slot, int count)
RedisClusterNodeAsync
clusterGetKeysInSlotAsync
in interface RedisClusterNodeAsync
slot
- slotcount
- limits keys amountpublic RFuture<Void> clusterSetSlotAsync(int slot, SetSlotCommand command)
RedisClusterNodeAsync
clusterSetSlotAsync
in interface RedisClusterNodeAsync
slot
- slotcommand
- slot commandpublic RFuture<Void> clusterSetSlotAsync(int slot, SetSlotCommand command, String nodeId)
RedisClusterNodeAsync
clusterSetSlotAsync
in interface RedisClusterNodeAsync
slot
- slotcommand
- slot commandnodeId
- Redis node idpublic RFuture<Void> clusterMeetAsync(String address)
RedisClusterNodeAsync
Address example: redis://127.0.0.1:9233
clusterMeetAsync
in interface RedisClusterNodeAsync
address
- Redis node addresspublic RFuture<Long> clusterCountFailureReportsAsync(String nodeId)
RedisClusterNodeAsync
clusterCountFailureReportsAsync
in interface RedisClusterNodeAsync
nodeId
- Redis node idpublic RFuture<Void> clusterFlushSlotsAsync()
RedisClusterNodeAsync
clusterFlushSlotsAsync
in interface RedisClusterNodeAsync
public RFuture<Map<ClusterSlotRange,Set<String>>> clusterSlotsAsync()
RedisClusterNodeAsync
clusterSlotsAsync
in interface RedisClusterNodeAsync
public RFuture<Map<String,String>> infoAsync(RedisNode.InfoSection section)
RedisNodeAsync
infoAsync
in interface RedisNodeAsync
section
- - section of informationpublic Map<String,String> getConfig(String parameter)
RedisNode
public void setConfig(String parameter, String value)
RedisNode
public RFuture<Map<String,String>> getConfigAsync(String parameter)
RedisNodeAsync
getConfigAsync
in interface RedisNodeAsync
parameter
- - name of parameterpublic RFuture<Void> setConfigAsync(String parameter, String value)
RedisNodeAsync
setConfigAsync
in interface RedisNodeAsync
parameter
- - name of parametervalue
- - value of parameterCopyright © 2014–2021 Redisson. All rights reserved.