Class RedisState
java.lang.Object
org.apache.storm.redis.trident.state.RedisState
- All Implemented Interfaces:
State
Implementation of State for single Redis environment.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
RedisState.Factory implements StateFactory for single Redis environment. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
beginCommit
(Long someLong) void
redis.clients.jedis.Jedis
getJedis()
Borrows Jedis instance from pool.void
returnJedis
(redis.clients.jedis.Jedis jedis) Returns Jedis instance to pool.
-
Constructor Details
-
RedisState
public RedisState(redis.clients.jedis.JedisPool jedisPool) Constructor.- Parameters:
jedisPool
- JedisPool
-
-
Method Details
-
beginCommit
- Specified by:
beginCommit
in interfaceState
-
commit
-
getJedis
public redis.clients.jedis.Jedis getJedis()Borrows Jedis instance from pool. Note that you should return borrowed instance to pool when you finish using instance.- Returns:
- Jedis instance
-
returnJedis
public void returnJedis(redis.clients.jedis.Jedis jedis) Returns Jedis instance to pool.- Parameters:
jedis
- Jedis instance to return to pool
-