Examples of zadd()


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

        return zrange;
    }

    public Long zadd(float score, String member) {
        Jedis jedis = getResource();
        Long zadd = jedis.zadd(key(), score, member);
        returnResource(jedis);
        return zadd;
    }

    public Long zcard() {
View Full Code Here

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

    }

    @Test
    public void testIsDelayedQueue_Success() {
        final Jedis jedis = createJedis(CONFIG);
        jedis.zadd(TEST_KEY, 1.0, "bar");
        Assert.assertTrue(JedisUtils.isDelayedQueue(jedis, TEST_KEY));
    }

    @Test
    public void testIsDelayedQueue_Failure() {
View Full Code Here

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

    }

    @Test
    public void testCanUseAsDelayedQueue_Success_ZSet() {
        final Jedis jedis = createJedis(CONFIG);
        jedis.zadd(TEST_KEY, 1.0, "bar");
        Assert.assertTrue(JedisUtils.canUseAsDelayedQueue(jedis, TEST_KEY));
    }

    @Test
    public void testCanUseAsDelayedQueue_Success_None() {
View Full Code Here

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

          jedis.hset(uniqueRedisKey, EXCHANGE, holiday.getExchangeExternalId().getValue());
          jedis.hset(toRedisKey(holiday.getExchangeExternalId(), holiday.getType()), UNIQUE_ID, uniqueId.toString());
        }
       
        for (LocalDate holidayDate : holiday.getHolidayDates()) {
          jedis.zadd(daysKey, LocalDateToIntConverter.convertToInt(holidayDate), holidayDate.toString());
        }
        getJedisPool().returnResource(jedis);
      } catch (Exception e) {
        s_logger.error("Unable to add holiday " + holiday, e);
        getJedisPool().returnBrokenResource(jedis);
View Full Code Here

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

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

    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

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

        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

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

            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

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

        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

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

            }
            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
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.