redis.clients.jedis.Pipeline.hincrBy()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(275)

本文整理了Java中redis.clients.jedis.Pipeline.hincrBy()方法的一些代码示例,展示了Pipeline.hincrBy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Pipeline.hincrBy()方法的具体详情如下:
包路径:redis.clients.jedis.Pipeline
类名称:Pipeline
方法名:hincrBy

Pipeline.hincrBy介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public Long hIncrBy(byte[] key, byte[] field, long delta) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(field, "Field must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().hincrBy(key, field, delta)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().hincrBy(key, field, delta)));
      return null;
    }
    return connection.getJedis().hincrBy(key, field, delta);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: com.netflix.dyno/dyno-jedis

@Override
  Response<Long> execute(Pipeline jedisPipeline) throws DynoException {
    return jedisPipeline.hincrBy(key, field, value);
  }
}.execute(key, OpName.HINCRBY);

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public Response<Long> hincrBy(String key, String field, long value) {
 String command = "hincrBy";
 return instrumented(command, () -> delegated.hincrBy(key, field, value));
}

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
public Response<Long> hincrBy(byte[] key, byte[] field, long value) {
 String command = "hincrBy";
 return instrumented(command, () -> delegated.hincrBy(key, field, value));
}

代码示例来源:origin: com.github.yamingd.argo/argo-redis

public Long execute(final Jedis conn) throws Exception {
    Pipeline pipe = conn.pipelined();
    byte[] bk = SafeEncoder.encode(key);
    for(String field : nums.keySet()){
      pipe.hincrBy(bk, SafeEncoder.encode(field), nums.get(field));
    }
    pipe.exec();
    return 1L;
  }
});

代码示例来源:origin: com.github.yamingd.argo/argo-redis

public Long execute(final Jedis conn) throws Exception {
    byte[] bk = SafeEncoder.encode(key);
    Pipeline pipe = conn.pipelined();
    for(String field : nums.keySet()){
      pipe.hincrBy(bk, SafeEncoder.encode(field), -1 * nums.get(field));
    }
    pipe.exec();
    return 1L;
  }
});

代码示例来源:origin: Baqend/Orestes-Bloomfilter

p.hincrBy(keys.COUNTS_KEY.getBytes(), RedisUtils.encodeKey(position), 1);

代码示例来源:origin: Baqend/Orestes-Bloomfilter

@Override
public long addAndEstimateCountRaw(byte[] element) {
  List<Object> results = pool.transactionallyRetry(p -> {
    int[] hashes = hash(element);
    for (int position : hashes) {
      bloom.set(p, position, true);
    }
    for (int position : hashes) {
      p.hincrBy(keys.COUNTS_KEY.getBytes(), RedisUtils.encodeKey(position), 1);
    }
  }, keys.BITS_KEY, keys.COUNTS_KEY);
  return results.stream().skip(config().hashes()).mapToLong(i -> (long) i).min().orElse(0L);
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public Long hIncrBy(byte[] key, byte[] field, long delta) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(field, "Field must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().hincrBy(key, field, delta)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().hincrBy(key, field, delta)));
      return null;
    }
    return connection.getJedis().hincrBy(key, field, delta);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: org.springframework.data/spring-data-redis

@Override
public Long hIncrBy(byte[] key, byte[] field, long delta) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(field, "Field must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().hincrBy(key, field, delta)));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().hincrBy(key, field, delta)));
      return null;
    }
    return connection.getJedis().hincrBy(key, field, delta);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

相关文章

Pipeline类方法