Skip to content

Commit

Permalink
Deprecate and per #909
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosnils authored and HeartSaVioR committed Mar 10, 2015
1 parent 4c5d171 commit acde13c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/main/java/redis/clients/jedis/BinaryJedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,20 +337,22 @@ 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>
* Voltile keys are stored on disk like the other keys, the timeout is persistent too like all the
* other aspects of the dataset. Saving a dataset containing expires and stopping the server does
* not stop the flow of time as Redis stores on disk the time when the key will no longer be
* available as Unix time, and not the remaining milliseconds.
* <p>
* Since Redis 2.1.3 you can update the value of the timeout of a key already having an expire
* set. It is also possible to undo the expire at all turning the key into a normal key using the
* {@link #persist(byte[]) PERSIST} command.
* <p>
* Time complexity: O(1)
* @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>
* Voltile keys are stored on disk like the other keys, the timeout is persistent too
* like all the other aspects of the dataset. Saving a dataset containing expires and
* stopping the server does not stop the flow of time as Redis stores on disk the time
* when the key will no longer be available as Unix time, and not the remaining
* milliseconds.
* <p>
* Since Redis 2.1.3 you can update the value of the timeout of a key already having
* an expire set. It is also possible to undo the expire at all turning the key into a
* normal key using the {@link #persist(byte[]) PERSIST} command.
* <p>
* Time complexity: O(1)
* @see <ahref="http://redis.io/commands/pexpire">PEXPIRE Command</a>
* @param key
* @param milliseconds
Expand Down
1 change: 1 addition & 0 deletions src/main/java/redis/clients/jedis/BinaryShardedJedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ 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);
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/redis/clients/jedis/JedisPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,22 @@ public Jedis getResource() {
return jedis;
}

/**
* @deprecated starting from Jedis 3.0 this method won't exist. Resouce cleanup should be done
* using @see {@link redis.clients.jedis.Jedis#close()}
*/
@Deprecated
public void returnBrokenResource(final Jedis resource) {
if (resource != null) {
returnBrokenResourceObject(resource);
}
}

/**
* @deprecated starting from Jedis 3.0 this method won't exist. Resouce cleanup should be done
* using @see {@link redis.clients.jedis.Jedis#close()}
*/
@Deprecated
public void returnResource(final Jedis resource) {
if (resource != null) {
try {
Expand Down

0 comments on commit acde13c

Please sign in to comment.