Examples of zcount()


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

        TestUtils.enqueueJobs(testQueue, jobs, config);

        Jedis jedis = createJedis(config);
        try { // Assert that we enqueued the job
            Assert.assertEquals(Long.valueOf(10),
                    jedis.zcount(createKey(config.getNamespace(), QUEUE, delayTestQueue), "-inf", "+inf"));
        } finally {
            jedis.quit();
        }

        // Create and start worker
View Full Code Here

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

        jedis = createJedis(config);
        try {
            Assert.assertEquals(String.valueOf(20), jedis.get(createKey(config.getNamespace(), STAT, PROCESSED)));
            Assert.assertNull(jedis.get(createKey(config.getNamespace(), STAT, FAILED)));
            Assert.assertEquals(Long.valueOf(0),
                    jedis.zcount(createKey(config.getNamespace(), QUEUE, delayTestQueue), "-inf", "+inf"));
        } finally {
            jedis.quit();
        }
    }
}
View Full Code Here

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

     try {

       jedis = getResource();
       String key = queueUrl + "-" + shard + "-Q";

       long llen = jedis.zcount(key, System.currentTimeMillis() - retention * 1000L, System.currentTimeMillis());

       if (llen == 0L) {
         return Collections.emptyList();
       }

View Full Code Here

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

           throw new IllegalStateException("Redis cache not available");
         }

         //get the count number
         if(type == MessageCountType.ALL){
           messageCount += jedis.zcount(queueUrl + "-" + shard + "-Q", String.valueOf(System.currentTimeMillis() - retention * 1000L), "+inf");
         } else if (type == MessageCountType.INVISIBLE) {
           messageCount += jedis.zcount(queueUrl + "-" + shard + "-Q", String.valueOf(System.currentTimeMillis()+1), "+inf");
         }
       }

View Full Code Here

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

         //get the count number
         if(type == MessageCountType.ALL){
           messageCount += jedis.zcount(queueUrl + "-" + shard + "-Q", String.valueOf(System.currentTimeMillis() - retention * 1000L), "+inf");
         } else if (type == MessageCountType.INVISIBLE) {
           messageCount += jedis.zcount(queueUrl + "-" + shard + "-Q", String.valueOf(System.currentTimeMillis()+1), "+inf");
         }
       }

     } catch (JedisException e) {
       brokenJedis = true;
View Full Code Here

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

     try {

       jedis = getResource();

       for (int shard=0; shard<numberOfShards; shard++) {          
         messageCount += jedis.zcount(queueUrl + "-" + shard + "-Q", String.valueOf(System.currentTimeMillis() - retention * 1000L), "+inf");
       }

     } catch (JedisException e) {
       brokenJedis = true;
       throw e;
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.