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

x33g5p2x  于2022-01-21 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(176)

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

JedisCluster.hincrByFloat介绍

暂无

代码示例

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

@Override
public Double hIncrBy(byte[] key, byte[] field, double delta) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(field, "Field must not be null!");
  try {
    return connection.getCluster().hincrByFloat(key, field, delta);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: net.oschina.j2cache/j2cache-core

@Override
public Double hincrByFloat(byte[] bytes, byte[] bytes1, double v) {
  return cluster.hincrByFloat(bytes, bytes1, v);
}

代码示例来源:origin: org.nutz/nutz-integration-jedis

public Double hincrByFloat(String key, String field, double value) {
  return jedisCluster.hincrByFloat(key, field, value);
}

代码示例来源:origin: org.nutz/nutz-integration-jedis

public Double hincrByFloat(byte[] key, byte[] field, double value) {
  return jedisCluster.hincrByFloat(key, field, value);
}

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

@Override
public Double hIncrBy(byte[] key, byte[] field, double delta) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(field, "Field must not be null!");
  try {
    return connection.getCluster().hincrByFloat(key, field, delta);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

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

@Override
public Double hIncrBy(byte[] key, byte[] field, double delta) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(field, "Field must not be null!");
  try {
    return connection.getCluster().hincrByFloat(key, field, delta);
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: yangfuhai/jboot

/**
 * 为哈希表 key 中的域 field 加上浮点数增量 increment 。
 * 如果哈希表中没有域 field ,那么 HINCRBYFLOAT 会先将域 field 的值设为 0 ,然后再执行加法操作。
 * 如果键 key 不存在,那么 HINCRBYFLOAT 会先创建一个哈希表,再创建域 field ,最后再执行加法操作。
 * 当以下任意一个条件发生时,返回一个错误:
 * 1:域 field 的值不是字符串类型(因为 redis 中的数字和浮点数都以字符串的形式保存,所以它们都属于字符串类型)
 * 2:域 field 当前的值或给定的增量 increment 不能解释(parse)为双精度浮点数(double precision floating point number)
 * HINCRBYFLOAT 命令的详细功能和 INCRBYFLOAT 命令类似,请查看 INCRBYFLOAT 命令获取更多相关信息。
 */
public Double hincrByFloat(Object key, Object field, double value) {
  return jedisCluster.hincrByFloat(keyToBytes(key), valueToBytes(field), value);
}

代码示例来源:origin: org.nanoframework/nano-orm-jedis

@Override
public double hincrByFloat(final String key, final String field, final double value) {
  Assert.hasText(key);
  Assert.hasText(field);
  try {
    final Double val = cluster.hincrByFloat(key, field, value);
    if (val == null) {
      return 0;
    }
    return val.doubleValue();
  } catch (final Throwable e) {
    throw new RedisClientException(e.getMessage(), e);
  }
}

相关文章

微信公众号

最新文章

更多

JedisCluster类方法