merging with master branch. Required refactoring of Pipeline code.
This commit is contained in:
@@ -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);
|
||||
@@ -26,13 +26,6 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
super(shards, algo, keyTagPattern);
|
||||
}
|
||||
|
||||
public void disconnect() {
|
||||
for (Jedis jedis : getAllShards()) {
|
||||
jedis.quit();
|
||||
jedis.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
public String set(String key, String value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.set(key, value);
|
||||
@@ -43,6 +36,11 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.get(key);
|
||||
}
|
||||
|
||||
public String echo(String string) {
|
||||
Jedis j = getShard(string);
|
||||
return j.echo(string);
|
||||
}
|
||||
|
||||
public Boolean exists(String key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.exists(key);
|
||||
@@ -73,6 +71,11 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.setbit(key, offset, value);
|
||||
}
|
||||
|
||||
public Boolean setbit(String key, long offset, String value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.setbit(key, offset, value);
|
||||
}
|
||||
|
||||
public Boolean getbit(String key, long offset) {
|
||||
Jedis j = getShard(key);
|
||||
return j.getbit(key, offset);
|
||||
@@ -103,6 +106,16 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.setex(key, seconds, value);
|
||||
}
|
||||
|
||||
public List<String> blpop(String arg) {
|
||||
Jedis j = getShard(arg);
|
||||
return j.blpop(arg);
|
||||
}
|
||||
|
||||
public List<String> brpop(String arg) {
|
||||
Jedis j = getShard(arg);
|
||||
return j.brpop(arg);
|
||||
}
|
||||
|
||||
public Long decrBy(String key, long integer) {
|
||||
Jedis j = getShard(key);
|
||||
return j.decrBy(key, integer);
|
||||
@@ -218,16 +231,31 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.lpush(key, strings);
|
||||
}
|
||||
|
||||
public Long lpushx(String key, String string) {
|
||||
public Long lpushx(String key, String... string) {
|
||||
Jedis j = getShard(key);
|
||||
return j.lpushx(key, string);
|
||||
}
|
||||
|
||||
public Long rpushx(String key, String string) {
|
||||
public Long strlen(final String key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.strlen(key);
|
||||
}
|
||||
|
||||
public Long move(String key, int dbIndex) {
|
||||
Jedis j = getShard(key);
|
||||
return j.move(key, dbIndex);
|
||||
}
|
||||
|
||||
public Long rpushx(String key, String... string) {
|
||||
Jedis j = getShard(key);
|
||||
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);
|
||||
@@ -493,4 +521,16 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
Jedis j = getShard(key);
|
||||
return j.linsert(key, where, pivot, value);
|
||||
}
|
||||
|
||||
public Long bitcount(final String key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.bitcount(key);
|
||||
}
|
||||
|
||||
public Long bitcount(final String key, long start, long end) {
|
||||
Jedis j = getShard(key);
|
||||
return j.bitcount(key, start, end);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user