extracted interfaces from Jedis
This commit is contained in:
@@ -13,7 +13,7 @@ import redis.clients.jedis.BinaryClient.LIST_POSITION;
|
||||
import redis.clients.util.SafeEncoder;
|
||||
import redis.clients.util.Slowlog;
|
||||
|
||||
public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
public class Jedis extends BinaryJedis implements JedisCommands, MultiKeyCommands, JedisBasicCommands {
|
||||
public Jedis(final String host) {
|
||||
super(host);
|
||||
}
|
||||
@@ -114,6 +114,11 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
|
||||
public Long del(String key) {
|
||||
client.del(key);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the type of the value stored at key in form of a string. The type
|
||||
* can be one of "none", "string", "list", "set". "none" is returned if the
|
||||
@@ -1817,6 +1822,42 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
return multiBulkReply;
|
||||
}
|
||||
|
||||
public List<String> blpop(String... args) {
|
||||
client.blpop(args);
|
||||
client.setTimeoutInfinite();
|
||||
final List<String> multiBulkReply = client.getMultiBulkReply();
|
||||
client.rollbackTimeout();
|
||||
return multiBulkReply;
|
||||
}
|
||||
|
||||
public List<String> brpop(String... args) {
|
||||
client.brpop(args);
|
||||
client.setTimeoutInfinite();
|
||||
final List<String> multiBulkReply = client.getMultiBulkReply();
|
||||
client.rollbackTimeout();
|
||||
return multiBulkReply;
|
||||
}
|
||||
|
||||
public List<String> blpop(String arg) {
|
||||
String[] args = new String[1];
|
||||
args[0] = arg;
|
||||
client.blpop(args);
|
||||
client.setTimeoutInfinite();
|
||||
final List<String> multiBulkReply = client.getMultiBulkReply();
|
||||
client.rollbackTimeout();
|
||||
return multiBulkReply;
|
||||
}
|
||||
|
||||
public List<String> brpop(String arg) {
|
||||
String[] args = new String[1];
|
||||
args[0] = arg;
|
||||
client.brpop(args);
|
||||
client.setTimeoutInfinite();
|
||||
final List<String> multiBulkReply = client.getMultiBulkReply();
|
||||
client.rollbackTimeout();
|
||||
return multiBulkReply;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort a Set or a List accordingly to the specified parameters and store
|
||||
* the result at dstkey.
|
||||
|
||||
Reference in New Issue
Block a user