Class JedisSentinelConnection
java.lang.Object
org.springframework.data.redis.connection.jedis.JedisSentinelConnection
- All Implemented Interfaces:
Closeable,AutoCloseable,RedisSentinelCommands,RedisSentinelConnection
- Since:
- 1.4
- Author:
- Christoph Strobl
-
Constructor Summary
ConstructorsConstructorDescriptionJedisSentinelConnection(String host, int port) JedisSentinelConnection(RedisNode sentinel) JedisSentinelConnection(redis.clients.jedis.Jedis jedis) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voiddoInit(redis.clients.jedis.Jedis jedis) Do what ever is required to establish the connection to redis.voidForce a failover as if the master was not reachable.booleanisOpen()masters()Get aCollectionof monitored masters and their state.voidmonitor(RedisServer server) Tell sentinel to start monitoring a new master with the specifiedRedisNode.getName(),RedisNode.getHost(),RedisNode.getPort(), andRedisServer.getQuorum().voidvoidRemoves given master.Show list of replicas for given master.
-
Constructor Details
-
JedisSentinelConnection
-
JedisSentinelConnection
-
JedisSentinelConnection
public JedisSentinelConnection(redis.clients.jedis.Jedis jedis)
-
-
Method Details
-
failover
Description copied from interface:RedisSentinelCommandsForce a failover as if the master was not reachable.- Specified by:
failoverin interfaceRedisSentinelCommands- Parameters:
master- must not be null.
-
masters
Description copied from interface:RedisSentinelCommandsGet aCollectionof monitored masters and their state.- Specified by:
mastersin interfaceRedisSentinelCommands- Returns:
- Collection of
RedisServers. Never null.
-
replicas
Description copied from interface:RedisSentinelCommandsShow list of replicas for given master.- Specified by:
replicasin interfaceRedisSentinelCommands- Parameters:
master- must not be null.- Returns:
- Collection of
RedisServers. Never null.
-
replicas
- Parameters:
masterName-- Returns:
- See Also:
-
remove
Description copied from interface:RedisSentinelCommandsRemoves given master. The server will no longer be monitored and will no longer be returned byRedisSentinelCommands.masters().- Specified by:
removein interfaceRedisSentinelCommands- Parameters:
master- must not be null.
-
remove
- Parameters:
masterName-- See Also:
-
monitor
Description copied from interface:RedisSentinelCommandsTell sentinel to start monitoring a new master with the specifiedRedisNode.getName(),RedisNode.getHost(),RedisNode.getPort(), andRedisServer.getQuorum().- Specified by:
monitorin interfaceRedisSentinelCommands- Parameters:
server- must not be null.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
doInit
protected void doInit(redis.clients.jedis.Jedis jedis) Do what ever is required to establish the connection to redis.- Parameters:
jedis-
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceRedisSentinelConnection- Returns:
- true if connected to server
-