public class JedisSentinelConnection extends Object implements RedisSentinelConnection
| Constructor and Description |
|---|
JedisSentinelConnection(redis.clients.jedis.Jedis jedis) |
JedisSentinelConnection(RedisNode sentinel) |
JedisSentinelConnection(String host,
int port) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
doInit(redis.clients.jedis.Jedis jedis)
Do what ever is required to establish the connection to redis.
|
void |
failover(NamedNode master)
Force a failover as if the master was not reachable.
|
boolean |
isOpen() |
List<RedisServer> |
masters()
Get a
Collection of monitored masters and their state. |
void |
monitor(RedisServer server)
Tell sentinel to start monitoring a new master with the specified
RedisNode.getName(),
RedisNode.getHost(), RedisNode.getPort(), and RedisServer.getQuorum(). |
void |
remove(NamedNode master)
Removes given master.
|
void |
remove(String masterName) |
List<RedisServer> |
slaves(NamedNode master)
Show list of slaves for given master.
|
List<RedisServer> |
slaves(String masterName) |
public JedisSentinelConnection(RedisNode sentinel)
public JedisSentinelConnection(String host, int port)
public JedisSentinelConnection(redis.clients.jedis.Jedis jedis)
public void failover(NamedNode master)
RedisSentinelCommandsfailover in interface RedisSentinelCommandsmaster - must not be null.public List<RedisServer> masters()
RedisSentinelCommandsCollection of monitored masters and their state.masters in interface RedisSentinelCommandsRedisServers. Never null.public List<RedisServer> slaves(NamedNode master)
RedisSentinelCommandsslaves in interface RedisSentinelCommandsmaster - must not be null.RedisServers. Never null.public List<RedisServer> slaves(String masterName)
masterName - RedisSentinelCommands.slaves(NamedNode)public void remove(NamedNode master)
RedisSentinelCommandsRedisSentinelCommands.masters().remove in interface RedisSentinelCommandsmaster - must not be null.public void remove(String masterName)
masterName - RedisSentinelCommands.remove(NamedNode)public void monitor(RedisServer server)
RedisSentinelCommandsRedisNode.getName(),
RedisNode.getHost(), RedisNode.getPort(), and RedisServer.getQuorum().monitor in interface RedisSentinelCommandsserver - must not be null.public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionprotected void doInit(redis.clients.jedis.Jedis jedis)
jedis - public boolean isOpen()
isOpen in interface RedisSentinelConnectionCopyright © 2011-2016–2016 Pivotal Software, Inc.. All rights reserved.