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