Examples of zadd()


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

        trans = conn.multi();
        trans.hset("user:" + uid, "following", String.valueOf(following));
        trans.hset("user:" + otherUid, "followers", String.valueOf(followers));
        if (statuses.size() > 0) {
            for (Tuple status : statuses){
                trans.zadd("home:" + uid, status.getScore(), status.getElement());
            }
        }
        trans.zremrangeByRank("home:" + uid, 0, 0 - HOME_TIMELINE_SIZE - 1);
        trans.exec();
View Full Code Here

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

        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.zadd()

        messages = messages.subList(0, HOME_TIMELINE_SIZE);

        Transaction trans = conn.multi();
        if (messages.size() > 0) {
            for (Tuple tuple : messages) {
                trans.zadd(timeline, tuple.getScore(), tuple.getElement());
            }
        }
        trans.zremrangeByRank(timeline, 0, 0 - HOME_TIMELINE_SIZE - 1);
        trans.exec();
View Full Code Here

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

        trans.incr(ctr);
        List<Object> results = trans.exec();
        int counter = ((Long)results.get(results.size() - 1)).intValue();

        trans = conn.multi();
        trans.zadd(semname, now, identifier);
        trans.zadd(czset, counter, identifier);
        trans.zrank(czset, identifier);
        results = trans.exec();
        int result = ((Long)results.get(results.size() - 1)).intValue();
        if (result < limit){
View Full Code Here

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

        List<Object> results = trans.exec();
        int counter = ((Long)results.get(results.size() - 1)).intValue();

        trans = conn.multi();
        trans.zadd(semname, now, identifier);
        trans.zadd(czset, counter, identifier);
        trans.zrank(czset, identifier);
        results = trans.exec();
        int result = ((Long)results.get(results.size() - 1)).intValue();
        if (result < limit){
            return identifier;
View Full Code Here

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

    {
        recipients.add(sender);

        Transaction trans = conn.multi();
        for (String recipient : recipients){
            trans.zadd("chat:" + chatId, 0, recipient);
            trans.zadd("seen:" + recipient, 0, chatId);
        }
        trans.exec();

        return sendMessage(conn, chatId, sender, message);
View Full Code Here

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

        recipients.add(sender);

        Transaction trans = conn.multi();
        for (String recipient : recipients){
            trans.zadd("chat:" + chatId, 0, recipient);
            trans.zadd("seen:" + recipient, 0, chatId);
        }
        trans.exec();

        return sendMessage(conn, chatId, sender, message);
    }
View Full Code Here

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

            chatMessages.add(new ChatMessages(chatId, messages));
        }

        trans = conn.multi();
        for (Object[] seenUpdate : seenUpdates){
            trans.zadd(
                (String)seenUpdate[0],
                (Integer)seenUpdate[1],
                (String)seenUpdate[2]);
        }
        for (Object[] msgRemove : msgRemoves){
View Full Code Here

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

            trans.sadd("idx:req:" + location, id);
        }

        Set<String> words = tokenize(content);
        for (String word : tokenize(content)) {
            trans.zadd("idx:" + word, 0, id);
        }


        double avg = AVERAGE_PER_1K.containsKey(type) ? AVERAGE_PER_1K.get(type) : 1;
        double rvalue = toEcpm(type, 1000, avg, value);
View Full Code Here

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

        double avg = AVERAGE_PER_1K.containsKey(type) ? AVERAGE_PER_1K.get(type) : 1;
        double rvalue = toEcpm(type, 1000, avg, value);

        trans.hset("type:", id, type.name().toLowerCase());
        trans.zadd("idx:ad:value:", rvalue, id);
        trans.zadd("ad:base_value:", value, id);
        for (String word : words){
            trans.sadd("terms:" + id, word);
        }
        trans.exec();
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.