Examples of hget()


Examples of redis.clients.jedis.Jedis.hget()

        ShardedJedis jedis = getResource();
        try {
            Jedis j = jedis.getShard(queueUrl + "-" + shard + "-" + CQSConstants.REDIS_STATE);
            j.watch(queueUrl + "-" + shard + "-" + CQSConstants.REDIS_STATE);
            if (checkOldState) {
                String oldStateStr = j.hget(queueUrl + "-" + shard + "-" + CQSConstants.REDIS_STATE, CQSConstants.REDIS_STATE);
                if (oldState == null && oldStateStr != null) {
                    throw new SetFailedException();
                }
                if (oldState != null) {
                    if (oldStateStr == null || QCacheState.valueOf(oldStateStr) != oldState) {
View Full Code Here

Examples of redis.clients.jedis.Jedis.hget()

     ShardedJedis jedis = getResource();
     try {
       Jedis j = jedis.getShard(queueUrl + "-" + shard + "-" + CQSConstants.REDIS_STATE);
       j.watch(queueUrl + "-" + shard + "-" + CQSConstants.REDIS_STATE);
       if (checkOldState) {
         String oldStateStr = j.hget(queueUrl + "-" + shard + "-" + CQSConstants.REDIS_STATE, CQSConstants.REDIS_STATE);
         if (oldState == null && oldStateStr != null) {
           throw new SetFailedException();
         }
         if (oldState != null) {
           if (oldStateStr == null || QCacheState.valueOf(oldStateStr) != oldState) {
View Full Code Here

Examples of redis.clients.jedis.Pipeline.hget()

  jedis.setrange("setrangebytes".getBytes(), 0, bytesForSetRange);

  Pipeline p = jedis.pipelined();
  Response<String> string = p.get("string");
  Response<String> list = p.lpop("list");
  Response<String> hash = p.hget("hash", "foo");
  Response<Set<String>> zset = p.zrange("zset", 0, -1);
  Response<String> set = p.spop("set");
  Response<Boolean> blist = p.exists("list");
  Response<Double> zincrby = p.zincrby("zset", 1, "foo");
  Response<Long> zcard = p.zcard("zset");
View Full Code Here

Examples of redis.clients.jedis.ShardedJedis.hget()

      long ts1 = System.currentTimeMillis();
        ShardedJedis jedis = getResource();
        boolean brokenJedis = false;
       
        try {
            String st = jedis.hget(queueUrl + "-" + shard + "-" + CQSConstants.REDIS_STATE, CQSConstants.REDIS_STATE);
            if (st == null) {
              return null;
            }
            return QCacheState.valueOf(st);
        } catch (JedisException e) {
View Full Code Here

Examples of redis.clients.jedis.ShardedJedis.hget()

                long ts2 = System.currentTimeMillis();
                CQSControllerServlet.valueAccumulator.addToCounter(AccumulatorName.RedisTime, (ts2 - ts1));
                log.debug("event=revisibility_check queue_url=" + queueUrl + " shard=" + shard + " invisible_set_size=" + keys.size());
                for (String key : keys) {
                    long ts3 = System.currentTimeMillis();
                    String val = jedis.hget(queueUrl + "-" + shard + "-H", key);
                    long ts4 = System.currentTimeMillis();
                    CQSControllerServlet.valueAccumulator.addToCounter(AccumulatorName.RedisTime, (ts4 - ts3));
                    if (val == null) {
                      continue;                   
                    }
View Full Code Here

Examples of redis.clients.jedis.ShardedJedis.hget()

     long ts1 = System.currentTimeMillis();
     ShardedJedis jedis = getResource();
     boolean brokenJedis = false;

     try {
       String st = jedis.hget(queueUrl + "-" + shard + "-" + CQSConstants.REDIS_STATE, CQSConstants.REDIS_STATE);
       if (st == null) {
         return null;
       }
       return QCacheState.valueOf(st);
     } catch (JedisException e) {
View Full Code Here

Examples of redis.clients.jedis.ShardedJedis.hget()

      super.setLockFactory(lockFactory);
  }
 
  private void open() {
    ShardedJedis rds = redisPool.getResource();
    byte[] size = rds.hget(getDirNameBytes(), ":size".getBytes());
    directorySize = 0;
    try {
      directorySize = ByteBuffer.wrap(size).asLongBuffer().get();
    }catch(Exception e){
      reloadSizeFromFiles();
View Full Code Here

Examples of redis.clients.jedis.ShardedJedis.hget()

    readBuffer();
  }
 
  public synchronized long size() {
    ShardedJedis jd = redisPool.getResource();
    byte [] p = jd.hget(directory.getDirNameBytes(), getNameBytes());
    if( p != null && p.length == Long.SIZE/8 ){
      this.fileLength = ByteBuffer.wrap(p).asLongBuffer().get();
    }
    redisPool.returnResource(jd);
    return this.fileLength;
View Full Code Here

Examples of redis.clients.jedis.ShardedJedisPipeline.hget()

  ShardedJedisPipeline p = jedis.pipelined();
  Response<String> string = p.get("string");
  Response<Long> del = p.del("string");
  Response<String> emptyString = p.get("string");
  Response<String> list = p.lpop("list");
  Response<String> hash = p.hget("hash", "foo");
  Response<Set<String>> zset = p.zrange("zset", 0, -1);
  Response<String> set = p.spop("set");
  Response<Boolean> blist = p.exists("list");
  Response<Double> zincrby = p.zincrby("zset", 1, "foo");
  Response<Long> zcard = p.zcard("zset");
View Full Code Here

Examples of redis.clients.jedis.Transaction.hget()

  jedis.sadd("set", "foo");

  Transaction t = jedis.multi();
  Response<String> string = t.get("string");
  Response<String> list = t.lpop("list");
  Response<String> hash = t.hget("hash", "foo");
  Response<Set<String>> zset = t.zrange("zset", 0, -1);
  Response<String> set = t.spop("set");
  t.exec();

  assertEquals("foo", string.get());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.