@Override public Long hset(final String key, final String item, final String value) { return jedisCluster.hset(key, item, value); }
@Override public Long hset(final String key, final String item, final String value) { return jedisCluster.hset(key, item, value); }
@Override public void hset(byte[] key, byte[] field, byte[] value) { jedisCluster.hset(key, field, value); }
@Override public Long hset(final String key, final String item, final String value) { return jedisCluster.hset(key, item, value); }
@Override public Boolean hSet(byte[] key, byte[] field, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(field, "Field must not be null!"); Assert.notNull(value, "Value must not be null!"); try { return JedisConverters.toBoolean(connection.getCluster().hset(key, field, value)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
jedisCluster.hset(additionalKey, key, value); break; default:
/** * 将哈希表 key 中的域 field 的值设为 value * 如果 key 不存在,一个新的哈希表被创建并进行 HSET 操作 * 如果域 field 已经存在于哈希表中,旧值将被覆盖 * @param key * @param field * @param value * @return 如果 field 是哈希表中的一个新建域,并且值设置成功,返回 1,如果哈希表中域 field 已经存在且旧值已被新值覆盖,返回 0 */ public Long hset(String key,String field,String value){ return jedisCluster.hset(key, field, value); } /**
@Override public Long hset(String key, String item, String value) { return jedisCluster.hset(key, item, value); }
@Override public void hset(final String key, final String hashField, final String value) { try { jedisCluster.hset(key, hashField, value); } catch (Exception e) { if (LOG.isErrorEnabled()) { LOG.error("Cannot send Redis message with command HSET to hash {} error message {}", key, hashField, e.getMessage()); } throw e; } }
@Override public void hset(final String key, final String hashField, final String value) { try { jedisCluster.hset(key, hashField, value); } catch (Exception e) { if (LOG.isErrorEnabled()) { LOG.error("Cannot send Redis message with command HSET to hash {} error message {}", key, hashField, e.getMessage()); } throw e; } }
public long hset(String key, String field, String value) { try { return cluster.hset(key, field, value); } catch (JedisException e) { LoggerUtils.error("", e); } return -1L; }
public void hsetForUpdate(String key, String field, String value) { long flag=jedisCluster.hset(key, field, value); if(flag==1L){ jedisCluster.hdel(key, field); } }
public void hsetForInsert(String key, String field, String value) { long flag=jedisCluster.hset(key, field, value); if(flag==0L){ jedisCluster.hdel(key, field); } }
@Override public Boolean hSet(byte[] key, byte[] field, byte[] value) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(field, "Field must not be null!"); Assert.notNull(value, "Value must not be null!"); try { return JedisConverters.toBoolean(connection.getCluster().hset(key, field, value)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
/** * 存储map对象 * @author JiangZhiYong * @QQ 359135103 * 2017年10月24日 上午10:13:21 * @param key * @param field * @param value * @return */ public Long hset(final String key, final Object field, final Object value) { return getJedisCluster().hset(key, field.toString(), JsonUtil.toJSONStringWriteClassNameWithFiled(value)); }
@Override public long hset(String key, Map<String, Integer> nums) { byte[] bk = SafeEncoder.encode(key); for(String field : nums.keySet()){ jedisCluster.hset(bk, SafeEncoder.encode(field), SafeEncoder.encode(String.valueOf(nums.get(field)))); } return 1L; }
public void saveToRedis(long roleId) { String key = HallKey.Role_Map_Packet.getKey(roleId); JedisManager.getJedisCluster().hset(key, String.valueOf(id), JsonUtil.toJSONString(this)); } }
public void saveToRedis(){ JedisManager.getJedisCluster().hset(BydrKey.Team_Map.getKey(), String.valueOf(id), JsonUtil.toJSONString(this)); } }
/** * 将哈希表 key 中的域 field 的值设为 value 。 * 如果 key 不存在,一个新的哈希表被创建并进行 HSET 操作。 * 如果域 field 已经存在于哈希表中,旧值将被覆盖。 */ public Long hset(Object key, Object field, Object value) { return jedisCluster.hset(keyToBytes(key), valueToBytes(field), valueToBytes(value)); }
@Override public boolean hset(final String key, final String field, final String value) { Assert.hasText(key); Assert.hasText(field); Assert.hasText(value); try { return isSuccess(cluster.hset(key, field, value)); } catch (final Throwable e) { throw new RedisClientException(e.getMessage(), e); } }