@Override public Long incr(final String key) { return jedisCluster.incr(key); }
@Override public Long incr(final String key) { return jedisCluster.incr(key); }
@Override public Long incr(final String key) { return jedisCluster.incr(key); }
@Override public Long incr(byte[] key) { Assert.notNull(key, "Key must not be null!"); try { return connection.getCluster().incr(key); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
/** * 将 key 中储存的数字值增一。 * * 如果 key 不存在,那么 key 的值会先被初始化为 0 ,然后再执行 INCR 操作。 * @param key * @return */ public Long incr(String key) { return jedisCluster.incr(key); }
@Override public Long incr(String key) { return jedisCluster.incr(key); }
/** * 将 key 中储存的数字值增一 * 如果 key 不存在,那么 key 的值会先被初始化为 0 ,然后再执行 INCR 操作 * 如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误 * @param key * @return 执行 INCR 命令之后 key 的值 */ public Long incr(String key){ return jedisCluster.incr(key); } /**
public Long incr(String key) { return jedisCluster.incr(key); }
@Override public Long incr(byte[] bytes) { return cluster.incr(bytes); }
public Long incr(byte[] key) { return jedisCluster.incr(key); }
/** * 将 key 中储存的数字值增一。 * 如果 key 不存在,那么 key 的值会先被初始化为 0 ,然后再执行 INCR 操作。 * 如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。 * 本操作的值限制在 64 位(bit)有符号数字表示之内。 */ public Long incr(Object key) { return jedisCluster.incr(keyToBytes(key)); }
@Override public long incr(final String key) { Assert.hasText(key); try { final Long val = cluster.incr(key); if (val == null) { return 0; } return val.longValue(); } catch (final Throwable e) { throw new RedisClientException(e.getMessage(), e); } }
@Override public Long incr(byte[] key) { Assert.notNull(key, "Key must not be null!"); try { return connection.getCluster().incr(key); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public Long incr(byte[] key) { Assert.notNull(key, "Key must not be null!"); try { return connection.getCluster().incr(key); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
/** * 将 key 中储存的数字值 +1 * 如果 key 不存在,那么 key 的值会先被初始化为 0 ,然后再执行 INCR 操作。 * 如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。 * 返回值:执行 INCR 命令之后 key 的值。 */ public Long incr(Object key) { if (null == key) { return null; } if (cluster) { return jedisCluster.incr(serializeKey(key)); } else { return jedisOperator.incr(serializeKey(key)); } }