public class MasterSlaveServersConfig extends BaseMasterSlaveServersConfig<MasterSlaveServersConfig>
Constructor and Description |
---|
MasterSlaveServersConfig() |
Modifier and Type | Method and Description |
---|---|
MasterSlaveServersConfig |
addSlaveAddress(String... addresses)
Add Redis slave server address.
|
MasterSlaveServersConfig |
addSlaveAddress(URI slaveAddress) |
String |
getClientName() |
int |
getConnectTimeout() |
int |
getDatabase() |
int |
getIdleConnectionTimeout() |
URI |
getMasterAddress() |
String |
getPassword() |
int |
getPingConnectionInterval() |
int |
getPingTimeout() |
int |
getRetryAttempts() |
int |
getRetryInterval() |
Set<URI> |
getSlaveAddresses() |
URI |
getSslKeystore() |
String |
getSslKeystorePassword() |
SslProvider |
getSslProvider() |
URI |
getSslTruststore() |
String |
getSslTruststorePassword() |
int |
getSubscriptionsPerConnection() |
int |
getTimeout() |
boolean |
isKeepAlive() |
boolean |
isSslEnableEndpointIdentification() |
boolean |
isTcpNoDelay() |
T |
setClientName(String clientName)
Setup connection name during connection init
via CLIENT SETNAME command
|
T |
setConnectTimeout(int connectTimeout)
Timeout during connecting to any Redis server.
|
MasterSlaveServersConfig |
setDatabase(int database)
Database index used for Redis connection
Default is
0 |
T |
setFailedAttempts(int slaveFailedAttempts)
Deprecated.
|
T |
setIdleConnectionTimeout(int idleConnectionTimeout)
If pooled connection not used for a
timeout time
and current connections amount bigger than minimum idle connections pool size,
then it will closed and removed from pool. |
T |
setKeepAlive(boolean keepAlive)
Enables TCP keepAlive for connection
Default is
false |
MasterSlaveServersConfig |
setMasterAddress(String masterAddress)
Set Redis master server address.
|
MasterSlaveServersConfig |
setMasterAddress(URI masterAddress) |
T |
setPassword(String password)
Password for Redis authentication.
|
T |
setPingConnectionInterval(int pingConnectionInterval)
Defines PING command sending interval per connection to Redis.
|
T |
setPingTimeout(int pingTimeout)
Ping timeout used in
Node.ping and Node.pingAll operation |
T |
setReconnectionTimeout(int slaveRetryTimeout)
Deprecated.
|
T |
setRetryAttempts(int retryAttempts)
Error will be thrown if Redis command can't be sent to Redis server after
retryAttempts . |
T |
setRetryInterval(int retryInterval)
Defines time interval for another one attempt send Redis command
if it hasn't been sent already.
|
void |
setSlaveAddresses(Set<URI> readAddresses) |
T |
setSslEnableEndpointIdentification(boolean sslEnableEndpointIdentification)
Enables SSL endpoint identification.
|
T |
setSslKeystore(URI sslKeystore)
Defines path to SSL keystore
|
T |
setSslKeystorePassword(String sslKeystorePassword)
Defines password for SSL keystore
|
T |
setSslProvider(SslProvider sslProvider)
Defines SSL provider used to handle SSL connections.
|
T |
setSslTruststore(URI sslTruststore)
Defines path to SSL truststore
|
T |
setSslTruststorePassword(String sslTruststorePassword)
Defines password for SSL truststore
|
T |
setSubscriptionsPerConnection(int subscriptionsPerConnection)
Subscriptions per Redis connection limit
Default is 5
|
T |
setTcpNoDelay(boolean tcpNoDelay)
Enables TCP noDelay for connection
Default is
false |
T |
setTimeout(int timeout)
Redis server response timeout.
|
checkSkipSlavesInit, getDnsMonitoringInterval, getFailedSlaveCheckInterval, getFailedSlaveReconnectionInterval, getLoadBalancer, getMasterConnectionMinimumIdleSize, getMasterConnectionPoolSize, getReadMode, getSlaveConnectionMinimumIdleSize, getSlaveConnectionPoolSize, getSlaveSubscriptionConnectionMinimumIdleSize, getSlaveSubscriptionConnectionPoolSize, getSubscriptionConnectionMinimumIdleSize, getSubscriptionConnectionPoolSize, getSubscriptionMode, setDnsMonitoringInterval, setFailedSlaveCheckInterval, setFailedSlaveReconnectionInterval, setLoadBalancer, setMasterConnectionMinimumIdleSize, setMasterConnectionPoolSize, setReadMode, setSlaveConnectionMinimumIdleSize, setSlaveConnectionPoolSize, setSlaveSubscriptionConnectionMinimumIdleSize, setSlaveSubscriptionConnectionPoolSize, setSubscriptionConnectionMinimumIdleSize, setSubscriptionConnectionPoolSize, setSubscriptionMode
public MasterSlaveServersConfig setMasterAddress(String masterAddress)
masterAddress
- of Redispublic URI getMasterAddress()
public MasterSlaveServersConfig setMasterAddress(URI masterAddress)
public MasterSlaveServersConfig addSlaveAddress(String... addresses)
addresses
- of Redispublic MasterSlaveServersConfig addSlaveAddress(URI slaveAddress)
public MasterSlaveServersConfig setDatabase(int database)
0
database
- numberpublic int getDatabase()
public T setSubscriptionsPerConnection(int subscriptionsPerConnection)
subscriptionsPerConnection
- amountpublic int getSubscriptionsPerConnection()
public T setPassword(String password)
null
password
- for connectionpublic String getPassword()
public T setRetryAttempts(int retryAttempts)
retryAttempts
.
But if it sent successfully then timeout
will be started.
Default is 3
attempts
retryAttempts
- - retry attemptstimeout
public int getRetryAttempts()
public T setRetryInterval(int retryInterval)
Default is 1500
milliseconds
retryInterval
- - time in millisecondsretryAttempts
public int getRetryInterval()
public T setTimeout(int timeout)
Default is 3000
milliseconds
timeout
- in millisecondspublic int getTimeout()
public T setClientName(String clientName)
clientName
- - name of clientpublic String getClientName()
public T setPingTimeout(int pingTimeout)
Node.ping
and Node.pingAll
operationpingTimeout
- - timeout in millisecondspublic int getPingTimeout()
public T setConnectTimeout(int connectTimeout)
Default is 10000
milliseconds.
connectTimeout
- - timeout in millisecondspublic int getConnectTimeout()
public T setIdleConnectionTimeout(int idleConnectionTimeout)
timeout
time
and current connections amount bigger than minimum idle connections pool size,
then it will closed and removed from pool.idleConnectionTimeout
- - timeout in millisecondspublic int getIdleConnectionTimeout()
@Deprecated public T setReconnectionTimeout(int slaveRetryTimeout)
@Deprecated public T setFailedAttempts(int slaveFailedAttempts)
public boolean isSslEnableEndpointIdentification()
public T setSslEnableEndpointIdentification(boolean sslEnableEndpointIdentification)
Default is true
sslEnableEndpointIdentification
- - boolean valuepublic SslProvider getSslProvider()
public T setSslProvider(SslProvider sslProvider)
Default is JDK
sslProvider
- - ssl providerpublic URI getSslTruststore()
public T setSslTruststore(URI sslTruststore)
sslTruststore
- - pathpublic String getSslTruststorePassword()
public T setSslTruststorePassword(String sslTruststorePassword)
sslTruststorePassword
- - passwordpublic URI getSslKeystore()
public T setSslKeystore(URI sslKeystore)
sslKeystore
- - path to keystorepublic String getSslKeystorePassword()
public T setSslKeystorePassword(String sslKeystorePassword)
sslKeystorePassword
- - passwordpublic int getPingConnectionInterval()
public T setPingConnectionInterval(int pingConnectionInterval)
0
means disable.
Default is 0
pingConnectionInterval
- - time in millisecondspublic boolean isKeepAlive()
public T setKeepAlive(boolean keepAlive)
Default is false
keepAlive
- - boolean valuepublic boolean isTcpNoDelay()
public T setTcpNoDelay(boolean tcpNoDelay)
Default is false
tcpNoDelay
- - boolean valueCopyright © 2014–2018 The Redisson Project. All rights reserved.