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

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

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

Jedis.pexpire介绍

暂无

代码示例

代码示例来源:origin: sohutv/cachecloud

@Override
 public Long execute(Jedis connection) {
  return connection.pexpire(key, milliseconds);
 }
}.run(key);

代码示例来源:origin: sohutv/cachecloud

@Override
 public Long execute(Jedis connection) {
  return connection.pexpire(key, milliseconds);
 }
}.runBinary(key);

代码示例来源:origin: sohutv/cachecloud

@Override
 public Long execute(Jedis connection) {
  return connection.pexpire(key, millisecondsTimestamp);
 }
}.runBinary(key);

代码示例来源:origin: sohutv/cachecloud

@Override
public Long pexpire(final String key, final long milliseconds) {
 Jedis j = getShard(key);
 return j.pexpire(key, milliseconds);
}

代码示例来源:origin: sohutv/cachecloud

@Override
public Long pexpire(byte[] key, final long milliseconds) {
 Jedis j = getShard(key);
 return j.pexpire(key, milliseconds);
}

代码示例来源:origin: apache/ignite

@Override public long expire(Jedis jedis, String key) {
    return jedis.pexpire("k1", 2000);
  }
});

代码示例来源:origin: wuyouzhuguli/FEBS-Shiro

@Override
  public Long pexpire(String key, Long milliseconds) {
    return (Long) this.excuteByJedis(j -> j.pexpire(key, milliseconds));
  }
}

代码示例来源:origin: Netflix/conductor

@Override
public Long pexpire(String key, long milliseconds) {
 Jedis jedis = null;
 try {
  jedis = jedisPool.getResource();
  return jedis.pexpire(key, milliseconds);
 } finally {
  if (jedis != null)
   jedis.close();
 }
}

代码示例来源:origin: jfinal/jfinal

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

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

@Override
public Boolean pExpire(byte[] key, long millis) {
  Assert.notNull(key, "Key must not be null!");
  try {
    if (isPipelined()) {
      pipeline(connection.newJedisResult(connection.getRequiredPipeline().pexpire(key, millis),
          JedisConverters.longToBoolean()));
      return null;
    }
    if (isQueueing()) {
      transaction(connection.newJedisResult(connection.getRequiredTransaction().pexpire(key, millis),
          JedisConverters.longToBoolean()));
      return null;
    }
    return JedisConverters.toBoolean(connection.getJedis().pexpire(key, millis));
  } catch (Exception ex) {
    throw connection.convertJedisAccessException(ex);
  }
}

代码示例来源:origin: jwpttcg66/NettyGameServer

/**
 * 设置
 * @param key
 * @param value
 * @return
 */
public boolean setNxStringByMillisec(String key, String value, int millisec){
  Jedis jedis = null;
  boolean success = true;
  boolean result = false;
  try {
    jedis = jedisPool.getResource();
    result = (jedis.setnx(key, value) != 0);
    if(millisec > -1){
      jedis.pexpire(key, millisec);
    }
  } catch (Exception e) {
    success = false;
    releasBrokenReidsSource(jedis, key, "setNxStringByMillisec", e, false);
  } finally {
    releaseReidsSource(success, jedis);
  }
  
  return result;
  
}

代码示例来源:origin: io.leopard/leopard-redis

@SuppressWarnings("deprecation")
@Override
public Long pexpire(String key, int milliseconds) {
  return jedis.pexpire(key, milliseconds);
}

代码示例来源:origin: io.leopard/leopard-redis

@SuppressWarnings("deprecation")
@Override
public Long pexpire(String key, int milliseconds) {
  return jedis.pexpire(key, milliseconds);
}

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

@Override
 public Long execute(Jedis connection) {
  return connection.pexpire(key, milliseconds);
 }
}.run(key);

代码示例来源:origin: com.netflix.spinnaker.kork/kork-jedis

@Override
@Deprecated
public Long pexpire(byte[] key, int milliseconds) {
 String command = "pexpire";
 return instrumented(command, () -> delegated.pexpire(key, milliseconds));
}

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

@Override
public Long pexpire(final String key, final long milliseconds) {
 Jedis j = getShard(key);
 return j.pexpire(key, milliseconds);
}

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

@Override
public Long pexpire(final byte[] key, final long milliseconds) {
 Jedis j = getShard(key);
 return j.pexpire(key, milliseconds);
}

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

public Long pexpire(byte[] key, long milliseconds) {
  Jedis jedis = getJedis();
  try {
    return jedis.pexpire(key, milliseconds);
  } finally {Streams.safeClose(jedis);}
}

代码示例来源:origin: com.netflix.conductor/conductor-redis-persistence

@Override
public Long pexpire(String key, long milliseconds) {
 Jedis jedis = null;
 try {
  jedis = jedisPool.getResource();
  return jedis.pexpire(key, milliseconds);
 } finally {
  if (jedis != null)
   jedis.close();
 }
}

代码示例来源:origin: com.github.sogyf/goja-jfinal

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

相关文章

Jedis类方法