fixed up some missing pipelined methods

This commit is contained in:
samhendley
2012-12-26 11:58:48 -05:00
parent 5bde3da7f2
commit 7b7c6c9602
6 changed files with 25 additions and 11 deletions

View File

@@ -85,6 +85,8 @@ public interface BinaryRedisPipeline {
Response<String> ltrim(byte[] key, long start, long end);
Response<Long> move(byte[] key, int dbIndex);
Response<Long> persist(byte[] key);
Response<byte[]> rpop(byte[] key);

View File

@@ -30,10 +30,11 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
super(shards, algo, keyTagPattern);
}
public void disconnect() throws IOException {
for (Jedis jedis : getAllShards()) {
jedis.disconnect();
}
public void disconnect() {
for (Jedis jedis : getAllShards()) {
jedis.quit();
jedis.disconnect();
}
}
protected Jedis create(JedisShardInfo shard) {

View File

@@ -60,4 +60,6 @@ public interface MultiKeyBinaryRedisPipeline {
Response<byte[]> brpoplpush(byte[] source, byte[] destination, int timeout);
Response<Long> publish(byte[] channel, byte[] message);
Response<byte[]> randomKeyBinary();
}

View File

@@ -88,6 +88,8 @@ public interface RedisPipeline {
Response<String> ltrim(String key, long start, long end);
Response<Long> move(String key, int dbIndex);
Response<Long> persist(String key);
Response<String> rpop(String key);

View File

@@ -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);

View File

@@ -91,6 +91,20 @@ public class ShardedJedisPipeline extends Queable implements BinaryRedisPipeline
return getResponse(BuilderFactory.STRING_LIST);
}
public Response<Long> move(byte[] key, int dbIndex) {
Client c = getClient(key);
c.move(key, dbIndex);
results.add(new FutureResult(c));
return getResponse(BuilderFactory.LONG);
}
public Response<Long> move(String key, int dbIndex) {
Client c = getClient(key);
c.move(key, dbIndex);
results.add(new FutureResult(c));
return getResponse(BuilderFactory.LONG);
}
public Response<byte[]> echo(byte[] string) {
Client c = getClient(string);
c.echo(string);