public class MasterSlaveServersConfig extends BaseMasterSlaveServersConfig<MasterSlaveServersConfig>
Constructor and Description |
---|
MasterSlaveServersConfig() |
Modifier and Type | Method and Description |
---|---|
MasterSlaveServersConfig |
addSlaveAddress(String... sAddresses)
Add Redis slave server address.
|
MasterSlaveServersConfig |
addSlaveAddress(URI slaveAddress) |
String |
getClientName() |
int |
getConnectTimeout() |
int |
getDatabase() |
int |
getFailedAttempts() |
int |
getIdleConnectionTimeout() |
URI |
getMasterAddress() |
String |
getPassword() |
int |
getPingTimeout() |
int |
getReconnectionTimeout() |
int |
getRefreshConnectionAfterFails()
Deprecated.
|
int |
getRetryAttempts() |
int |
getRetryInterval() |
Set<URI> |
getSlaveAddresses() |
int |
getSubscriptionsPerConnection() |
int |
getTimeout() |
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.
|
T |
setDatabase(int database)
Database index used for Redis connection
Default is
0 |
T |
setFailedAttempts(int slaveFailedAttempts)
Redis 'slave' server will be excluded from the list of available slave nodes
when sequential unsuccessful execution attempts of any Redis command on slave node reaches
slaveFailedAttempts . |
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. |
MasterSlaveServersConfig |
setMasterAddress(String masterAddress)
Set Redis master server address.
|
void |
setMasterAddress(URI masterAddress) |
T |
setPassword(String password)
Password for Redis authentication.
|
T |
setPingTimeout(int pingTimeout)
Ping timeout used in
Node.ping and Node.pingAll |
T |
setReconnectionTimeout(int slaveRetryTimeout)
Redis server reconnection attempt timeout.
|
T |
setRefreshConnectionAfterFails(int failAttemptsAmount)
Deprecated.
|
T |
setRetryAttempts(int retryAttempts)
Error will be thrown if Redis command can't be sended to Redis server after
retryAttempts . |
T |
setRetryInterval(int retryInterval)
Time interval after which another one attempt to send Redis command will be executed.
|
void |
setSlaveAddresses(Set<URI> readAddresses) |
T |
setSubscriptionsPerConnection(int subscriptionsPerConnection)
Subscriptions per Redis connection limit
Default is 5
|
T |
setTimeout(int timeout)
Redis server response timeout.
|
getLoadBalancer, getMasterConnectionMinimumIdleSize, getMasterConnectionPoolSize, getSlaveConnectionMinimumIdleSize, getSlaveConnectionPoolSize, getSlaveSubscriptionConnectionMinimumIdleSize, getSlaveSubscriptionConnectionPoolSize, setLoadBalancer, setMasterConnectionMinimumIdleSize, setMasterConnectionPoolSize, setSlaveConnectionMinimumIdleSize, setSlaveConnectionPoolSize, setSlaveSubscriptionConnectionMinimumIdleSize, setSlaveSubscriptionConnectionPoolSize
public MasterSlaveServersConfig setMasterAddress(String masterAddress)
masterAddress
- public URI getMasterAddress()
public void setMasterAddress(URI masterAddress)
public MasterSlaveServersConfig addSlaveAddress(String... sAddresses)
addresses
- public MasterSlaveServersConfig addSlaveAddress(URI slaveAddress)
public T setSubscriptionsPerConnection(int subscriptionsPerConnection)
subscriptionsPerConnection
- public int getSubscriptionsPerConnection()
public T setPassword(String password)
null
password
- public String getPassword()
public T setRetryAttempts(int retryAttempts)
retryAttempts
.
But if it sent succesfully then timeout
will be started.retryAttempts
- timeout
public int getRetryAttempts()
public T setRetryInterval(int retryInterval)
retryInterval
- - time in millisecondsretryAttempts
public int getRetryInterval()
public T setDatabase(int database)
0
database
- public int getDatabase()
public T setTimeout(int timeout)
timeout
- in millisecondspublic int getTimeout()
public T setClientName(String clientName)
name
- public String getClientName()
public T setPingTimeout(int pingTimeout)
Node.ping
and Node.pingAll operation
ping
- timeout in millisecondspublic int getPingTimeout()
@Deprecated public T setRefreshConnectionAfterFails(int failAttemptsAmount)
failAttemptsAmount
fails in a row during command sending. Turned off by default.failAttemptsAmount
- @Deprecated public int getRefreshConnectionAfterFails()
public T setConnectTimeout(int connectTimeout)
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()
public T setReconnectionTimeout(int slaveRetryTimeout)
failedAttempts
public int getReconnectionTimeout()
public T setFailedAttempts(int slaveFailedAttempts)
slaveFailedAttempts
.
Default is 3public int getFailedAttempts()
Copyright © 2014–2015. All rights reserved.