Package org.springside.modules.nosql.redis

Examples of org.springside.modules.nosql.redis.JedisTemplate$JedisAction


    /**
     * Query master address from sentinel.
     */
    private HostAndPort queryMasterAddress() {
      JedisTemplate sentinelTemplate = new JedisTemplate(sentinelPool);
      List<String> address = sentinelTemplate.execute(new JedisAction<List<String>>() {
        @Override
        public List<String> action(Jedis jedis) {
          return jedis.sentinelGetMasterAddrByName(masterName);
        }
      });
View Full Code Here


  public AdvancedJobConsumer(String jobName, JedisPool jedisPool) {
    readyJobKey = Keys.getReadyJobKey(jobName);
    lockJobKey = Keys.getLockJobKey(jobName);
    keys = Lists.newArrayList(readyJobKey, lockJobKey);

    jedisTemplate = new JedisTemplate(jedisPool);
    singlePopScriptExecutor = new JedisScriptExecutor(jedisPool);
    batchPopScriptExecutor = new JedisScriptExecutor(jedisPool);
  }
View Full Code Here

  private JedisTemplate jedisTemplate;
  private String readyJobKey;
  private int popupTimeoutSecs = DEFAULT_POPUP_TIMEOUT_SECONDS;

  public SimpleJobConsumer(String jobName, JedisPool jedisPool) {
    jedisTemplate = new JedisTemplate(jedisPool);
    readyJobKey = Keys.getReadyJobKey(jobName);
  }
View Full Code Here

    lockJobKey = Keys.getLockJobKey(jobName);

    dispatchCounterKey = Keys.getDispatchCounterKey(jobName);
    retryCounterKey = Keys.getRetryCounterKey(jobName);

    jedisTemplate = new JedisTemplate(jedisPool);
  }
View Full Code Here

  private String scheduledJobKey;

  private String readyJobKey;

  public JobProducer(String jobName, JedisPool jedisPool) {
    jedisTemplate = new JedisTemplate(jedisPool);
    scheduledJobKey = Keys.getScheduledJobKey(jobName);
    readyJobKey = Keys.getReadyJobKey(jobName);
  }
View Full Code Here

  private String hostId;
  private String masterKey = DEFAULT_MASTER_KEY;
  private AtomicBoolean master = new AtomicBoolean(false);

  public MasterElector(JedisPool jedisPool, int intervalSecs) {
    this.jedisTemplate = new JedisTemplate(jedisPool);
    this.intervalSecs = intervalSecs;
    this.expireSecs = intervalSecs + (intervalSecs / 2);
  }
View Full Code Here

  @Override
  protected void setUp() {

    pool = new JedisPoolBuilder().setDirectHostAndPort("localhost", "6379").setPoolSize(threadCount).buildPool();
    jedisTemplate = new JedisTemplate(pool);

    // 重置Counter
    jedisTemplate.set(counterKey, "0");
  }
View Full Code Here

  }

  @Override
  protected void setUp() {
    pool = new JedisPoolBuilder().setDirectHostAndPort("localhost", "6379").setPoolSize(threadCount).buildPool();
    jedisTemplate = new JedisTemplate(pool);

    // 清空数据库
    jedisTemplate.flushDB();
  }
View Full Code Here

TOP

Related Classes of org.springside.modules.nosql.redis.JedisTemplate$JedisAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.