Package org.redisson.redisnode
Class SentinelRedisNode
- java.lang.Object
-
- org.redisson.redisnode.SentinelRedisNode
-
- All Implemented Interfaces:
RedisNode
,RedisNodeAsync
,RedisSentinel
,RedisSentinelAsync
public class SentinelRedisNode extends Object implements RedisSentinel, RedisSentinelAsync
- Author:
- Nikita Koksharov
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.redisson.api.redisnode.RedisNode
RedisNode.InfoSection
-
-
Constructor Summary
Constructors Constructor Description SentinelRedisNode(RedisClient client, CommandAsyncExecutor commandAsyncService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
void
failover(String masterName)
Starts failover process for defined Redis masterRFuture<Void>
failoverAsync(String masterName)
Starts failover process for defined Redis masterInetSocketAddress
getAddr()
Get Redis node addressRedisClient
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>
getMaster(String masterName)
Returns map containing info regarding defined Redis master.RedisURI
getMasterAddr(String masterName)
Returns network address of defined Redis master.RFuture<RedisURI>
getMasterAddrAsync(String masterName)
Returns network address of defined Redis master.RFuture<Map<String,String>>
getMasterAsync(String masterName)
Returns map containing info regarding defined Redis master.List<Map<String,String>>
getMasters()
Returns list of map containing info regarding Redis Master server monitored by current Redis Sentinel server.RFuture<List<Map<String,String>>>
getMastersAsync()
Returns list of map containing info regarding Redis Master server monitored by current Redis Sentinel server.Map<String,String>
getMemoryStatistics()
Returns Redis memory statisticsRFuture<Map<String,String>>
getMemoryStatisticsAsync()
Returns Redis memory statisticsList<Map<String,String>>
getSentinels(String masterName)
Returns list of map containing info regarding Redis Sentinel server monitoring defined master.RFuture<List<Map<String,String>>>
getSentinelsAsync(String masterName)
Returns list of map containing info regarding Redis Sentinel server monitoring defined master.List<Map<String,String>>
getSlaves(String masterName)
Returns list of map containing info regarding Redis Slave server of defined master.RFuture<List<Map<String,String>>>
getSlavesAsync(String masterName)
Returns list of map containing info regarding Redis Slave server of defined master.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 secondsRFuture<Time>
timeAsync()
Returns current Redis server time in secondsString
toString()
-
-
-
Constructor Detail
-
SentinelRedisNode
public SentinelRedisNode(RedisClient client, CommandAsyncExecutor commandAsyncService)
-
-
Method Detail
-
getClient
public RedisClient getClient()
-
getAddr
public InetSocketAddress getAddr()
Description copied from interface:RedisNode
Get Redis node address
-
getMemoryStatistics
public Map<String,String> getMemoryStatistics()
Description copied from interface:RedisNode
Returns Redis memory statistics- Specified by:
getMemoryStatistics
in interfaceRedisNode
- Returns:
- statistics info map
-
getMemoryStatisticsAsync
public RFuture<Map<String,String>> getMemoryStatisticsAsync()
Description copied from interface:RedisNodeAsync
Returns Redis memory statistics- Specified by:
getMemoryStatisticsAsync
in interfaceRedisNodeAsync
- Returns:
- statistics info map
-
pingAsync
public RFuture<Boolean> 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
public RFuture<Boolean> pingAsync(long timeout, TimeUnit timeUnit)
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
public boolean ping(long timeout, TimeUnit timeUnit)
Description copied from interface:RedisNode
Ping Redis node with specified timeout.
-
timeAsync
public RFuture<Time> timeAsync()
Description copied from interface:RedisNodeAsync
Returns current Redis server time in seconds- Specified by:
timeAsync
in interfaceRedisNodeAsync
- Returns:
- time in seconds
-
time
public Time time()
Description copied from interface:RedisNode
Returns current Redis server time in seconds
-
info
public Map<String,String> info(RedisNode.InfoSection section)
Description copied from interface:RedisNode
Returns information about Redis node.
-
infoAsync
public RFuture<Map<String,String>> infoAsync(RedisNode.InfoSection section)
Description copied from interface:RedisNodeAsync
Returns information about Redis node.- Specified by:
infoAsync
in interfaceRedisNodeAsync
- Parameters:
section
- - section of information- Returns:
- information map
-
getMasterAddr
public RedisURI getMasterAddr(String masterName)
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
public List<Map<String,String>> getSentinels(String masterName)
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
public List<Map<String,String>> 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
public List<Map<String,String>> getSlaves(String masterName)
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
public Map<String,String> getMaster(String masterName)
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
public void failover(String masterName)
Description copied from interface:RedisSentinel
Starts failover process for defined Redis master- Specified by:
failover
in interfaceRedisSentinel
- Parameters:
masterName
- - name of master
-
getMasterAddrAsync
public RFuture<RedisURI> getMasterAddrAsync(String masterName)
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
public RFuture<List<Map<String,String>>> getSentinelsAsync(String masterName)
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
public RFuture<List<Map<String,String>>> 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
public RFuture<List<Map<String,String>>> getSlavesAsync(String masterName)
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
public RFuture<Map<String,String>> getMasterAsync(String masterName)
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
public RFuture<Void> failoverAsync(String masterName)
Description copied from interface:RedisSentinelAsync
Starts failover process for defined Redis master- Specified by:
failoverAsync
in interfaceRedisSentinelAsync
- Parameters:
masterName
- - name of master
-
getConfig
public Map<String,String> getConfig(String parameter)
Description copied from interface:RedisNode
Get value of Redis configuration parameter.
-
setConfig
public void setConfig(String parameter, String value)
Description copied from interface:RedisNode
Set value of Redis configuration parameter.
-
getConfigAsync
public RFuture<Map<String,String>> getConfigAsync(String parameter)
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
public RFuture<Void> setConfigAsync(String parameter, String value)
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
-
-