Examples of hincrBy()


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

  @Override
  public Long hincrBy(String key, String field, long value) throws Exception {
    Jedis jedis = _jedisPool.getResource();
    try {
      return jedis.hincrBy(key, field, value);
    } finally {
      _jedisPool.returnResource(jedis);
    }
  }
View Full Code Here

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

  @Override
  public Long hincrBy(String key, String field, long value) throws Exception {
    Jedis jedis = _jedisPool.getResource();
    try {
      return jedis.hincrBy(key, field, value);
    } finally {
      _jedisPool.returnResource(jedis);
    }
  }
View Full Code Here

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

   * @param vote    the answer number of the answer to be increased
   */
  public void recordRadioVote(String vote) {
    Jedis jedis = dbConnect();
   
    jedis.hincrBy(pollKey, "totalVotes", 1);
    jedis.hincrBy(pollKey, "answer"+vote, 1);
   
    pollsVoted.add(curWebKey);
  }
 
View Full Code Here

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

   */
  public void recordRadioVote(String vote) {
    Jedis jedis = dbConnect();
   
    jedis.hincrBy(pollKey, "totalVotes", 1);
    jedis.hincrBy(pollKey, "answer"+vote, 1);
   
    pollsVoted.add(curWebKey);
  }
 
  /**
 
View Full Code Here

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

   * @param votes    the answer numbers to be increased
   */
  public void recordCheckVote(String [] votes) {
    Jedis jedis = dbConnect();
   
    jedis.hincrBy(pollKey, "totalVotes", 1);
   
    for (int i=0; i<votes.length; i++) {
      jedis.hincrBy(pollKey, "answer"+votes[i], 1);
    }
   
View Full Code Here

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

    Jedis jedis = dbConnect();
   
    jedis.hincrBy(pollKey, "totalVotes", 1);
   
    for (int i=0; i<votes.length; i++) {
      jedis.hincrBy(pollKey, "answer"+votes[i], 1);
    }
   
    pollsVoted.add(curWebKey);
  }
 
View Full Code Here

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

    @Test
    public void multi() {
  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());
View Full Code Here

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

    @Test
    public void multi() {
  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());
View Full Code Here

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

            p.watch(keys.COUNTS_KEY, keys.BITS_KEY);

            List<Long> counts;
            List<Response<Long>> responses = new ArrayList<>(config().hashes());
            for (String position : hashesString) {
                responses.add(p.hincrBy(keys.COUNTS_KEY, position, -1));
            }
            p.sync();
            counts = responses.stream().map(Response::get).collect(Collectors.toList());

            while (true) {
View Full Code Here

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

            p.watch(keys.COUNTS_KEY, keys.BITS_KEY);

            List<Long> counts;
            List<Response<Long>> responses = new ArrayList<>(config().hashes());
            for (String position : hashesString) {
                responses.add(p.hincrBy(keys.COUNTS_KEY, position, -1));
            }
            p.sync();
            counts = responses.stream().map(Response::get).collect(Collectors.toList());

            while (true) {
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.