@Override public Boolean pExpire(byte[] key, long millis) { Assert.notNull(key, "Key must not be null!"); try { return JedisConverters.toBoolean(connection.getCluster().pexpire(key, millis)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
public Long pexpire(byte[] key, int milliseconds) { return jedisCluster.pexpire(key, milliseconds); }
/** * 为给定 key 设置生存时间,当 key 过期时(生存时间为 0 ),它会被自动删除 * 可以对一个已经带有生存时间的 key 执行 EXPIRE 命令,新指定的生存时间会取代旧的生存时间 * @param key * @param seconds 毫秒 * @return 成功:返回1 失败:返回0 */ public long pexpire(String key,long milliseconds){ return jedisCluster.pexpire(key, milliseconds); } /**
@Override public Long pexpire(String s, long l) { return cluster.pexpire(s, l); }
@Override public Long pexpire(byte[] bytes, long l) { return cluster.pexpire(bytes, l); }
public Long pexpire(String key, long milliseconds) { return jedisCluster.pexpire(key, milliseconds); }
public Long pexpire(byte[] key, long milliseconds) { return jedisCluster.pexpire(key, milliseconds); }
public Long pexpire(String key, int milliseconds) { return jedisCluster.pexpire(key, milliseconds); }
/** * 这个命令和 EXPIRE 命令的作用类似,但是它以毫秒为单位设置 key 的生存时间,而不像 EXPIRE 命令那样,以秒为单位。 */ public Long pexpire(Object key, long milliseconds) { return jedisCluster.pexpire(keyToBytes(key), milliseconds); }
@Override public Boolean pExpire(byte[] key, long millis) { Assert.notNull(key, "Key must not be null!"); try { return JedisConverters.toBoolean(connection.getCluster().pexpire(key, millis)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public Boolean pExpire(byte[] key, long millis) { Assert.notNull(key, "Key must not be null!"); try { return JedisConverters.toBoolean(connection.getCluster().pexpire(key, millis)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public Object call() throws Exception { try { cluster.hset(traceId, RandomUtil.uuidRandom(), SerializerExecutor.toJson(monitorStat)); cluster.pexpire(traceId, properties.getLong(ThunderConstant.REDIS_DATA_EXPIRATION_ATTRIBUTE_NAME)); } catch (Exception e) { LOG.error("Execute failed", e); } finally { if (cluster != null) { cluster.close(); } } return null; } });