Class RedisState

java.lang.Object
org.apache.storm.redis.trident.state.RedisState
All Implemented Interfaces:
State

public class RedisState extends Object implements State
Implementation of State for single Redis environment.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    RedisState.Factory implements StateFactory for single Redis environment.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RedisState(redis.clients.jedis.JedisPool jedisPool)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    beginCommit(Long someLong)
    void
    commit(Long someLong)
    redis.clients.jedis.Jedis
    Borrows Jedis instance from pool.
    void
    returnJedis(redis.clients.jedis.Jedis jedis)
    Returns Jedis instance to pool.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RedisState

      public RedisState(redis.clients.jedis.JedisPool jedisPool)
      Constructor.
      Parameters:
      jedisPool - JedisPool
  • Method Details

    • beginCommit

      public void beginCommit(Long someLong)
      Specified by:
      beginCommit in interface State
    • commit

      public void commit(Long someLong)
      Specified by:
      commit in interface State
    • 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