LettucePoolingClientConfiguration
.@Deprecated public class DefaultLettucePool extends Object implements LettucePool, InitializingBean
LettucePool
.Constructor and Description |
---|
DefaultLettucePool()
Deprecated.
Constructs a new
DefaultLettucePool instance with default settings. |
DefaultLettucePool(RedisSentinelConfiguration sentinelConfiguration)
Deprecated.
Uses the
RedisSentinelConfiguration and RedisClient defaults for configuring the connection pool
based on sentinels. |
DefaultLettucePool(String hostName,
int port)
Deprecated.
Uses the
GenericObjectPoolConfig defaults for configuring the connection pool |
DefaultLettucePool(String hostName,
int port,
org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig)
Deprecated.
Uses the
RedisClient defaults for configuring the connection pool |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Deprecated.
|
void |
destroy()
Deprecated.
Destroys the pool
|
io.lettuce.core.RedisClient |
getClient()
Deprecated.
|
io.lettuce.core.resource.ClientResources |
getClientResources()
Deprecated.
Get the
ClientResources to reuse infrastructure. |
int |
getDatabase()
Deprecated.
Returns the index of the database.
|
String |
getHostName()
Deprecated.
Returns the current host.
|
String |
getPassword()
Deprecated.
Returns the password used for authenticating with the Redis server.
|
org.apache.commons.pool2.impl.GenericObjectPoolConfig |
getPoolConfig()
Deprecated.
|
int |
getPort()
Deprecated.
Returns the current port.
|
io.lettuce.core.api.StatefulConnection<byte[],byte[]> |
getResource()
Deprecated.
|
long |
getTimeout()
Deprecated.
Returns the connection timeout (in milliseconds).
|
boolean |
isRedisSentinelAware()
Deprecated.
|
void |
returnBrokenResource(io.lettuce.core.api.StatefulConnection<byte[],byte[]> resource)
Deprecated.
|
void |
returnResource(io.lettuce.core.api.StatefulConnection<byte[],byte[]> resource)
Deprecated.
|
void |
setClientResources(io.lettuce.core.resource.ClientResources clientResources)
Deprecated.
Sets the
ClientResources to reuse the client infrastructure. |
void |
setDatabase(int index)
Deprecated.
Sets the index of the database used by this connection pool.
|
void |
setHostName(String host)
Deprecated.
Sets the host.
|
void |
setPassword(String password)
Deprecated.
Sets the password used for authenticating with the Redis server.
|
void |
setPoolConfig(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig)
Deprecated.
|
void |
setPort(int port)
Deprecated.
Sets the port.
|
void |
setTimeout(long timeout)
Deprecated.
Sets the connection timeout (in milliseconds).
|
public DefaultLettucePool()
DefaultLettucePool
instance with default settings.public DefaultLettucePool(String hostName, int port)
GenericObjectPoolConfig
defaults for configuring the connection poolhostName
- The Redis hostport
- The Redis portpublic DefaultLettucePool(RedisSentinelConfiguration sentinelConfiguration)
RedisSentinelConfiguration
and RedisClient
defaults for configuring the connection pool
based on sentinels.sentinelConfiguration
- The Sentinel configurationpublic DefaultLettucePool(String hostName, int port, org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig)
RedisClient
defaults for configuring the connection poolhostName
- The Redis hostport
- The Redis portpoolConfig
- The pool GenericObjectPoolConfig
public boolean isRedisSentinelAware()
RedisSentinelConfiguration
is present.public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
public io.lettuce.core.api.StatefulConnection<byte[],byte[]> getResource()
getResource
in interface Pool<io.lettuce.core.api.StatefulConnection<byte[],byte[]>>
public void returnBrokenResource(io.lettuce.core.api.StatefulConnection<byte[],byte[]> resource)
returnBrokenResource
in interface Pool<io.lettuce.core.api.StatefulConnection<byte[],byte[]>>
resource
- A broken resource that should be invalidatedpublic void returnResource(io.lettuce.core.api.StatefulConnection<byte[],byte[]> resource)
returnResource
in interface Pool<io.lettuce.core.api.StatefulConnection<byte[],byte[]>>
resource
- A resource to return to the poolpublic void destroy()
Pool
@Nullable public io.lettuce.core.RedisClient getClient()
getClient
in interface LettucePool
public org.apache.commons.pool2.impl.GenericObjectPoolConfig getPoolConfig()
public void setPoolConfig(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig)
poolConfig
- The pool configuration to usepublic int getDatabase()
public void setDatabase(int index)
index
- database index@Nullable public String getPassword()
public void setPassword(String password)
password
- the password to setpublic String getHostName()
public void setHostName(String host)
host
- the host to setpublic int getPort()
public void setPort(int port)
port
- the port to setpublic long getTimeout()
public void setTimeout(long timeout)
timeout
- connection timeout@Nullable public io.lettuce.core.resource.ClientResources getClientResources()
ClientResources
to reuse infrastructure.public void setClientResources(io.lettuce.core.resource.ClientResources clientResources)
ClientResources
to reuse the client infrastructure. clientResources
- can be null.Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.