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
ConstructorDescriptionJedisClusterContainer
(redis.clients.jedis.JedisCluster jedisCluster) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Release Container.redis.clients.jedis.JedisCommands
Borrows instance from container.void
returnInstance
(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:
getInstance
in interfaceJedisCommandsInstanceContainer
- Returns:
- instance which implements JedisCommands
-
returnInstance
public void returnInstance(redis.clients.jedis.JedisCommands jedisCommands) Returns instance to container.- Specified by:
returnInstance
in interfaceJedisCommandsInstanceContainer
- Parameters:
jedisCommands
- borrowed instance
-
close
public void close()Release Container.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceJedisCommandsInstanceContainer
-