new - pexpire, pexpireat and pttl command

This commit is contained in:
mindwind
2013-06-29 15:13:21 +08:00
parent 8b3ea5f2de
commit e7a88a49e9
6 changed files with 130 additions and 32 deletions

View File

@@ -3003,14 +3003,32 @@ public class Jedis extends BinaryJedis implements JedisCommands, MultiKeyCommand
}
public byte[] dump(final String key) {
checkIsInMulti();
client.dump(key);
return client.getBinaryBulkReply();
checkIsInMulti();
client.dump(key);
return client.getBinaryBulkReply();
}
public String restore(final String key, final int ttl, final byte[] serializedValue) {
checkIsInMulti();
client.restore(key, ttl, serializedValue);
return client.getStatusCodeReply();
checkIsInMulti();
client.restore(key, ttl, serializedValue);
return client.getStatusCodeReply();
}
public Long pexpire(final String key, final int milliseconds) {
checkIsInMulti();
client.pexpire(key, milliseconds);
return client.getIntegerReply();
}
public Long pexpireAt(final String key, final long millisecondsTimestamp) {
checkIsInMulti();
client.pexpireAt(key, millisecondsTimestamp);
return client.getIntegerReply();
}
public Long pttl(final String key) {
checkIsInMulti();
client.pttl(key);
return client.getIntegerReply();
}
}