Package redis.clients.jedis

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


        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

    {
        Jedis jedis = jedisPool.getResource();

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

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

    {
        Jedis jedis = jedisPool.getResource();

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

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

  @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

        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

            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

  @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

  public List<Map<String,String>> listSubscriptions(String meetingId){
    List<Map<String,String>> list = new ArrayList<Map<String,String>>();
    Jedis jedis = redisPool.getResource();
    try {
      List<String> sids = jedis.lrange("meeting:" + meetingId + ":subscriptions", 0 , -1);
      for(int i=0; i<sids.size(); i++){
        Map<String,String> props = jedis.hgetAll("meeting:" + meetingId + ":subscription:" + sids.get(i));
        list.add(props)
      }
       
View Full Code Here

 
  public List<Map<String,String>> listSubscriptions(String meetingId){
    List<Map<String,String>> list = new ArrayList<Map<String,String>>();
    Jedis jedis = redisPool.getResource();
    try {
      List<String> sids = jedis.lrange("meeting:" + meetingId + ":subscriptions", 0 , -1);
      for(int i=0; i<sids.size(); i++){
        Map<String,String> props = jedis.hgetAll("meeting:" + meetingId + ":subscription:" + sids.get(i));
        list.add(props)
      }
       
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.