Class RedisClusterContainer
java.lang.Object
org.apache.storm.redis.common.container.RedisClusterContainer
- All Implemented Interfaces:
Closeable
,AutoCloseable
,RedisCommandsInstanceContainer
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
ConstructorDescriptionRedisClusterContainer
(redis.clients.jedis.JedisCluster jedisCluster) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Borrows instance from container.void
returnInstance
(RedisCommands redisCommands) Returns instance to container.
-
Constructor Details
-
RedisClusterContainer
public RedisClusterContainer(redis.clients.jedis.JedisCluster jedisCluster) Constructor.- Parameters:
jedisCluster
- JedisCluster instance
-
-
Method Details
-
getInstance
Borrows instance from container.- Specified by:
getInstance
in interfaceRedisCommandsInstanceContainer
- Returns:
- instance which implements RedisCommands
-
returnInstance
Returns instance to container.- Specified by:
returnInstance
in interfaceRedisCommandsInstanceContainer
- Parameters:
redisCommands
- borrowed instance
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-