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 |
getDatabase() |
URI |
getMasterAddress() |
String |
getPassword() |
int |
getPingTimeout() |
int |
getRefreshConnectionAfterFails() |
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 |
setDatabase(int database)
Database index used for Redis connection
Default is
0 |
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 |
setRefreshConnectionAfterFails(int failAttemptsAmount)
Reconnect connection if it has
failAttemptsAmount
fails in a row during command sending. |
T |
setRetryAttempts(int retryAttempts)
Reconnection attempts amount.
|
T |
setRetryInterval(int retryInterval)
Time pause before next reconnection attempt.
|
void |
setSlaveAddresses(Set<URI> readAddresses) |
T |
setSubscriptionsPerConnection(int subscriptionsPerConnection)
Subscriptions per Redis connection limit
Default is 5
|
T |
setTimeout(int timeout)
Redis operation execution timeout.
|
getLoadBalancer, getMasterConnectionPoolSize, getSlaveConnectionPoolSize, getSlaveFailedAttempts, getSlaveReconnectionTimeout, getSlaveSubscriptionConnectionPoolSize, setLoadBalancer, setMasterConnectionPoolSize, setSlaveConnectionPoolSize, setSlaveFailedAttempts, setSlaveReconnectionTimeout, 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)
Future
callback fails in case of async operation.
Used then connection with redis server is down.retryAttempts
- public int getRetryAttempts()
public T setRetryInterval(int retryInterval)
retryInterval
- - time in millisecondspublic int getRetryInterval()
public T setDatabase(int database)
0
database
- public int getDatabase()
public T setTimeout(int timeout)
Future
callback fails in case of async operation.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()
public T setRefreshConnectionAfterFails(int failAttemptsAmount)
failAttemptsAmount
fails in a row during command sending. Turned off by default.failAttemptsAmount
- public int getRefreshConnectionAfterFails()
Copyright © 2014–2015. All rights reserved.