Skip to content

Commit

Permalink
Merge branch 'taer-binaryPexpireFix'
Browse files Browse the repository at this point in the history
  • Loading branch information
HeartSaVioR committed Feb 22, 2015
2 parents 1a47714 + f418a5a commit 00eefa4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/java/redis/clients/jedis/BinaryJedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ public Long expire(final byte[] key, final int seconds) {
}

/**
* @deprecated use BinaryJedis.pexpire(byte[], long) or Jedis.pexpire(String,long)
* Set a timeout on the specified key. After the timeout the key will be automatically deleted by
* the server. A key with an associated timeout is said to be volatile in Redis terminology.
* <p>
Expand All @@ -357,6 +358,7 @@ public Long expire(final byte[] key, final int seconds) {
* the key already has an associated timeout (this may happen only in Redis versions <
* 2.1.3, Redis >= 2.1.3 will happily update the timeout), or the key does not exist.
*/
@Deprecated
public Long pexpire(String key, final long milliseconds) {
checkIsInMulti();
client.pexpire(key, milliseconds);
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/redis/clients/jedis/BinaryJedisCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ public interface BinaryJedisCommands {

Long expire(byte[] key, int seconds);

/**
* @deprecated String key operation on BinaryCommand. Use byte[] or JedisCommands
*/
@Deprecated
Long pexpire(final String key, final long milliseconds);

Long pexpire(byte[] key, final long milliseconds);

Long expireAt(byte[] key, long unixTime);

Long pexpireAt(byte[] key, long millisecondsTimestamp);
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/redis/clients/jedis/BinaryShardedJedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ public Long expire(byte[] key, int seconds) {
return j.expire(key, seconds);
}

public Long pexpire(byte[] key, final long milliseconds) {
Jedis j = getShard(key);
return j.pexpire(key, milliseconds);
}
@Deprecated
public Long pexpire(String key, final long milliseconds) {
Jedis j = getShard(key);
return j.pexpire(key, milliseconds);
Expand Down Expand Up @@ -638,4 +643,4 @@ public long pfcount(final byte[] key) {
return j.pfcount(key);
}

}
}

0 comments on commit 00eefa4

Please sign in to comment.