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 newDefaultLettucePoolinstance with default settings.DefaultLettucePool(String hostName, int port) Deprecated.Uses theGenericObjectPoolConfigdefaults for configuring the connection poolDefaultLettucePool(String hostName, int port, org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig) Deprecated.Uses theRedisClientdefaults for configuring the connection poolDefaultLettucePool(RedisSentinelConfiguration sentinelConfiguration) Deprecated.Uses theRedisSentinelConfigurationandRedisClientdefaults for configuring the connection pool based on sentinels. -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.voiddestroy()Deprecated.Destroys the poolio.lettuce.core.RedisClientDeprecated.io.lettuce.core.resource.ClientResourcesDeprecated.Get theClientResourcesto reuse infrastructure.intDeprecated.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.GenericObjectPoolConfigDeprecated.intgetPort()Deprecated.Returns the current port.io.lettuce.core.api.StatefulConnection<byte[],byte[]> Deprecated.longDeprecated.Returns the connection timeout (in milliseconds).booleanDeprecated.voidreturnBrokenResource(io.lettuce.core.api.StatefulConnection<byte[], byte[]> resource) Deprecated.voidreturnResource(io.lettuce.core.api.StatefulConnection<byte[], byte[]> resource) Deprecated.voidsetClientResources(io.lettuce.core.resource.ClientResources clientResources) Deprecated.Sets theClientResourcesto reuse the client infrastructure.voidsetDatabase(int index) Deprecated.Sets the index of the database used by this connection pool.voidsetHostName(String host) Deprecated.Sets the host.voidsetPassword(String password) Deprecated.Sets the password used for authenticating with the Redis server.voidsetPoolConfig(org.apache.commons.pool2.impl.GenericObjectPoolConfig poolConfig) Deprecated.voidsetPort(int port) Deprecated.Sets the port.voidsetTimeout(long timeout) Deprecated.Sets the connection timeout (in milliseconds).
-
Constructor Details
-
DefaultLettucePool
public DefaultLettucePool()Deprecated.Constructs a newDefaultLettucePoolinstance with default settings. -
DefaultLettucePool
Deprecated.Uses theGenericObjectPoolConfigdefaults for configuring the connection pool- Parameters:
hostName- The Redis hostport- The Redis port
-
DefaultLettucePool
Deprecated.Uses theRedisSentinelConfigurationandRedisClientdefaults 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 theRedisClientdefaults 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
RedisSentinelConfigurationis present. - Since:
- 1.6
-
afterPropertiesSet
public void afterPropertiesSet()Deprecated.- Specified by:
afterPropertiesSetin interfaceInitializingBean
-
getResource
public io.lettuce.core.api.StatefulConnection<byte[],byte[]> getResource()Deprecated.- Specified by:
getResourcein 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:
returnBrokenResourcein 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:
returnResourcein 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:PoolDestroys the pool -
getClient
Deprecated.- Specified by:
getClientin 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 theClientResourcesto reuse infrastructure.- Returns:
- null if not set.
- Since:
- 1.7
-
setClientResources
public void setClientResources(io.lettuce.core.resource.ClientResources clientResources) Deprecated.Sets theClientResourcesto reuse the client infrastructure.
Set to null to not share resources.- Parameters:
clientResources- can be null.- Since:
- 1.7
-
LettucePoolingClientConfiguration.