Package redis.clients.jedis

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


                    newConfig = this.parseConfigHash(jedis.hgetAll(builder.name()), builder.name());
                } else {
                    Map<String, String> hash = this.buildConfigHash(builder);
                    jedis.watch(builder.name());
                    Transaction t = jedis.multi();
                    hash.forEach((k, v) -> t.hset(builder.name(), k, v));
                    if (t.exec() != null) {
                        newConfig = builder;
                    }
                }
            }
View Full Code Here


            return -1;
        }

        long id = conn.incr("user:id:");
        Transaction trans = conn.multi();
        trans.hset("users:", llogin, String.valueOf(id));
        Map<String,String> values = new HashMap<String,String>();
        values.put("login", login);
        values.put("id", String.valueOf(id));
        values.put("name", name);
        values.put("followers", "0");
View Full Code Here

        long following = (Long)response.get(response.size() - 3);
        long followers = (Long)response.get(response.size() - 2);
        Set<Tuple> statuses = (Set<Tuple>)response.get(response.size() - 1);

        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());
            }
View Full Code Here

        long followers = (Long)response.get(response.size() - 2);
        Set<Tuple> statuses = (Set<Tuple>)response.get(response.size() - 1);

        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());
            }
        }
View Full Code Here

        long following = (Long)response.get(response.size() - 3);
        long followers = (Long)response.get(response.size() - 2);
        Set<String> statuses = (Set<String>)response.get(response.size() - 1);

        trans = conn.multi();
        trans.hset("user:" + uid, "following", String.valueOf(following));
        trans.hset("user:" + otherUid, "followers", String.valueOf(followers));
        if (statuses.size() > 0){
            for (String status : statuses) {
                trans.zrem("home:" + uid, status);
            }
View Full Code Here

        long followers = (Long)response.get(response.size() - 2);
        Set<String> statuses = (Set<String>)response.get(response.size() - 1);

        trans = conn.multi();
        trans.hset("user:" + uid, "following", String.valueOf(following));
        trans.hset("user:" + otherUid, "followers", String.valueOf(followers));
        if (statuses.size() > 0){
            for (String status : statuses) {
                trans.zrem("home:" + uid, status);
            }
        }
View Full Code Here


        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);
        }
View Full Code Here

       }
       Transaction tr = j.multi();
       if (state == null) {
         tr.hdel(queueUrl + "-" + shard + "-" + CQSConstants.REDIS_STATE, CQSConstants.REDIS_STATE);
       } else {
         tr.hset(queueUrl + "-" + shard + "-" + CQSConstants.REDIS_STATE, CQSConstants.REDIS_STATE, state.name());
       }
       List<Object> resp = tr.exec();
       if (resp == null) {
         throw new SetFailedException();
       }
View Full Code Here

            }
            Transaction tr = j.multi();
            if (state == null) {
                tr.hdel(queueUrl + "-" + shard + "-" + CQSConstants.REDIS_STATE, CQSConstants.REDIS_STATE);
            } else {
                tr.hset(queueUrl + "-" + shard + "-" + CQSConstants.REDIS_STATE, CQSConstants.REDIS_STATE, state.name());
            }
            List<Object> resp = tr.exec();
            if (resp == null) {
                throw new SetFailedException();
            }
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.