Package redis.clients.jedis

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


        Pipeline pipe = conn.pipelined();
        pipe.setrange("location:" + shardId, offset, code);

        String tkey = UUID.randomUUID().toString();
        pipe.zadd(tkey, userId, "max");
        pipe.zunionstore(
            "location:max",
            new ZParams().aggregate(ZParams.Aggregate.MAX),
            tkey,
            "location:max");
View Full Code Here


    public void updateTokenPipeline(Jedis conn, String token, String user, String item) {
        long timestamp = System.currentTimeMillis() / 1000;
        Pipeline pipe = conn.pipelined();
        pipe.hset("login:", token, user);
        pipe.zadd("recent:", timestamp, token);
        if (item != null){
            pipe.zadd("viewed:" + token, timestamp, item);
            pipe.zremrangeByRank("viewed:" + token, 0, -26);
            pipe.zincrby("viewed:", -1, item);
        }
View Full Code Here

        long timestamp = System.currentTimeMillis() / 1000;
        Pipeline pipe = conn.pipelined();
        pipe.hset("login:", token, user);
        pipe.zadd("recent:", timestamp, token);
        if (item != null){
            pipe.zadd("viewed:" + token, timestamp, item);
            pipe.zremrangeByRank("viewed:" + token, 0, -26);
            pipe.zincrby("viewed:", -1, item);
        }
        pipe.exec();
    }
View Full Code Here

            try
            {
            if (this.pipeLineOrConnection.getClass().isAssignableFrom(Jedis.class))
            {
                pipeLine = ((Jedis) this.pipeLineOrConnection).pipelined();
                pipeLine.zadd(idx_Name, value, parentId.toString());
//                pipeLine.sync();
            }
            else
            {
                ((Transaction) this.pipeLineOrConnection).zadd(idx_Name, value, parentId.toString());
View Full Code Here

        for (String dateAsIntText : dates.inverse().keySet()) {
          pipeline.zrem(redisHtsDaysKey, dateAsIntText);
        }
       
        for (Entry<Double, String> entry : dates.entrySet()) {
          pipeline.zadd(redisHtsDaysKey, entry.getKey(), entry.getValue());
        }
            
        pipeline.exec();
        pipeline.sync();
        getJedisPool().returnResource(jedis);
View Full Code Here

            }
            Pipeline p = shard.pipelined();
            for (Map.Entry<String, String> field : fields.entrySet()) {
                idx.cat(field.getKey()).cat(field.getValue());
                String key = idx.key();
                p.zadd(key, order, id);
                p.rpush(idx.cat(id).key(), key);
                p.hset(idx.cat(id).cat(Seek.FIELDS).key(), field.getKey(),
                        field.getValue());

                // adds on facets
View Full Code Here

                p.hincrBy(idx.cat(Seek.INFO).key(), field.getKey(), 1);
            }
            for (String tag : tags) {
                idx.cat(tag);
                String key = idx.key();
                p.zadd(key, order, id);
                p.rpush(idx.cat(id).key(), key);
                p.rpush(idx.cat(id).cat(Seek.TAGS).key(), tag);

                // adds on facets
                p.hincrBy(idx.cat(Seek.INFO).cat(Seek.TAGS).key(), tag, 1);
View Full Code Here

            }
            for (Map.Entry<String, Set<String>> field : textFields.entrySet()) {
                for (String word : field.getValue()) {
                    idx.cat(field.getKey()).cat(word);
                    String key = idx.key();
                    p.zadd(key, order, id);
                    p.rpush(idx.cat(id).key(), key);
                }
            }
            p.incr(idx.cat(Seek.INFO).cat(Seek.TOTAL).key());
            p.execute();
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.