Examples of lindex()


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

        return lset;
    }

    public String lindex(int index) {
        Jedis jedis = getResource();
        String lindex = jedis.lindex(key(), index);
        returnResource(jedis);
        return lindex;
    }

    public Long llen() {
View Full Code Here

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

        final Jedis jedis = TestUtils.createJedis(config);
        Assert.assertEquals("In-flight list should have length one when running the job",
                jedis.llen(inFlightKey(worker, queue)), (Long)1L);
        Assert.assertEquals("Object on the in-flight list should be the first job",
                ObjectMapperFactory.get().writeValueAsString(sleepJob),
                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);
View Full Code Here

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

        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);
    }

    @Test
    public void testJSONException() throws InterruptedException, JsonProcessingException {
View Full Code Here

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

                        String memId;
                       
                        if (visibilityTO > 0) {
                            memId = jedis.lpop(queue.getRelativeUrl() + "-" + shard + "-Q");
                        } else {
                            memId = jedis.lindex(queue.getRelativeUrl() + "-" + shard + "-Q", i);
                        }
                       
                        long ts2 = System.currentTimeMillis();
                        CQSControllerServlet.valueAccumulator.addToCounter(AccumulatorName.RedisTime, (ts2 - ts1));
                       
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.