Examples of lrange()


Examples of org.jredis.JRedis.lrange()

        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 org.springframework.data.redis.connection.StringRedisConnection.lRange()

        StringRedisConnection stringRedisConn = (StringRedisConnection) connection;
        stringRedisConn.set("foo", "5");
        stringRedisConn.get("foo");
        stringRedisConn.rPush("foolist", "10");
        stringRedisConn.rPush("foolist", "11");
        stringRedisConn.lRange("foolist", 0, -1);
        return null;
      }
    }, new GenericToStringSerializer<Long>(Long.class));
    assertEquals(Arrays.asList(new Object[] { 5l, 1l, 2l, Arrays.asList(new Long[] { 10l, 11l }) }), results);
  }
View Full Code Here

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

        return lrem;
    }

    public List<String> lrange(int start, int end) {
        Jedis jedis = getResource();
        List<String> lrange = jedis.lrange(key(), start, end);
        returnResource(jedis);
        return lrange;
    }

    // Redis SortedSet Operations
View Full Code Here

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

        Jedis jedis = jedisPool.getResource();

        try
        {
            // Get the list of tasks indexed by owner type and id
            List<String> taskKeys = jedis.lrange(taskOwnerKey(type, ownerId), 0, -1);

            // Retrieve the whole Task entity
            List<Task> tasks = new ArrayList<Task>();

            for (String taskKey : taskKeys)
View Full Code Here

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

    {
        Jedis jedis = jedisPool.getResource();

        try
        {
            List<String> result = jedis.lrange(taskOwnerKey(type, ownerId), 0, 0);

            if (result.isEmpty())
            {
                return null;
            }
View Full Code Here

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

    {
        Jedis jedis = jedisPool.getResource();

        try
        {
            List<String> result = jedis.lrange(taskOwnerKey(type, ownerId), 0, 0);

            if (result.isEmpty())
            {
                return null;
            }
View Full Code Here

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

  @Override
  public List<String> lrange(String key, long start, long end) throws Exception {
    Jedis jedis = _jedisPool.getResource();
    try {
      return jedis.lrange(key, start, end);
    } finally {
      _jedisPool.returnResource(jedis);
    }
  }
View Full Code Here

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

        logger.info("Pulling paste history: " + count + " record(s) starting " + startIndex);
        Jedis jedis = jedisPool.getResource();

        try {
            if(startIndex == 0 && jedis.exists("pasteHistoryCache")) {
                List<byte[]> packedBytes = jedis.lrange("pasteHistoryCache".getBytes(), 0, 4);
                return getUnpackedHistory(packedBytes);
            }
            long beginItemIdsRedis = System.currentTimeMillis();
            List<String> itemIds = jedis.lrange("pasteHistory", startIndex, startIndex + count);
            List<Long> itemsAsLong = new ArrayList<Long>(itemIds.size());
View Full Code Here

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

            if(startIndex == 0 && jedis.exists("pasteHistoryCache")) {
                List<byte[]> packedBytes = jedis.lrange("pasteHistoryCache".getBytes(), 0, 4);
                return getUnpackedHistory(packedBytes);
            }
            long beginItemIdsRedis = System.currentTimeMillis();
            List<String> itemIds = jedis.lrange("pasteHistory", startIndex, startIndex + count);
            List<Long> itemsAsLong = new ArrayList<Long>(itemIds.size());
            // Convert from String to Long so Mongo doesn't complain (TODO change this cause it sucks)
            for (String itemId : itemIds) {
                itemsAsLong.add(Long.parseLong(itemId));
            }
View Full Code Here

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

  @Override
  public List<String> lrange(String key, long start, long end)
      throws Exception {
    Jedis jedis = _jedisPool.getResource();
    try {
      return jedis.lrange(key, start, end);
    } finally {
      _jedisPool.returnResource(jedis);
    }
  }
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.