public class ReplicatedServersConfig extends BaseMasterSlaveServersConfig<ReplicatedServersConfig>
Constructor and Description |
---|
ReplicatedServersConfig() |
Modifier and Type | Method and Description |
---|---|
ReplicatedServersConfig |
addNodeAddress(String... addresses)
Add Redis cluster node address.
|
String |
getClientName() |
int |
getConnectTimeout() |
int |
getDatabase() |
int |
getFailedAttempts() |
int |
getIdleConnectionTimeout() |
List<URL> |
getNodeAddresses() |
String |
getPassword() |
int |
getPingTimeout() |
int |
getReconnectionTimeout() |
int |
getRetryAttempts() |
int |
getRetryInterval() |
int |
getScanInterval() |
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.
|
ReplicatedServersConfig |
setDatabase(int database)
Database index used for Redis connection
Default is
0 |
T |
setFailedAttempts(int slaveFailedAttempts)
Redis server will be excluded from the internal list of available nodes
when sequential unsuccessful execution attempts of any Redis command
on this server reaches
failedAttempts . |
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 |
setPassword(String password)
Password for Redis authentication.
|
T |
setPingTimeout(int pingTimeout)
Ping timeout used in
Node.ping and Node.pingAll operation |
T |
setReconnectionTimeout(int slaveRetryTimeout)
Reconnection attempt timeout to Redis server when
it has been excluded from internal list of available servers.
|
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.
|
ReplicatedServersConfig |
setScanInterval(int scanInterval)
Elasticache node scan interval in milliseconds
|
T |
setSubscriptionsPerConnection(int subscriptionsPerConnection)
Subscriptions per Redis connection limit
Default is 5
|
T |
setTimeout(int timeout)
Redis server response timeout.
|
getLoadBalancer, getMasterConnectionMinimumIdleSize, getMasterConnectionPoolSize, getReadMode, getSlaveConnectionMinimumIdleSize, getSlaveConnectionPoolSize, getSlaveSubscriptionConnectionMinimumIdleSize, getSlaveSubscriptionConnectionPoolSize, getSubscriptionConnectionMinimumIdleSize, getSubscriptionConnectionPoolSize, getSubscriptionMode, setLoadBalancer, setMasterConnectionMinimumIdleSize, setMasterConnectionPoolSize, setReadMode, setSlaveConnectionMinimumIdleSize, setSlaveConnectionPoolSize, setSlaveSubscriptionConnectionMinimumIdleSize, setSlaveSubscriptionConnectionPoolSize, setSubscriptionConnectionMinimumIdleSize, setSubscriptionConnectionPoolSize, setSubscriptionMode
public ReplicatedServersConfig addNodeAddress(String... addresses)
host:port
addresses
- in host:port
formatpublic int getScanInterval()
public ReplicatedServersConfig setScanInterval(int scanInterval)
scanInterval
- in millisecondspublic ReplicatedServersConfig 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 succesfully 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()
public T setReconnectionTimeout(int slaveRetryTimeout)
On every such timeout event Redisson tries to connect to disconnected Redis server.
Default is 3000
slaveRetryTimeout
- - retry timeout in millisecondsfailedAttempts
public int getReconnectionTimeout()
public T setFailedAttempts(int slaveFailedAttempts)
failedAttempts
.
Default is 3
slaveFailedAttempts
- - attemptspublic int getFailedAttempts()
Copyright © 2014–2017 The Redisson Project. All rights reserved.