Examples of zrange()


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

    }

    // Redis SortedSet Operations
    public Set<String> zrange(int start, int end) {
        Jedis jedis = getResource();
        Set<String> zrange = jedis.zrange(key(), start, end);
        returnResource(jedis);
        return zrange;
    }

    public Long zadd(float score, String member) {
View Full Code Here

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

  Pipeline p = jedis.pipelined();
  Response<String> string = p.get("string");
  Response<String> list = p.lpop("list");
  Response<String> hash = p.hget("hash", "foo");
  Response<Set<String>> zset = p.zrange("zset", 0, -1);
  Response<String> set = p.spop("set");
  Response<Boolean> blist = p.exists("list");
  Response<Double> zincrby = p.zincrby("zset", 1, "foo");
  Response<Long> zcard = p.zcard("zset");
  p.lpush("list", "bar");
View Full Code Here

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

                                            .size()]);
                    pipeline.zinterstore(tmpkey, zparams, keys);
                    pipeline.zunionstore(rkey, zparams, tmpkey, rkey);
                }
                if (order.equals(Order.ASC)) {
                    pipeline.zrange(rkey, start, end);
                } else {
                    pipeline.zrevrange(rkey, start, end);
                }
                List<byte[]> rawresult = null;
                if (cache == 0) {
View Full Code Here

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

        Jedis shard = jedis.getShard(shardKey);
        try {
            long tstart = System.nanoTime();
            List<String> result = null;
            long count = 0;
            Set<String> range = jedis.zrange(rkeyCached, start, end);
            if (range != null && range.size() > 0) {
                count = jedis.zcard(rkeyCached);
                result = Arrays.asList(range.toArray(new String[range.size()]));
            } else {
                Pipeline pipeline = shard.pipelined();
View Full Code Here

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

  Response<String> string = p.get("string");
  Response<Long> del = p.del("string");
  Response<String> emptyString = p.get("string");
  Response<String> list = p.lpop("list");
  Response<String> hash = p.hget("hash", "foo");
  Response<Set<String>> zset = p.zrange("zset", 0, -1);
  Response<String> set = p.spop("set");
  Response<Boolean> blist = p.exists("list");
  Response<Double> zincrby = p.zincrby("zset", 1, "foo");
  Response<Long> zcard = p.zcard("zset");
  p.lpush("list", "bar");
View Full Code Here

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

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

  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

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

        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

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

            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

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

        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.