Class DefaultLettucePool
java.lang.Object
org.springframework.data.redis.connection.lettuce.DefaultLettucePool
- All Implemented Interfaces:
InitializingBean
,LettucePool
,Pool<io.lettuce.core.api.StatefulConnection<byte[],
byte[]>>
Deprecated.
Default implementation of
LettucePool
.- Author:
- Jennifer Hickey, Christoph Strobl, Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Constructs a newDefaultLettucePool
instance with default settings.DefaultLettucePool
(String hostName, int port) Deprecated.Uses theGenericObjectPoolConfig
defaults for configuring the connection poolDefaultLettucePool
(String hostName, int port, org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig) Deprecated.Uses theRedisClient
defaults for configuring the connection poolDefaultLettucePool
(RedisSentinelConfiguration sentinelConfiguration) Deprecated.Uses theRedisSentinelConfiguration
andRedisClient
defaults for configuring the connection pool based on sentinels. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deprecated.void
destroy()
Deprecated.Destroys the poolio.lettuce.core.RedisClient
Deprecated.io.lettuce.core.resource.ClientResources
Deprecated.Get theClientResources
to reuse infrastructure.int
Deprecated.Returns the index of the database.Deprecated.Returns the current host.Deprecated.Returns the password used for authenticating with the Redis server.org.apache.commons.pool2.impl.GenericObjectPoolConfig
Deprecated.int
getPort()
Deprecated.Returns the current port.io.lettuce.core.api.StatefulConnection<byte[],
byte[]> Deprecated.long
Deprecated.Returns the connection timeout (in milliseconds).boolean
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 theClientResources
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).
-
Constructor Details
-
DefaultLettucePool
public DefaultLettucePool()Deprecated.Constructs a newDefaultLettucePool
instance with default settings. -
DefaultLettucePool
Deprecated.Uses theGenericObjectPoolConfig
defaults for configuring the connection pool- Parameters:
hostName
- The Redis hostport
- The Redis port
-
DefaultLettucePool
Deprecated.Uses theRedisSentinelConfiguration
andRedisClient
defaults for configuring the connection pool based on sentinels.- Parameters:
sentinelConfiguration
- The Sentinel configuration- Since:
- 1.6
-
DefaultLettucePool
public DefaultLettucePool(String hostName, int port, org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig) Deprecated.Uses theRedisClient
defaults for configuring the connection pool- Parameters:
hostName
- The Redis hostport
- The Redis portpoolConfig
- The poolGenericObjectPoolConfig
-
-
Method Details
-
isRedisSentinelAware
public boolean isRedisSentinelAware()Deprecated.- Returns:
- true when
RedisSentinelConfiguration
is present. - Since:
- 1.6
-
afterPropertiesSet
public void afterPropertiesSet()Deprecated.- Specified by:
afterPropertiesSet
in interfaceInitializingBean
-
getResource
public io.lettuce.core.api.StatefulConnection<byte[],byte[]> getResource()Deprecated.- Specified by:
getResource
in interfacePool<io.lettuce.core.api.StatefulConnection<byte[],
byte[]>> - Returns:
- A resource, if available
-
returnBrokenResource
public void returnBrokenResource(io.lettuce.core.api.StatefulConnection<byte[], byte[]> resource) Deprecated.- Specified by:
returnBrokenResource
in interfacePool<io.lettuce.core.api.StatefulConnection<byte[],
byte[]>> - Parameters:
resource
- A broken resource that should be invalidated
-
returnResource
public void returnResource(io.lettuce.core.api.StatefulConnection<byte[], byte[]> resource) Deprecated.- Specified by:
returnResource
in interfacePool<io.lettuce.core.api.StatefulConnection<byte[],
byte[]>> - Parameters:
resource
- A resource to return to the pool
-
destroy
public void destroy()Deprecated.Description copied from interface:Pool
Destroys the pool -
getClient
Deprecated.- Specified by:
getClient
in interfaceLettucePool
- Returns:
- The Redis client
-
getPoolConfig
public org.apache.commons.pool2.impl.GenericObjectPoolConfig getPoolConfig()Deprecated.- Returns:
- The pool configuration
-
setPoolConfig
public void setPoolConfig(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig) Deprecated.- Parameters:
poolConfig
- The pool configuration to use
-
getDatabase
public int getDatabase()Deprecated.Returns the index of the database.- Returns:
- Returns the database index
-
setDatabase
public void setDatabase(int index) Deprecated.Sets the index of the database used by this connection pool. Default is 0.- Parameters:
index
- database index
-
getPassword
Deprecated.Returns the password used for authenticating with the Redis server.- Returns:
- password for authentication
-
setPassword
Deprecated.Sets the password used for authenticating with the Redis server.- Parameters:
password
- the password to set
-
getHostName
Deprecated.Returns the current host.- Returns:
- the host
-
setHostName
Deprecated.Sets the host.- Parameters:
host
- the host to set
-
getPort
public int getPort()Deprecated.Returns the current port.- Returns:
- the port
-
setPort
public void setPort(int port) Deprecated.Sets the port.- Parameters:
port
- the port to set
-
getTimeout
public long getTimeout()Deprecated.Returns the connection timeout (in milliseconds).- Returns:
- connection timeout
-
setTimeout
public void setTimeout(long timeout) Deprecated.Sets the connection timeout (in milliseconds).- Parameters:
timeout
- connection timeout
-
getClientResources
Deprecated.Get theClientResources
to reuse infrastructure.- Returns:
- null if not set.
- Since:
- 1.7
-
setClientResources
public void setClientResources(io.lettuce.core.resource.ClientResources clientResources) Deprecated.Sets theClientResources
to reuse the client infrastructure.
Set to null to not share resources.- Parameters:
clientResources
- can be null.- Since:
- 1.7
-
LettucePoolingClientConfiguration
.