Package redis.clients.jedis

Examples of redis.clients.jedis.Transaction.zrange()


  Transaction t = jedis.multi();
  Response<String> string = t.get("string");
  Response<String> list = t.lpop("list");
  Response<String> hash = t.hget("hash", "foo");
  Response<Set<String>> zset = t.zrange("zset", 0, -1);
  Response<String> set = t.spop("set");
  t.exec();

  assertEquals("foo", string.get());
  assertEquals("foo", list.get());
View Full Code Here


  Transaction t = jedis.multi();
  Response<byte[]> string = t.get("string".getBytes());
  Response<byte[]> list = t.lpop("list".getBytes());
  Response<byte[]> hash = t.hget("hash".getBytes(), "foo".getBytes());
  Response<Set<byte[]>> zset = t.zrange("zset".getBytes(), 0, -1);
  Response<byte[]> set = t.spop("set".getBytes());
  t.exec();

  assertArrayEquals("foo".getBytes(), string.get());
  assertArrayEquals("foo".getBytes(), list.get());
View Full Code Here

        Transaction trans = conn.multi();
        for (Tuple tuple : followers){
            String follower = tuple.getElement();
            start = tuple.getScore();
            trans.zadd("home:" + follower, postTime, String.valueOf(postId));
            trans.zrange("home:" + follower, 0, -1);
            trans.zremrangeByRank(
                "home:" + follower, 0, 0 - HOME_TIMELINE_SIZE - 1);
        }
        trans.exec();
View Full Code Here

            int erange = Math.min(sindex + 9, eindex - 2);

            Transaction trans = conn.multi();
            trans.zrem(zsetName, start);
            trans.zrem(zsetName, end);
            trans.zrange(zsetName, sindex, erange);
            List<Object> results = trans.exec();
            if (results != null){
                items = (Set<String>)results.get(results.size() - 1);
                break;
            }
View Full Code Here

        trans.zcard("idx:" + id);
        if (desc) {
            trans.zrevrange("idx:" + id, start, start + num - 1);
        }else{
            trans.zrange("idx:" + id, start, start + num - 1);
        }
        List<Object> results = trans.exec();

        return new SearchResult(
            id,
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.