Examples of llen()


Examples of org.jredis.JRedis.llen()

        String metaIndices = type.equals(RedisIndexKeys.AUTO) ? RedisIndexKeys.META_INDICES_AUTO : RedisIndexKeys.META_INDICES_MANUAL;
        String metaType    = type.equals(RedisIndexKeys.AUTO) ? RedisIndexKeys.META_AUTO : RedisIndexKeys.META_MANUAL;

        try {
            List<byte[]> indices = db.lrange(metaIndices, 0, db.llen(metaIndices));

            if(null == indices) return;

            for(byte[] idx: indices){
                String indexName = new String(idx);
View Full Code Here

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

        return lindex;
    }

    public Long llen() {
        Jedis jedis = getResource();
        Long llen = jedis.llen(key());
        returnResource(jedis);
        return llen;
    }

    public Long lrem(int count, String value) {
View Full Code Here

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

  @Override
  public long llen(String key) throws Exception {
    Jedis jedis = _jedisPool.getResource();
    try {
      return jedis.llen(key);
    } finally {
      _jedisPool.returnResource(jedis);
    }
  }
View Full Code Here

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

    public long count() {
        Jedis jedis = jedisPool.getResource();
        try {
            long beginGetCount = System.currentTimeMillis();
            long count = jedis.llen("pasteHistory");
            logger.debug("Time taken to get redis:pasteHistory count:" + (System.currentTimeMillis() - beginGetCount));
            return count;
        } catch (JedisConnectionException je) {
            if (null != jedis) {
                jedisPool.returnBrokenResource(jedis);
View Full Code Here

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

  @Override
  public long llen(String key) throws Exception {
    Jedis jedis = _jedisPool.getResource();
    try {
      return jedis.llen(key);
    } finally {
      _jedisPool.returnResource(jedis);
    }
  }
View Full Code Here

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

    @Override
    public int getLeftRequestsCount(Task task) {
        Jedis jedis = pool.getResource();
        try {
            Long size = jedis.llen(getQueueKey(task));
            return size.intValue();
        } finally {
            pool.returnResource(jedis);
        }
    }
View Full Code Here

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

    public void appendEvents(String type, final DomainEventStream events) {
        Jedis jedis = redisConnectionProvider.newConnection();
        DomainEventMessage firstEvent = events.peek();
        final byte[] key = (type + "." + firstEvent.getAggregateIdentifier()).getBytes(IOUtils.UTF8);
        jedis.watch(key);
        Long eventCount = jedis.llen(key);
        if ((firstEvent.getSequenceNumber() != 0 && eventCount == null)
                || firstEvent.getSequenceNumber() != eventCount) {
            jedis.unwatch();
            throw new ConcurrencyException(
                    String.format("Concurrent modification detected for Aggregate identifier [%s], sequence: [%s]",
View Full Code Here

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

        // Enqueue the job before worker is created and started
        final Job job = new Job("TestAction", new Object[] { 1, 2.3, true, "test", Arrays.asList("inner", 4.5) });
        TestUtils.enqueueJobs(testQueue, Arrays.asList(job), config);
        Jedis jedis = createJedis(config);
        try { // Assert that we enqueued the job
            Assert.assertEquals(Long.valueOf(1), jedis.llen(createKey(config.getNamespace(), QUEUE, testQueue)));
        } finally {
            jedis.quit();
        }

        // Create and start worker
View Full Code Here

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

        // Assert that the job was run by the worker
        jedis = createJedis(config);
        try {
            Assert.assertEquals("1", jedis.get(createKey(config.getNamespace(), STAT, PROCESSED)));
            Assert.assertNull(jedis.get(createKey(config.getNamespace(), STAT, FAILED)));
            Assert.assertEquals(Long.valueOf(0), jedis.llen(createKey(config.getNamespace(), QUEUE, testQueue)));
        } finally {
            jedis.quit();
        }
    }
}
View Full Code Here

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

        Thread.sleep(1000);

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