Class JedisClusterContainer
java.lang.Object
org.apache.storm.redis.common.container.JedisClusterContainer
- All Implemented Interfaces:
Closeable,AutoCloseable,JedisCommandsInstanceContainer
Container for managing JedisCluster.
Note that JedisCluster doesn't need to be pooled since it's thread-safe and it stores pools internally.
-
Constructor Summary
ConstructorsConstructorDescriptionJedisClusterContainer(redis.clients.jedis.JedisCluster jedisCluster) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Release Container.redis.clients.jedis.JedisCommandsBorrows instance from container.voidreturnInstance(redis.clients.jedis.JedisCommands jedisCommands) Returns instance to container.
-
Constructor Details
-
JedisClusterContainer
public JedisClusterContainer(redis.clients.jedis.JedisCluster jedisCluster) Constructor.- Parameters:
jedisCluster- JedisCluster instance
-
-
Method Details
-
getInstance
public redis.clients.jedis.JedisCommands getInstance()Borrows instance from container.- Specified by:
getInstancein interfaceJedisCommandsInstanceContainer- Returns:
- instance which implements JedisCommands
-
returnInstance
public void returnInstance(redis.clients.jedis.JedisCommands jedisCommands) Returns instance to container.- Specified by:
returnInstancein interfaceJedisCommandsInstanceContainer- Parameters:
jedisCommands- borrowed instance
-
close
public void close()Release Container.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceJedisCommandsInstanceContainer
-