public class Sentinel extends Object implements SentinelCommands, Closeable
Modifier and Type | Field and Description |
---|---|
protected Connection |
connection |
protected static byte[][] |
DUMMY_ARRAY |
Constructor and Description |
---|
Sentinel(Connection connection) |
Sentinel(HostAndPort hp) |
Sentinel(HostAndPort hostPort,
JedisClientConfig config) |
Sentinel(String uriString)
This constructor only accepts a URI string.
|
Sentinel(String host,
int port) |
Sentinel(String host,
int port,
boolean ssl) |
Sentinel(String host,
int port,
boolean ssl,
SSLSocketFactory sslSocketFactory,
SSLParameters sslParameters,
HostnameVerifier hostnameVerifier) |
Sentinel(String host,
int port,
int timeout) |
Sentinel(String host,
int port,
int timeout,
boolean ssl) |
Sentinel(String host,
int port,
int timeout,
boolean ssl,
SSLSocketFactory sslSocketFactory,
SSLParameters sslParameters,
HostnameVerifier hostnameVerifier) |
Sentinel(String host,
int port,
int connectionTimeout,
int soTimeout) |
Sentinel(String host,
int port,
int connectionTimeout,
int soTimeout,
boolean ssl) |
Sentinel(String host,
int port,
int connectionTimeout,
int soTimeout,
boolean ssl,
SSLSocketFactory sslSocketFactory,
SSLParameters sslParameters,
HostnameVerifier hostnameVerifier) |
Sentinel(String host,
int port,
int connectionTimeout,
int soTimeout,
int infiniteSoTimeout) |
Sentinel(String host,
int port,
int connectionTimeout,
int soTimeout,
int infiniteSoTimeout,
boolean ssl,
SSLSocketFactory sslSocketFactory,
SSLParameters sslParameters,
HostnameVerifier hostnameVerifier) |
Sentinel(String host,
int port,
JedisClientConfig config) |
Sentinel(URI uri) |
Sentinel(URI uri,
int timeout) |
Sentinel(URI uri,
int connectionTimeout,
int soTimeout) |
Sentinel(URI uri,
int connectionTimeout,
int soTimeout,
int infiniteSoTimeout,
SSLSocketFactory sslSocketFactory,
SSLParameters sslParameters,
HostnameVerifier hostnameVerifier) |
Sentinel(URI uri,
int connectionTimeout,
int soTimeout,
SSLSocketFactory sslSocketFactory,
SSLParameters sslParameters,
HostnameVerifier hostnameVerifier) |
Sentinel(URI uri,
int timeout,
SSLSocketFactory sslSocketFactory,
SSLParameters sslParameters,
HostnameVerifier hostnameVerifier) |
Sentinel(URI uri,
JedisClientConfig config) |
Sentinel(URI uri,
SSLSocketFactory sslSocketFactory,
SSLParameters sslParameters,
HostnameVerifier hostnameVerifier) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
connect() |
void |
disconnect() |
Connection |
getClient() |
Connection |
getConnection() |
boolean |
isBroken() |
boolean |
isConnected() |
void |
psubscribe(JedisPubSub jedisPubSub,
String... channels) |
String |
sentinelFailover(String masterName) |
List<String> |
sentinelGetMasterAddrByName(String masterName)
redis 127.0.0.1:26381> sentinel get-master-addr-by-name mymaster
1) "127.0.0.1"
2) "6379"
|
Map<String,String> |
sentinelMaster(String masterName) |
List<Map<String,String>> |
sentinelMasters()
redis 127.0.0.1:26381> sentinel masters
1) 1) "name"
2) "mymaster"
3) "ip"
4) "127.0.0.1"
5) "port"
6) "6379"
7) "runid"
8) "93d4d4e6e9c06d0eea36e27f31924ac26576081d"
9) "flags"
10) "master"
11) "pending-commands"
12) "0"
13) "last-ok-ping-reply"
14) "423"
15) "last-ping-reply"
16) "423"
17) "info-refresh"
18) "6107"
19) "num-slaves"
20) "1"
21) "num-other-sentinels"
22) "2"
23) "quorum"
24) "2"
|
String |
sentinelMonitor(String masterName,
String ip,
int port,
int quorum) |
String |
sentinelMyId() |
String |
sentinelRemove(String masterName) |
List<Map<String,String>> |
sentinelReplicas(String masterName) |
Long |
sentinelReset(String pattern)
redis 127.0.0.1:26381> sentinel reset mymaster
(integer) 1
|
List<Map<String,String>> |
sentinelSentinels(String masterName) |
String |
sentinelSet(String masterName,
Map<String,String> parameterMap) |
List<Map<String,String>> |
sentinelSlaves(String masterName)
redis 127.0.0.1:26381> sentinel slaves mymaster
1) 1) "name"
2) "127.0.0.1:6380"
3) "ip"
4) "127.0.0.1"
5) "port"
6) "6380"
7) "runid"
8) "d7f6c0ca7572df9d2f33713df0dbf8c72da7c039"
9) "flags"
10) "slave"
11) "pending-commands"
12) "0"
13) "last-ok-ping-reply"
14) "47"
15) "last-ping-reply"
16) "47"
17) "info-refresh"
18) "657"
19) "master-link-down-time"
20) "0"
21) "master-link-status"
22) "ok"
23) "master-host"
24) "localhost"
25) "master-port"
26) "6379"
27) "slave-priority"
28) "100"
|
void |
subscribe(JedisPubSub jedisPubSub,
String... channels) |
String |
toString() |
protected final Connection connection
protected static final byte[][] DUMMY_ARRAY
public Sentinel(String uriString)
JedisURIHelper.isValid(java.net.URI)
can be
used before this.uriString
- public Sentinel(HostAndPort hp)
public Sentinel(String host, int port)
public Sentinel(String host, int port, JedisClientConfig config)
public Sentinel(HostAndPort hostPort, JedisClientConfig config)
public Sentinel(String host, int port, boolean ssl)
public Sentinel(String host, int port, boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters, HostnameVerifier hostnameVerifier)
public Sentinel(String host, int port, int timeout)
public Sentinel(String host, int port, int timeout, boolean ssl)
public Sentinel(String host, int port, int timeout, boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters, HostnameVerifier hostnameVerifier)
public Sentinel(String host, int port, int connectionTimeout, int soTimeout)
public Sentinel(String host, int port, int connectionTimeout, int soTimeout, int infiniteSoTimeout)
public Sentinel(String host, int port, int connectionTimeout, int soTimeout, boolean ssl)
public Sentinel(String host, int port, int connectionTimeout, int soTimeout, boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters, HostnameVerifier hostnameVerifier)
public Sentinel(String host, int port, int connectionTimeout, int soTimeout, int infiniteSoTimeout, boolean ssl, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters, HostnameVerifier hostnameVerifier)
public Sentinel(URI uri)
public Sentinel(URI uri, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters, HostnameVerifier hostnameVerifier)
public Sentinel(URI uri, int timeout)
public Sentinel(URI uri, int timeout, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters, HostnameVerifier hostnameVerifier)
public Sentinel(URI uri, int connectionTimeout, int soTimeout)
public Sentinel(URI uri, int connectionTimeout, int soTimeout, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters, HostnameVerifier hostnameVerifier)
public Sentinel(URI uri, int connectionTimeout, int soTimeout, int infiniteSoTimeout, SSLSocketFactory sslSocketFactory, SSLParameters sslParameters, HostnameVerifier hostnameVerifier)
public Sentinel(URI uri, JedisClientConfig config)
public Sentinel(Connection connection)
public Connection getClient()
public Connection getConnection()
public void connect()
public void disconnect()
public boolean isConnected()
public boolean isBroken()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public String sentinelMyId()
sentinelMyId
in interface SentinelCommands
public List<Map<String,String>> sentinelMasters()
redis 127.0.0.1:26381> sentinel masters 1) 1) "name" 2) "mymaster" 3) "ip" 4) "127.0.0.1" 5) "port" 6) "6379" 7) "runid" 8) "93d4d4e6e9c06d0eea36e27f31924ac26576081d" 9) "flags" 10) "master" 11) "pending-commands" 12) "0" 13) "last-ok-ping-reply" 14) "423" 15) "last-ping-reply" 16) "423" 17) "info-refresh" 18) "6107" 19) "num-slaves" 20) "1" 21) "num-other-sentinels" 22) "2" 23) "quorum" 24) "2"
sentinelMasters
in interface SentinelCommands
public Map<String,String> sentinelMaster(String masterName)
sentinelMaster
in interface SentinelCommands
public List<Map<String,String>> sentinelSentinels(String masterName)
sentinelSentinels
in interface SentinelCommands
public List<String> sentinelGetMasterAddrByName(String masterName)
redis 127.0.0.1:26381> sentinel get-master-addr-by-name mymaster 1) "127.0.0.1" 2) "6379"
sentinelGetMasterAddrByName
in interface SentinelCommands
masterName
- public Long sentinelReset(String pattern)
redis 127.0.0.1:26381> sentinel reset mymaster (integer) 1
sentinelReset
in interface SentinelCommands
pattern
- public List<Map<String,String>> sentinelSlaves(String masterName)
redis 127.0.0.1:26381> sentinel slaves mymaster 1) 1) "name" 2) "127.0.0.1:6380" 3) "ip" 4) "127.0.0.1" 5) "port" 6) "6380" 7) "runid" 8) "d7f6c0ca7572df9d2f33713df0dbf8c72da7c039" 9) "flags" 10) "slave" 11) "pending-commands" 12) "0" 13) "last-ok-ping-reply" 14) "47" 15) "last-ping-reply" 16) "47" 17) "info-refresh" 18) "657" 19) "master-link-down-time" 20) "0" 21) "master-link-status" 22) "ok" 23) "master-host" 24) "localhost" 25) "master-port" 26) "6379" 27) "slave-priority" 28) "100"
sentinelSlaves
in interface SentinelCommands
masterName
- public List<Map<String,String>> sentinelReplicas(String masterName)
sentinelReplicas
in interface SentinelCommands
public String sentinelFailover(String masterName)
sentinelFailover
in interface SentinelCommands
public String sentinelMonitor(String masterName, String ip, int port, int quorum)
sentinelMonitor
in interface SentinelCommands
public String sentinelRemove(String masterName)
sentinelRemove
in interface SentinelCommands
public String sentinelSet(String masterName, Map<String,String> parameterMap)
sentinelSet
in interface SentinelCommands
public void subscribe(JedisPubSub jedisPubSub, String... channels)
public void psubscribe(JedisPubSub jedisPubSub, String... channels)
Copyright © 2021. All rights reserved.