Package redis.clients.jedis

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


    public long createStatus(
        Jedis conn, long uid, String message, Map<String,String> data)
    {
        Transaction trans = conn.multi();
        trans.hget("user:" + uid, "login");
        trans.incr("status:id:");

        List<Object> response = trans.exec();
        String login = (String)response.get(0);
        long id = (Long)response.get(1);
View Full Code Here


            "-inf".getBytes(),
            String.valueOf(now - timeout).getBytes());
        ZParams params = new ZParams();
        params.weights(1, 0);
        trans.zinterstore(czset, params, czset, semname);
        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);
View Full Code Here

            trans, 30, new ZParams().weights(0, 1), matchedAds, "ad:value:");

        Pair<Set<String>,String> result = finishScoring(
            trans, matchedAds, baseEcpm, content);

        trans.incr("ads:served:");
        trans.zrevrange("idx:" + result.getValue1(), 0, 0);

        List<Object> response = trans.exec();
        long targetId = (Long)response.get(response.size() - 2);
        Set<String> targetedAds = (Set<String>)response.get(response.size() - 1);
View Full Code Here

                trans.sadd(matchedKey, term);
            }
            trans.expire(matchedKey, 900);
        }

        trans.incr("type:" + type + ":views:");
        for (String term : terms) {
            trans.zincrby("views:" + adId, 1, term);
        }
        trans.zincrby("views:" + adId, 1, "");
View Full Code Here

                clickKey = "actions:" + adId;
            }
        }

        if (action && Ecpm.CPA.equals(ecpm)) {
            trans.incr("type:" + type + ":actions:");
        }else{
            trans.incr("type:" + type + ":clicks:");
        }

        for (String word : matched) {
View Full Code Here

        }

        if (action && Ecpm.CPA.equals(ecpm)) {
            trans.incr("type:" + type + ":actions:");
        }else{
            trans.incr("type:" + type + ":clicks:");
        }

        for (String word : matched) {
            trans.zincrby(clickKey, 1, word);
        }
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.