Examples of lpop()


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

        byte[] data = null;
        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();
            long begin = System.currentTimeMillis();
            data = jedis.lpop(SafeEncoder.encode(key));
            long end = System.currentTimeMillis();
            LOG.info("getValueFromCache spends: " + (end - begin)
                    + " millionseconds.");
        } catch (Exception e) {
            // do jedis.quit() and jedis.disconnect()
View Full Code Here

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

        Jedis connection = null;
        try {
            connection = pool.getResource();
            String line = null;
            if(getMode.equals(GetMode.RANDOM_REMOVE)) {
                line = connection.lpop(redisKey);               
            } else {
                line = connection.srandmember(redisKey);
            }
            if(line == null) { // i.e. no more data (nil)
                throw new JMeterStopThreadException("End of redis data detected, thread will exit");
View Full Code Here

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

    @Override
    public synchronized Request poll(Task task) {
        Jedis jedis = pool.getResource();
        try {
            String url = jedis.lpop(getQueueKey(task));
            if (url == null) {
                return null;
            }
            String key = ITEM_PREFIX + task.getUUID();
            String field = DigestUtils.shaHex(url);
View Full Code Here

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

        byte[] data = null;
        Jedis jedis = null;
        try {
            jedis = this.jedisPool.getResource();
            long begin = System.currentTimeMillis();
            data = jedis.lpop(SafeEncoder.encode(key));
            long end = System.currentTimeMillis();
            LOG.info("getValueFromCache spends: " + (end - begin)
                    + " millionseconds.");
        } catch (Exception e) {
            // do jedis.quit() and jedis.disconnect()
View Full Code Here

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

  byte[] bytesForSetRange = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  jedis.setrange("setrangebytes".getBytes(), 0, bytesForSetRange);

  Pipeline p = jedis.pipelined();
  Response<String> string = p.get("string");
  Response<String> list = p.lpop("list");
  Response<String> hash = p.hget("hash", "foo");
  Response<Set<String>> zset = p.zrange("zset", 0, -1);
  Response<String> set = p.spop("set");
  Response<Boolean> blist = p.exists("list");
  Response<Double> zincrby = p.zincrby("zset", 1, "foo");
View Full Code Here

Examples of redis.clients.jedis.ShardedJedis.lpop()

                   
                      long ts1 = System.currentTimeMillis();
                        String memId;
                       
                        if (visibilityTO > 0) {
                            memId = jedis.lpop(queue.getRelativeUrl() + "-" + shard + "-Q");
                        } else {
                            memId = jedis.lindex(queue.getRelativeUrl() + "-" + shard + "-Q", i);
                        }
                       
                        long ts2 = System.currentTimeMillis();
View Full Code Here

Examples of redis.clients.jedis.ShardedJedisPipeline.lpop()

  ShardedJedisPipeline p = jedis.pipelined();
  Response<String> string = p.get("string");
  Response<Long> del = p.del("string");
  Response<String> emptyString = p.get("string");
  Response<String> list = p.lpop("list");
  Response<String> hash = p.hget("hash", "foo");
  Response<Set<String>> zset = p.zrange("zset", 0, -1);
  Response<String> set = p.spop("set");
  Response<Boolean> blist = p.exists("list");
  Response<Double> zincrby = p.zincrby("zset", 1, "foo");
View Full Code Here

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

  jedis.zadd("zset", 1, "foo");
  jedis.sadd("set", "foo");

  Transaction t = jedis.multi();
  Response<String> string = t.get("string");
  Response<String> list = t.lpop("list");
  Response<String> hash = t.hget("hash", "foo");
  Response<Set<String>> zset = t.zrange("zset", 0, -1);
  Response<String> set = t.spop("set");
  t.exec();
View Full Code Here

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

  jedis.zadd("zset", 1, "foo");
  jedis.sadd("set", "foo");

  Transaction t = jedis.multi();
  Response<byte[]> string = t.get("string".getBytes());
  Response<byte[]> list = t.lpop("list".getBytes());
  Response<byte[]> hash = t.hget("hash".getBytes(), "foo".getBytes());
  Response<Set<byte[]>> zset = t.zrange("zset".getBytes(), 0, -1);
  Response<byte[]> set = t.spop("set".getBytes());
  t.exec();
View Full Code Here

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

                this.jedis.unwatch();
                result = val;
                break;
            }
            final Transaction tx = this.jedis.multi();
            tx.lpop(from);
            tx.lpush(to, val);
            if (tx.exec() != null) {
                result = val;
                break;
            }
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.