Package org.redisson.redisnode
Class SentinelRedisNode
java.lang.Object
org.redisson.redisnode.SentinelRedisNode
- All Implemented Interfaces:
RedisNode
,RedisNodeAsync
,RedisSentinel
,RedisSentinelAsync
- Author:
- Nikita Koksharov
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.redisson.api.redisnode.RedisNode
RedisNode.InfoSection
-
Constructor Summary
ConstructorDescriptionSentinelRedisNode
(RedisClient client, CommandAsyncExecutor commandAsyncService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Runs an Append Only File rewrite process.Runs an Append Only File rewrite process.void
bgSave()
Runs the Redis database saving process in background.Runs the Redis database saving process in background.boolean
void
Starts failover process for defined Redis masterfailoverAsync
(String masterName) Starts failover process for defined Redis mastergetAddr()
Get Redis node addressGet value of Redis configuration parameter.getConfigAsync
(String parameter) Get value of Redis configuration parameter.Returns time of the last successful Redis database save operation.Returns time of the last successful Redis database save operation.Returns map containing info regarding defined Redis master.getMasterAddr
(String masterName) Returns network address of defined Redis master.getMasterAddrAsync
(String masterName) Returns network address of defined Redis master.getMasterAsync
(String masterName) Returns map containing info regarding defined Redis master.Returns list of map containing info regarding Redis Master server monitored by current Redis Sentinel server.Returns list of map containing info regarding Redis Master server monitored by current Redis Sentinel server.Returns Redis memory statisticsReturns Redis memory statisticsgetSentinels
(String masterName) Returns list of map containing info regarding Redis Sentinel server monitoring defined master.getSentinelsAsync
(String masterName) Returns list of map containing info regarding Redis Sentinel server monitoring defined master.Returns list of map containing info regarding Redis Slave server of defined master.getSlavesAsync
(String masterName) Returns list of map containing info regarding Redis Slave server of defined master.int
hashCode()
info
(RedisNode.InfoSection section) Returns information about Redis node.infoAsync
(RedisNode.InfoSection section) Returns information about Redis node.boolean
ping()
Ping Redis node.boolean
Ping Redis node with specified timeout.Ping Redis node.Ping Redis node with specified timeout.void
save()
Save the Redis database.Save the Redis database.void
Save the Redis database in background.Save the Redis database in background.void
Set value of Redis configuration parameter.setConfigAsync
(String parameter, String value) Set value of Redis configuration parameter.long
size()
Returns keys amount stored in this Redis node.Returns keys amount stored in this Redis node.time()
Returns current Redis server time in secondsReturns current Redis server time in secondstoString()
-
Constructor Details
-
SentinelRedisNode
-
-
Method Details
-
getClient
-
getAddr
Description copied from interface:RedisNode
Get Redis node address -
getMemoryStatistics
Description copied from interface:RedisNode
Returns Redis memory statistics- Specified by:
getMemoryStatistics
in interfaceRedisNode
- Returns:
- statistics info map
-
getMemoryStatisticsAsync
Description copied from interface:RedisNodeAsync
Returns Redis memory statistics- Specified by:
getMemoryStatisticsAsync
in interfaceRedisNodeAsync
- Returns:
- statistics info map
-
pingAsync
Description copied from interface:RedisNodeAsync
Ping Redis node. Default timeout is 1000 milliseconds- Specified by:
pingAsync
in interfaceRedisNodeAsync
- Returns:
true
if "PONG" reply received,false
otherwise
-
pingAsync
Description copied from interface:RedisNodeAsync
Ping Redis node with specified timeout.- Specified by:
pingAsync
in interfaceRedisNodeAsync
- Parameters:
timeout
- - ping timeouttimeUnit
- - timeout unit- Returns:
true
if "PONG" reply received,false
otherwise
-
ping
public boolean ping()Description copied from interface:RedisNode
Ping Redis node. Default timeout is 1000 milliseconds -
ping
Description copied from interface:RedisNode
Ping Redis node with specified timeout. -
hashCode
public int hashCode() -
equals
-
timeAsync
Description copied from interface:RedisNodeAsync
Returns current Redis server time in seconds- Specified by:
timeAsync
in interfaceRedisNodeAsync
- Returns:
- time in seconds
-
time
Description copied from interface:RedisNode
Returns current Redis server time in seconds -
toString
-
info
Description copied from interface:RedisNode
Returns information about Redis node. -
infoAsync
Description copied from interface:RedisNodeAsync
Returns information about Redis node.- Specified by:
infoAsync
in interfaceRedisNodeAsync
- Parameters:
section
- - section of information- Returns:
- information map
-
getMasterAddr
Description copied from interface:RedisSentinel
Returns network address of defined Redis master.- Specified by:
getMasterAddr
in interfaceRedisSentinel
- Parameters:
masterName
- - name of master- Returns:
- network address
-
getSentinels
Description copied from interface:RedisSentinel
Returns list of map containing info regarding Redis Sentinel server monitoring defined master.- Specified by:
getSentinels
in interfaceRedisSentinel
- Parameters:
masterName
- - name of master- Returns:
- list of Redis Sentinels
-
getMasters
Description copied from interface:RedisSentinel
Returns list of map containing info regarding Redis Master server monitored by current Redis Sentinel server.- Specified by:
getMasters
in interfaceRedisSentinel
- Returns:
- list of Redis Masters
-
getSlaves
Description copied from interface:RedisSentinel
Returns list of map containing info regarding Redis Slave server of defined master.- Specified by:
getSlaves
in interfaceRedisSentinel
- Parameters:
masterName
- - name of master- Returns:
- list of Redis Slaves
-
getMaster
Description copied from interface:RedisSentinel
Returns map containing info regarding defined Redis master.- Specified by:
getMaster
in interfaceRedisSentinel
- Parameters:
masterName
- - name of master- Returns:
- map containing info
-
failover
Description copied from interface:RedisSentinel
Starts failover process for defined Redis master- Specified by:
failover
in interfaceRedisSentinel
- Parameters:
masterName
- - name of master
-
getMasterAddrAsync
Description copied from interface:RedisSentinelAsync
Returns network address of defined Redis master.- Specified by:
getMasterAddrAsync
in interfaceRedisSentinelAsync
- Parameters:
masterName
- - name of master- Returns:
- network address
-
getSentinelsAsync
Description copied from interface:RedisSentinelAsync
Returns list of map containing info regarding Redis Sentinel server monitoring defined master.- Specified by:
getSentinelsAsync
in interfaceRedisSentinelAsync
- Parameters:
masterName
- - name of master- Returns:
- list of Redis Sentinels
-
getMastersAsync
Description copied from interface:RedisSentinelAsync
Returns list of map containing info regarding Redis Master server monitored by current Redis Sentinel server.- Specified by:
getMastersAsync
in interfaceRedisSentinelAsync
- Returns:
- list of Redis Masters
-
getSlavesAsync
Description copied from interface:RedisSentinelAsync
Returns list of map containing info regarding Redis Slave server of defined master.- Specified by:
getSlavesAsync
in interfaceRedisSentinelAsync
- Parameters:
masterName
- - name of master- Returns:
- list of Redis Slaves
-
getMasterAsync
Description copied from interface:RedisSentinelAsync
Returns map containing info regarding defined Redis master.- Specified by:
getMasterAsync
in interfaceRedisSentinelAsync
- Parameters:
masterName
- - name of master- Returns:
- map containing info
-
failoverAsync
Description copied from interface:RedisSentinelAsync
Starts failover process for defined Redis master- Specified by:
failoverAsync
in interfaceRedisSentinelAsync
- Parameters:
masterName
- - name of master
-
getConfig
Description copied from interface:RedisNode
Get value of Redis configuration parameter. -
setConfig
Description copied from interface:RedisNode
Set value of Redis configuration parameter. -
getConfigAsync
Description copied from interface:RedisNodeAsync
Get value of Redis configuration parameter.- Specified by:
getConfigAsync
in interfaceRedisNodeAsync
- Parameters:
parameter
- - name of parameter- Returns:
- value of parameter
-
setConfigAsync
Description copied from interface:RedisNodeAsync
Set value of Redis configuration parameter.- Specified by:
setConfigAsync
in interfaceRedisNodeAsync
- Parameters:
parameter
- - name of parametervalue
- - value of parameter- Returns:
- void
-
bgSave
public void bgSave()Description copied from interface:RedisNode
Runs the Redis database saving process in background. -
scheduleBgSave
public void scheduleBgSave()Description copied from interface:RedisNode
Save the Redis database in background. If AOF rewrite process is in progress then the background save is scheduled to run upon its completion.- Specified by:
scheduleBgSave
in interfaceRedisNode
-
save
public void save()Description copied from interface:RedisNode
Save the Redis database. -
getLastSaveTime
Description copied from interface:RedisNode
Returns time of the last successful Redis database save operation.- Specified by:
getLastSaveTime
in interfaceRedisNode
- Returns:
- time
-
bgSaveAsync
Description copied from interface:RedisNodeAsync
Runs the Redis database saving process in background.- Specified by:
bgSaveAsync
in interfaceRedisNodeAsync
-
scheduleBgSaveAsync
Description copied from interface:RedisNodeAsync
Save the Redis database in background. If AOF rewrite process is in progress then the background save is scheduled to run upon its completion.- Specified by:
scheduleBgSaveAsync
in interfaceRedisNodeAsync
-
saveAsync
Description copied from interface:RedisNodeAsync
Save the Redis database.- Specified by:
saveAsync
in interfaceRedisNodeAsync
-
getLastSaveTimeAsync
Description copied from interface:RedisNodeAsync
Returns time of the last successful Redis database save operation.- Specified by:
getLastSaveTimeAsync
in interfaceRedisNodeAsync
- Returns:
- time
-
bgRewriteAOF
public void bgRewriteAOF()Description copied from interface:RedisNode
Runs an Append Only File rewrite process. Starts only if there is no a background process doing persistence.If fails no data gets lost
- Specified by:
bgRewriteAOF
in interfaceRedisNode
-
bgRewriteAOFAsync
Description copied from interface:RedisNodeAsync
Runs an Append Only File rewrite process. Starts only if there is no a background process doing persistence.If fails no data gets lost
- Specified by:
bgRewriteAOFAsync
in interfaceRedisNodeAsync
-
size
public long size()Description copied from interface:RedisNode
Returns keys amount stored in this Redis node. -
sizeAsync
Description copied from interface:RedisNodeAsync
Returns keys amount stored in this Redis node.- Specified by:
sizeAsync
in interfaceRedisNodeAsync
- Returns:
- keys amount
-