Examples of syncAndReturnAll()


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

    @Test
    public void pipeline() throws UnsupportedEncodingException {
  Pipeline p = jedis.pipelined();
  p.set("foo", "bar");
  p.get("foo");
  List<Object> results = p.syncAndReturnAll();

  assertEquals(2, results.size());
  assertEquals("OK", results.get(0));
  assertEquals("bar", results.get(1));
View Full Code Here

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

  Pipeline p = jedis.pipelined();
  p.multi();
  Response<Long> r1 = p.hincrBy("a", "f1", -1);
  Response<Long> r2 = p.hincrBy("a", "f1", -2);
  Response<List<Object>> r3 = p.exec();
  List<Object> result = p.syncAndReturnAll();

  assertEquals(new Long(-1), r1.get());
  assertEquals(new Long(-3), r2.get());

  assertEquals(4, result.size());
View Full Code Here

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

    boolean broken = false;
    try {
      jedis = jedisPool.getResource();
      Pipeline pipeline = jedis.pipelined();
      pipelineAction.action(pipeline);
      return pipeline.syncAndReturnAll();
    } catch (JedisException e) {
      broken = handleJedisException(e);
      throw e;
    } finally {
      closeResource(jedis, broken);
View Full Code Here

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

            start = tuple.getScore();
            pipeline.zrevrangeWithScores(
                "profile:" + uid, 0, HOME_TIMELINE_SIZE - 1);
        }

        List<Object> response = pipeline.syncAndReturnAll();
        List<Tuple> messages = new ArrayList<Tuple>();
        for (Object results : response) {
            messages.addAll((Set<Tuple>)results);
        }
View Full Code Here

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

            int offset = position * 2;

            pipe.substr("location:" + shardId, offset, offset + 1);

            if ((i + 1) % 1000 == 0) {
                updateAggregates(countries, states, pipe.syncAndReturnAll());
            }
        }

        updateAggregates(countries, states, pipe.syncAndReturnAll());

View Full Code Here

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

            if ((i + 1) % 1000 == 0) {
                updateAggregates(countries, states, pipe.syncAndReturnAll());
            }
        }

        updateAggregates(countries, states, pipe.syncAndReturnAll());

        return new Pair<Map<String,Long>,Map<String,Map<String,Long>>>(countries, states);
    }

    public void updateAggregates(
View Full Code Here

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

    @Test
    public void pipeline() throws UnsupportedEncodingException {
  ShardedJedisPipeline p = jedis.pipelined();
  p.set("foo", "bar");
  p.get("foo");
  List<Object> results = p.syncAndReturnAll();

  assertEquals(2, results.size());
  assertEquals("OK", results.get(0));
  assertEquals("bar", results.get(1));
    }
View Full Code Here

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

  jedis.resetState();

  pipeline = jedis.pipelined();
  pipeline.incr("pipelined");
  pipeline.incr("pipelined2");
  List<Object> results = pipeline.syncAndReturnAll();

  assertEquals(2, results.size());
  pool.returnResource(jedis);
  pool.destroy();
    }
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.