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

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

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

JedisCluster.pexpire介绍

暂无

代码示例

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

@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);
  }
}

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

public Long pexpire(byte[] key, int milliseconds) {
  return jedisCluster.pexpire(key, milliseconds);
}

代码示例来源:origin: hhfcyong/xxxx-dubbo

/**
 * 为给定 key 设置生存时间,当 key 过期时(生存时间为 0 ),它会被自动删除
 * 可以对一个已经带有生存时间的 key 执行 EXPIRE 命令,新指定的生存时间会取代旧的生存时间
 * @param key
 * @param seconds 毫秒
 * @return 成功:返回1  失败:返回0
 */
public long pexpire(String key,long milliseconds){
  return jedisCluster.pexpire(key, milliseconds);
}
/**

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

@Override
public Long pexpire(String s, long l) {
  return cluster.pexpire(s, l);
}

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

@Override
public Long pexpire(byte[] bytes, long l) {
  return cluster.pexpire(bytes, l);
}

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

public Long pexpire(String key, long milliseconds) {
  return jedisCluster.pexpire(key, milliseconds);
}

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

public Long pexpire(byte[] key, long milliseconds) {
  return jedisCluster.pexpire(key, milliseconds);
}

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

public Long pexpire(String key, int milliseconds) {
  return jedisCluster.pexpire(key, milliseconds);
}

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

/**
 * 这个命令和 EXPIRE 命令的作用类似,但是它以毫秒为单位设置 key 的生存时间,而不像 EXPIRE 命令那样,以秒为单位。
 */
public Long pexpire(Object key, long milliseconds) {
  return jedisCluster.pexpire(keyToBytes(key), milliseconds);
}

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

@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);
  }
}

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

@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);
  }
}

代码示例来源:origin: Nepxion/Thunder

@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;
  }
});

相关文章

微信公众号

最新文章

更多

JedisCluster类方法