Add persist to ShardedJedis
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
package redis.clients.jedis;
|
||||
|
||||
import redis.clients.jedis.BinaryClient.LIST_POSITION;
|
||||
import redis.clients.util.Hashing;
|
||||
import redis.clients.util.Sharded;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
@@ -7,10 +11,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import redis.clients.jedis.BinaryClient.LIST_POSITION;
|
||||
import redis.clients.util.Hashing;
|
||||
import redis.clients.util.Sharded;
|
||||
|
||||
public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
implements BinaryJedisCommands {
|
||||
public BinaryShardedJedis(List<JedisShardInfo> shards) {
|
||||
@@ -199,7 +199,11 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
Jedis j = getShard(key);
|
||||
return j.lpushx(key, string);
|
||||
}
|
||||
|
||||
|
||||
public Long persist(final byte[] key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.persist(key);
|
||||
}
|
||||
|
||||
public Long rpushx(byte[] key, byte[] string) {
|
||||
Jedis j = getShard(key);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package redis.clients.jedis;
|
||||
|
||||
import redis.clients.jedis.BinaryClient.LIST_POSITION;
|
||||
import redis.clients.util.Hashing;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import redis.clients.jedis.BinaryClient.LIST_POSITION;
|
||||
import redis.clients.util.Hashing;
|
||||
|
||||
public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
public ShardedJedis(List<JedisShardInfo> shards) {
|
||||
super(shards);
|
||||
@@ -218,6 +218,11 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.rpushx(key, string);
|
||||
}
|
||||
|
||||
public Long persist(final String key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.persist(key);
|
||||
}
|
||||
|
||||
public Long llen(String key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.llen(key);
|
||||
|
||||
Reference in New Issue
Block a user