Skip to content

Commit

Permalink
Deprecate and per #909
Browse files Browse the repository at this point in the history
Conflicts:
	src/main/java/redis/clients/jedis/BinaryJedis.java
	src/main/java/redis/clients/jedis/BinaryShardedJedis.java
  • Loading branch information
marcosnils authored and HeartSaVioR committed Mar 10, 2015
1 parent 70908d9 commit a26ad40
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 14 deletions.
29 changes: 16 additions & 13 deletions src/main/java/redis/clients/jedis/BinaryJedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -315,19 +315,22 @@ public Long expire(final byte[] key, final int seconds) {
}

/**
* 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
8 changes: 7 additions & 1 deletion src/main/java/redis/clients/jedis/BinaryShardedJedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ 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 @@ -634,4 +640,4 @@ public long pfcount(final byte[] key) {
return j.pfcount(key);
}

}
}
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 @@ -84,12 +84,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 a26ad40

Please sign in to comment.