public class RedisOptions extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ENDPOINT
The default redis endpoint =
redis://localhost:6379 |
| Constructor and Description |
|---|
RedisOptions()
Creates a default configuration object using redis server defaults
|
RedisOptions(JsonObject json)
Copy from JSON constructor.
|
RedisOptions(RedisOptions other)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
RedisOptions |
addEndpoint(String endpoint)
Adds a endpoint to use while connecting to the redis server.
|
String |
getEndpoint()
Gets the redis endpoint to use
|
List<String> |
getEndpoints()
Gets the list of redis endpoints to use (mostly used while connecting to a cluster)
|
String |
getMasterName()
Get the master name (only considered in HA mode).
|
int |
getMaxNestedArrays()
Tune how much nested arrays are allowed on a redis response.
|
int |
getMaxPoolSize()
Tune the maximum size of the connection pool.
|
int |
getMaxPoolWaiting()
Tune the maximum waiting requests for a connection from the pool.
|
int |
getMaxWaitingHandlers()
The client will always work on pipeline mode, this means that messages can start queueing.
|
NetClientOptions |
getNetClientOptions()
Get the net client options used to connect to the server.
|
int |
getPoolCleanerInterval()
Tune how often in milliseconds should the connection pool cleaner execute.
|
int |
getPoolRecycleTimeout()
Tune when a connection should be recycled in milliseconds.
|
RedisRole |
getRole()
Get the role name (only considered in HA mode).
|
RedisClientType |
getType()
Get the type of client to be created.
|
RedisSlaves |
getUseSlave()
Get whether or not to use slave nodes (only considered in Cluster mode).
|
RedisOptions |
setEndpoint(String endpoint)
Sets a single endpoint to use while connecting to the redis server.
|
RedisOptions |
setEndpoints(List<String> endpoints)
Set the endpoints to use while connecting to the redis server.
|
RedisOptions |
setMasterName(String masterName)
Set the master name (only considered in HA mode).
|
RedisOptions |
setMaxNestedArrays(int maxNestedArrays)
Tune how much nested arrays are allowed on a redis response.
|
RedisOptions |
setMaxPoolSize(int maxPoolSize)
Tune the maximum size of the connection pool.
|
RedisOptions |
setMaxPoolWaiting(int maxPoolWaiting)
Tune the maximum waiting requests for a connection from the pool.
|
RedisOptions |
setMaxWaitingHandlers(int maxWaitingHandlers)
The client will always work on pipeline mode, this means that messages can start queueing.
|
RedisOptions |
setNetClientOptions(NetClientOptions netClientOptions)
Set the net client options to be used while connecting to the redis server.
|
RedisOptions |
setPoolCleanerInterval(int poolCleanerInterval)
Tune how often in milliseconds should the connection pool cleaner execute.
|
RedisOptions |
setPoolRecycleTimeout(int poolRecycleTimeout)
Tune when a connection should be recycled in milliseconds.
|
RedisOptions |
setRole(RedisRole role)
Set the role name (only considered in HA mode).
|
RedisOptions |
setType(RedisClientType type)
Set the desired client type to be created.
|
RedisOptions |
setUseSlave(RedisSlaves slaves)
Set whether or not to use slave nodes (only considered in Cluster mode).
|
JsonObject |
toJson()
Converts this object to JSON notation.
|
public static final String DEFAULT_ENDPOINT
redis://localhost:6379public RedisOptions()
public RedisOptions(RedisOptions other)
other - the object to clone.public RedisOptions(JsonObject json)
json - source jsonpublic RedisClientType getType()
public RedisOptions setType(RedisClientType type)
type - the client type.public NetClientOptions getNetClientOptions()
public RedisOptions setNetClientOptions(NetClientOptions netClientOptions)
netClientOptions - custom net client options.public List<String> getEndpoints()
public String getEndpoint()
public RedisOptions setEndpoints(List<String> endpoints)
endpoints - list of socket addresses.public RedisOptions addEndpoint(String endpoint)
endpoint - a socket addresses.public RedisOptions setEndpoint(String endpoint)
endpoint - a socket addresses.public int getMaxWaitingHandlers()
public RedisOptions setMaxWaitingHandlers(int maxWaitingHandlers)
maxWaitingHandlers - max allowed queued waiting handlers.public String getMasterName()
public RedisOptions setMasterName(String masterName)
masterName - the master name.public RedisRole getRole()
public RedisOptions setRole(RedisRole role)
role - the master name.public RedisSlaves getUseSlave()
public RedisOptions setUseSlave(RedisSlaves slaves)
slaves - the cluster slave mode.public int getMaxNestedArrays()
public RedisOptions setMaxNestedArrays(int maxNestedArrays)
maxNestedArrays - the configured max nested arrays allowance.public int getPoolCleanerInterval()
public RedisOptions setPoolCleanerInterval(int poolCleanerInterval)
poolCleanerInterval - the interval in milliseconds (-1 for never)public int getMaxPoolSize()
public RedisOptions setMaxPoolSize(int maxPoolSize)
maxPoolSize - the max pool size.public int getMaxPoolWaiting()
public RedisOptions setMaxPoolWaiting(int maxPoolWaiting)
maxPoolWaiting - max waiting requestspublic int getPoolRecycleTimeout()
public RedisOptions setPoolRecycleTimeout(int poolRecycleTimeout)
poolRecycleTimeout - the timeout for recycling.public JsonObject toJson()
Copyright © 2019 Eclipse. All rights reserved.