Examples of llen()


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

                jedis.lindex(inFlightKey(worker, queue), 0));

        TestUtils.stopWorker(worker, workerThread, false);

        Assert.assertTrue("The job should not be requeued after succesful processing",
                jedis.llen(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue)) == 0L);
        Assert.assertEquals("In-flight list should be empty when finishing a job",
                jedis.llen(inFlightKey(worker, queue)), (Long)0L);
    }

    @Test
View Full Code Here

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

        TestUtils.stopWorker(worker, workerThread, false);

        Assert.assertTrue("The job should not be requeued after succesful processing",
                jedis.llen(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue)) == 0L);
        Assert.assertEquals("In-flight list should be empty when finishing a job",
                jedis.llen(inFlightKey(worker, queue)), (Long)0L);
    }

    @Test
    public void testInterrupted() throws InterruptedException, JsonProcessingException {
        final String queue = "bar";
View Full Code Here

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

        workerThread.start();

        TestUtils.stopWorker(worker, workerThread, true);

        final Jedis jedis = TestUtils.createJedis(config);
        Assert.assertTrue("Job should be requeued", jedis.llen(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue)) == 1L);
        Assert.assertEquals("Incorrect job was requeued", ObjectMapperFactory.get().writeValueAsString(sleepJob),
                jedis.lindex(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue), 0));
        Assert.assertTrue("In-flight list should be empty when finishing a job", jedis.llen(inFlightKey(worker, queue)) == 0L);
    }
View Full Code Here

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

        final Jedis jedis = TestUtils.createJedis(config);
        Assert.assertTrue("Job should be requeued", jedis.llen(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue)) == 1L);
        Assert.assertEquals("Incorrect job was requeued", ObjectMapperFactory.get().writeValueAsString(sleepJob),
                jedis.lindex(JesqueUtils.createKey(config.getNamespace(), QUEUE, queue), 0));
        Assert.assertTrue("In-flight list should be empty when finishing a job", jedis.llen(inFlightKey(worker, queue)) == 0L);
    }

    @Test
    public void testJSONException() throws InterruptedException, JsonProcessingException {
        final String queue = "baz";
View Full Code Here

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

        Thread.sleep(1000);

        TestUtils.stopWorker(worker, workerThread, false);

        Assert.assertEquals("In-flight list should have length zero if the worker failed during JSON deserialization",
                jedis.llen(inFlightKey(worker, queue)), (Long) 0L);
    }

    private static String inFlightKey(final Worker worker, final String queue) {
        return JesqueUtils.createKey(config.getNamespace(), ResqueConstants.INFLIGHT, worker.getName(), queue);
    }
View Full Code Here

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

                    logger.debug("event=scheduled_revisibility_processor");
                }
            } catch (SetFailedException e) {
            }

            long llen = jedis.llen(queueUrl + "-" + shard + "-Q");
           
            if (llen == 0L) {
                return Collections.emptyList();
            }
           
View Full Code Here

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

                if (processHiddenIds) {
                  checkAndSetVisibilityProcessing(queueUrl, shard, CMBProperties.getInstance().getRedisRevisibleFrequencySec());
                    tryCheckAndProcessRevisibleSet(queueUrl, shard, CMBProperties.getInstance().getRedisRevisibleSetFrequencySec());
                }
             
                messageCount += jedis.llen(queueUrl + "-" + shard + "-Q");
            }
         
        } catch (JedisException e) {
            brokenJedis = true;
            throw e;
View Full Code Here

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

        try {

          jedis = getResource();
           
          for (int shard=0; shard<numberOfShards; shard++) {          
                messageCount += jedis.llen(queueUrl + "-" + shard + "-Q");
            }
         
        } 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.