Examples of zrangeByScore()


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

          min = localDateToDouble(start);
        }
        if (end != null) {
          max = localDateToDouble(end);
        }
        Set<String> dateTexts = jedis.zrangeByScore(redisHtsDaysKey, min, max);
        if (!dateTexts.isEmpty()) {
          String redisHtsDatapointKey = toRedisHtsDatapointKey(redisKey);
          List<String> valueTexts = jedis.hmget(redisHtsDatapointKey, dateTexts.toArray(new String[dateTexts.size()]));
         
          List<Integer> times = Lists.newArrayListWithCapacity(dateTexts.size());
View Full Code Here

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

        Set<String> sessionIds;

        Jedis jedis = pool.getResource();
        try {
            sessionIds = jedis.zrangeByScore(RedisSessionKeys.getSessionsKey(), 0, Double.MAX_VALUE);

            pool.returnResource(jedis);
        } catch (Throwable e) {
            pool.returnBrokenResource(jedis);
            throw new RuntimeException(e);
View Full Code Here

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

        long max = System.currentTimeMillis() - (maxInactiveInterval * 1000);
        Set<String> sessionIds;

        Jedis jedis = pool.getResource();
        try {
            sessionIds = jedis.zrangeByScore(RedisSessionKeys.getSessionsKey(), 0, max);

            pool.returnResource(jedis);
        } catch (Throwable e) {
            pool.returnBrokenResource(jedis);
            throw new RuntimeException(e);
View Full Code Here

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

        Set<String> sessionIds;

        Jedis jedis = jedisPool.getResource();
        try {
            sessionIds = jedis.zrangeByScore(RedisSessionKeys.getSessionsKey(), 0, Double.MAX_VALUE);

            jedisPool.returnResource(jedis);
        } catch (Throwable e) {
            jedisPool.returnBrokenResource(jedis);
            throw new RuntimeException(e);
View Full Code Here

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

             long ts2 = System.currentTimeMillis();
             CQSControllerServlet.valueAccumulator.addToCounter(AccumulatorName.RedisTime, (ts2 - ts1));
           }
           else {
             long ts1 = System.currentTimeMillis();
             memIds = jedis.zrangeByScore(key, System.currentTimeMillis() - queue.getMsgRetentionPeriod() * 1000, System.currentTimeMillis(), 0, maxNumberOfMessages);
             long ts2 = System.currentTimeMillis();
             CQSControllerServlet.valueAccumulator.addToCounter(AccumulatorName.RedisTime, (ts2 - ts1));
             if (memIds == null || memIds.equals("nil")) { //done
               emptyQueue = true;
             }
View Full Code Here

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

            boolean brokenJedis = false;
            ShardedJedis jedis = getResource();
            try {
                //jedis is lame and does not have a constant for "-inf" which Redis supports. So we have to
                //pick an arbitrary old min value.
                Set<String> revisibleSet = jedis.zrangeByScore(queueUrl + "-" + shard + "-V", System.currentTimeMillis() - (1000 * 3600 * 24 * 14), System.currentTimeMillis());
                for (String revisibleMemId : revisibleSet) {
                    jedis.rpush(queueUrl + "-" + shard + "-Q", revisibleMemId);
                    jedis.zrem(queueUrl + "-" + shard + "-V", revisibleMemId);
                }
                ts2 = System.currentTimeMillis();
View Full Code Here

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

         return Collections.emptyList();
       }

       //if no previousReceiptHandle and no nextReceiptHandle, just retrieve from beginning
       if (previousReceiptHandle == null && nextReceiptHandle == null) {
         memIds = jedis.zrangeByScore(key, System.currentTimeMillis() - retention * 1000L, System.currentTimeMillis(), 0, num);
         if (memIds != null){
           memIdsRet = new ArrayList<String>(memIds);
         }
       }
       //else find the score for previous receipt,
View Full Code Here

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

       //   if not exist, same as no previous receipt
       //   else use zrangeByScore with limit
       else if (previousReceiptHandle != null) {
         Double previousScore = jedis.zscore(key, previousReceiptHandle);
         if (previousScore == null) {
           memIds = jedis.zrangeByScore(key, System.currentTimeMillis() - retention * 1000L, System.currentTimeMillis(), 0, num);
           if (memIds != null){
             memIdsRet = new ArrayList<String>(memIds);
           }
         } else {

View Full Code Here

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

           int i = 0;
           boolean includeSet = (previousReceiptHandle == null) ? true : false;

           while (retCount < num && i < llen) {

             memIds = jedis.zrangeByScore(key, startTime, System.currentTimeMillis(), i, num);

             if (memIds.size() == 0) {
               break; // done
             }
View Full Code Here

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

       } else { //this means previousReceiptHandle == null and nextReceiptHandle != null. Retrieve id backward
         //return result will exclude the nextReceiptHandle
         //retrieve nextReceiptHandle, get index. if not exist, retrieve from beginning.
         Long endRank = jedis.zrank(key, nextReceiptHandle);
         if (endRank == null) {
           memIds = jedis.zrangeByScore(key, System.currentTimeMillis() - retention * 1000L, System.currentTimeMillis(), 0, num);
           if (memIds != null){
             memIdsRet = new ArrayList<String>(memIds);
           }
         }
         //if index exist, retrieve based on index. When get result, remove expired id
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.