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)
RedisSentinelCommands
failover
in interface RedisSentinelCommands
master
- must not be null.public List<RedisServer> masters()
RedisSentinelCommands
Collection
of monitored masters and their state.masters
in interface RedisSentinelCommands
RedisServer
s. Never null.public List<RedisServer> slaves(NamedNode master)
RedisSentinelCommands
slaves
in interface RedisSentinelCommands
master
- must not be null.RedisServer
s. Never null.public List<RedisServer> slaves(String masterName)
masterName
- RedisSentinelCommands.slaves(NamedNode)
public void remove(NamedNode master)
RedisSentinelCommands
RedisSentinelCommands.masters()
.remove
in interface RedisSentinelCommands
master
- must not be null.public void remove(String masterName)
masterName
- RedisSentinelCommands.remove(NamedNode)
public void monitor(RedisServer server)
RedisSentinelCommands
RedisNode.getName()
,
RedisNode.getHost()
, RedisNode.getPort()
, and RedisServer.getQuorum()
.monitor
in interface RedisSentinelCommands
server
- must not be null.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
protected void doInit(redis.clients.jedis.Jedis jedis)
jedis
- public boolean isOpen()
isOpen
in interface RedisSentinelConnection
Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.