Examples of zcard()


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

        return zadd;
    }

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

    private void returnResource(final Jedis jedis) {
View Full Code Here

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

        String key = RedisSessionKeys.getSessionsKey();

        Long result;
        Jedis jedis = pool.getResource();
        try {
            result = jedis.zcard(key);
            pool.returnResource(jedis);
        } catch (Throwable e) {
            pool.returnBrokenResource(jedis);
            throw new RuntimeException(e);
        }
View Full Code Here

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

  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");
  Response<List<String>> lrange = p.lrange("list", 0, -1);
  Response<Map<String, String>> hgetAll = p.hgetAll("hash");
  p.sadd("set", "foo");
  Response<Set<String>> smembers = p.smembers("set");
View Full Code Here

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

             
                //get the count number from
                if(suffix.equals("-H")){
                  messageCount += jedis.hlen(queueUrl + "-" + shard + suffix);
                } else if (suffix.equals("-V")){
                  messageCount += jedis.zcard(queueUrl + "-" + shard + suffix);
                }
            }
         
        } catch (JedisException e) {
            brokenJedis = true;
View Full Code Here

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

            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();
                List<ConjunctiveFormula> dnf = DNF.convert(formulas);
                for (ConjunctiveFormula conjunctiveFormula : dnf) {
View Full Code Here

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

  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");
  Response<List<String>> lrange = p.lrange("list", 0, -1);
  Response<Map<String, String>> hgetAll = p.hgetAll("hash");
  p.sadd("set", "foo");
  Response<Set<String>> smembers = p.smembers("set");
View Full Code Here

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

        long now = System.currentTimeMillis();

        Transaction trans = conn.multi();
        trans.zadd(fkey1, now, String.valueOf(otherUid));
        trans.zadd(fkey2, now, String.valueOf(uid));
        trans.zcard(fkey1);
        trans.zcard(fkey2);
        trans.zrevrangeWithScores("profile:" + otherUid, 0, HOME_TIMELINE_SIZE - 1);

        List<Object> response = trans.exec();
        long following = (Long)response.get(response.size() - 3);
View Full Code Here

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

        Transaction trans = conn.multi();
        trans.zadd(fkey1, now, String.valueOf(otherUid));
        trans.zadd(fkey2, now, String.valueOf(uid));
        trans.zcard(fkey1);
        trans.zcard(fkey2);
        trans.zrevrangeWithScores("profile:" + otherUid, 0, HOME_TIMELINE_SIZE - 1);

        List<Object> response = trans.exec();
        long following = (Long)response.get(response.size() - 3);
        long followers = (Long)response.get(response.size() - 2);
View Full Code Here

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

        }

        Transaction trans = conn.multi();
        trans.zrem(fkey1, String.valueOf(otherUid));
        trans.zrem(fkey2, String.valueOf(uid));
        trans.zcard(fkey1);
        trans.zcard(fkey2);
        trans.zrevrange("profile:" + otherUid, 0, HOME_TIMELINE_SIZE - 1);

        List<Object> response = trans.exec();
        long following = (Long)response.get(response.size() - 3);
View Full Code Here

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

        Transaction trans = conn.multi();
        trans.zrem(fkey1, String.valueOf(otherUid));
        trans.zrem(fkey2, String.valueOf(uid));
        trans.zcard(fkey1);
        trans.zcard(fkey2);
        trans.zrevrange("profile:" + otherUid, 0, HOME_TIMELINE_SIZE - 1);

        List<Object> response = trans.exec();
        long following = (Long)response.get(response.size() - 3);
        long followers = (Long)response.get(response.size() - 2);
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.