public class RedisNode extends Object implements RedisClusterMaster, RedisClusterSlave, RedisMaster, RedisSlave, RedisClusterMasterAsync, RedisClusterSlaveAsync, RedisMasterAsync, RedisSlaveAsync
RedisNode.InfoSection| Constructor and Description |
|---|
RedisNode(RedisClient client,
CommandAsyncExecutor 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, CommandAsyncExecutor commandExecutor, NodeType type)
public RedisClient getClient()
public InetSocketAddress getAddr()
RedisNodepublic RFuture<Boolean> pingAsync()
RedisNodeAsyncpingAsync in interface RedisNodeAsynctrue if "PONG" reply received, false otherwisepublic RFuture<Boolean> pingAsync(long timeout, TimeUnit timeUnit)
RedisNodeAsyncpingAsync in interface RedisNodeAsynctimeout - - ping timeouttimeUnit - - timeout unittrue if "PONG" reply received, false otherwisepublic boolean ping()
RedisNodepublic boolean ping(long timeout,
TimeUnit timeUnit)
RedisNodepublic RFuture<Time> timeAsync()
RedisNodeAsynctimeAsync in interface RedisNodeAsyncpublic Time time()
RedisNodepublic RFuture<Map<String,String>> clusterInfoAsync()
RedisClusterNodeAsyncclusterInfoAsync in interface RedisClusterNodeAsyncpublic Map<String,String> clusterInfo()
RedisClusterNodeclusterInfo in interface RedisClusterNodepublic String clusterId()
RedisClusterNodeclusterId in interface RedisClusterNodepublic void clusterAddSlots(int... slots)
RedisClusterNodeclusterAddSlots in interface RedisClusterNodeslots - slots to addpublic void clusterReplicate(String nodeId)
RedisClusterNodeclusterReplicate in interface RedisClusterNodenodeId - Redis node Idpublic void clusterForget(String nodeId)
RedisClusterNodeclusterForget in interface RedisClusterNodepublic void clusterDeleteSlots(int... slots)
RedisClusterNodeclusterDeleteSlots in interface RedisClusterNodeslots - slots to removepublic long clusterCountKeysInSlot(int slot)
RedisClusterNodeclusterCountKeysInSlot in interface RedisClusterNodeslot - slotpublic List<String> clusterGetKeysInSlot(int slot, int count)
RedisClusterNodeclusterGetKeysInSlot in interface RedisClusterNodeslot - slotcount - limits keys amountpublic void clusterSetSlot(int slot,
SetSlotCommand command)
RedisClusterNodeclusterSetSlot in interface RedisClusterNodeslot - slotcommand - slot commandpublic void clusterSetSlot(int slot,
SetSlotCommand command,
String nodeId)
RedisClusterNodeclusterSetSlot in interface RedisClusterNodeslot - slotcommand - slot commandnodeId - Redis node idpublic void clusterMeet(String address)
RedisClusterNode
Address example: redis://127.0.0.1:9233
clusterMeet in interface RedisClusterNodeaddress - Redis node addresspublic long clusterCountFailureReports(String nodeId)
RedisClusterNodeclusterCountFailureReports in interface RedisClusterNodenodeId - Redis node idpublic void clusterFlushSlots()
RedisClusterNodeclusterFlushSlots in interface RedisClusterNodepublic Map<ClusterSlotRange,Set<String>> clusterSlots()
RedisClusterNodeclusterSlots in interface RedisClusterNodepublic Map<String,String> info(RedisNode.InfoSection section)
RedisNodepublic Map<String,String> getMemoryStatistics()
RedisNodegetMemoryStatistics in interface RedisNodepublic RFuture<Map<String,String>> getMemoryStatisticsAsync()
RedisNodeAsyncgetMemoryStatisticsAsync in interface RedisNodeAsyncpublic RFuture<String> clusterIdAsync()
RedisClusterNodeAsyncclusterIdAsync in interface RedisClusterNodeAsyncpublic RFuture<Void> clusterAddSlotsAsync(int... slots)
RedisClusterNodeAsyncclusterAddSlotsAsync in interface RedisClusterNodeAsyncslots - slots to addpublic RFuture<Void> clusterReplicateAsync(String nodeId)
RedisClusterNodeAsyncclusterReplicateAsync in interface RedisClusterNodeAsyncnodeId - Redis node Idpublic RFuture<Void> clusterForgetAsync(String nodeId)
RedisClusterNodeAsyncclusterForgetAsync in interface RedisClusterNodeAsyncpublic RFuture<Void> clusterDeleteSlotsAsync(int... slots)
RedisClusterNodeAsyncclusterDeleteSlotsAsync in interface RedisClusterNodeAsyncslots - slots to removepublic RFuture<Long> clusterCountKeysInSlotAsync(int slot)
RedisClusterNodeAsyncclusterCountKeysInSlotAsync in interface RedisClusterNodeAsyncslot - slotpublic RFuture<List<String>> clusterGetKeysInSlotAsync(int slot, int count)
RedisClusterNodeAsyncclusterGetKeysInSlotAsync in interface RedisClusterNodeAsyncslot - slotcount - limits keys amountpublic RFuture<Void> clusterSetSlotAsync(int slot, SetSlotCommand command)
RedisClusterNodeAsyncclusterSetSlotAsync in interface RedisClusterNodeAsyncslot - slotcommand - slot commandpublic RFuture<Void> clusterSetSlotAsync(int slot, SetSlotCommand command, String nodeId)
RedisClusterNodeAsyncclusterSetSlotAsync in interface RedisClusterNodeAsyncslot - slotcommand - slot commandnodeId - Redis node idpublic RFuture<Void> clusterMeetAsync(String address)
RedisClusterNodeAsync
Address example: redis://127.0.0.1:9233
clusterMeetAsync in interface RedisClusterNodeAsyncaddress - Redis node addresspublic RFuture<Long> clusterCountFailureReportsAsync(String nodeId)
RedisClusterNodeAsyncclusterCountFailureReportsAsync in interface RedisClusterNodeAsyncnodeId - Redis node idpublic RFuture<Void> clusterFlushSlotsAsync()
RedisClusterNodeAsyncclusterFlushSlotsAsync in interface RedisClusterNodeAsyncpublic RFuture<Map<ClusterSlotRange,Set<String>>> clusterSlotsAsync()
RedisClusterNodeAsyncclusterSlotsAsync in interface RedisClusterNodeAsyncpublic RFuture<Map<String,String>> infoAsync(RedisNode.InfoSection section)
RedisNodeAsyncinfoAsync in interface RedisNodeAsyncsection - - section of informationpublic Map<String,String> getConfig(String parameter)
RedisNodepublic void setConfig(String parameter, String value)
RedisNodepublic RFuture<Map<String,String>> getConfigAsync(String parameter)
RedisNodeAsyncgetConfigAsync in interface RedisNodeAsyncparameter - - name of parameterpublic RFuture<Void> setConfigAsync(String parameter, String value)
RedisNodeAsyncsetConfigAsync in interface RedisNodeAsyncparameter - - name of parametervalue - - value of parameterCopyright © 2014–2021 Redisson. All rights reserved.