|
|
|
|
@@ -10,7 +10,6 @@ import java.util.Map;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
import redis.clients.jedis.BinaryClient.LIST_POSITION;
|
|
|
|
|
import redis.clients.jedis.exceptions.JedisDataException;
|
|
|
|
|
|
|
|
|
|
public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
public Jedis(final String host) {
|
|
|
|
|
@@ -30,7 +29,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String ping() {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.ping();
|
|
|
|
|
return client.getStatusCodeReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -46,7 +45,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Status code reply
|
|
|
|
|
*/
|
|
|
|
|
public String set(final String key, String value) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.set(key, value);
|
|
|
|
|
return client.getStatusCodeReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -62,7 +61,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Bulk reply
|
|
|
|
|
*/
|
|
|
|
|
public String get(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.sendCommand(Protocol.Command.GET, key);
|
|
|
|
|
return client.getBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -72,7 +71,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public void quit() {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.quit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -87,7 +86,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Integer reply, "0" if the key exists, otherwise "1"
|
|
|
|
|
*/
|
|
|
|
|
public Boolean exists(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.exists(key);
|
|
|
|
|
return client.getIntegerReply() == 1;
|
|
|
|
|
}
|
|
|
|
|
@@ -103,7 +102,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* more keys were removed 0 if none of the specified key existed
|
|
|
|
|
*/
|
|
|
|
|
public Long del(final String... keys) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.del(keys);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -123,7 +122,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* contains a Hash value
|
|
|
|
|
*/
|
|
|
|
|
public String type(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.type(key);
|
|
|
|
|
return client.getStatusCodeReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -136,7 +135,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public String flushDB() {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.flushDB();
|
|
|
|
|
return client.getStatusCodeReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -173,7 +172,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Multi bulk reply
|
|
|
|
|
*/
|
|
|
|
|
public Set<String> keys(final String pattern) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.keys(pattern);
|
|
|
|
|
final HashSet<String> keySet = new HashSet<String>(client
|
|
|
|
|
.getMultiBulkReply());
|
|
|
|
|
@@ -189,7 +188,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* empty string is the database is empty
|
|
|
|
|
*/
|
|
|
|
|
public String randomKey() {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.randomKey();
|
|
|
|
|
return client.getBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -206,7 +205,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Status code repy
|
|
|
|
|
*/
|
|
|
|
|
public String rename(final String oldkey, final String newkey) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.rename(oldkey, newkey);
|
|
|
|
|
return client.getStatusCodeReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -223,7 +222,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* target key already exist
|
|
|
|
|
*/
|
|
|
|
|
public Long renamenx(final String oldkey, final String newkey) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.renamenx(oldkey, newkey);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -235,7 +234,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public Long dbSize() {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.dbSize();
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -269,7 +268,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* exist.
|
|
|
|
|
*/
|
|
|
|
|
public Long expire(final String key, final int seconds) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.expire(key, seconds);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -305,7 +304,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* exist.
|
|
|
|
|
*/
|
|
|
|
|
public Long expireAt(final String key, final long unixTime) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.expireAt(key, unixTime);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -322,7 +321,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* have an associated expire, -1 is returned.
|
|
|
|
|
*/
|
|
|
|
|
public Long ttl(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.ttl(key);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -336,7 +335,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public String select(final int index) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.select(index);
|
|
|
|
|
return client.getStatusCodeReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -355,7 +354,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* found in the current DB.
|
|
|
|
|
*/
|
|
|
|
|
public Long move(final String key, final int dbIndex) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.move(key, dbIndex);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -368,7 +367,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public String flushAll() {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.flushAll();
|
|
|
|
|
return client.getStatusCodeReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -385,7 +384,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Bulk reply
|
|
|
|
|
*/
|
|
|
|
|
public String getSet(final String key, final String value) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.getSet(key, value);
|
|
|
|
|
return client.getBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -401,7 +400,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Multi bulk reply
|
|
|
|
|
*/
|
|
|
|
|
public List<String> mget(final String... keys) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.mget(keys);
|
|
|
|
|
return client.getMultiBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -419,7 +418,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* was not set
|
|
|
|
|
*/
|
|
|
|
|
public Long setnx(final String key, final String value) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.setnx(key, value);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -437,7 +436,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Status code reply
|
|
|
|
|
*/
|
|
|
|
|
public String setex(final String key, final int seconds, final String value) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.setex(key, seconds, value);
|
|
|
|
|
return client.getStatusCodeReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -463,7 +462,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Status code reply Basically +OK as MSET can't fail
|
|
|
|
|
*/
|
|
|
|
|
public String mset(final String... keysvalues) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.mset(keysvalues);
|
|
|
|
|
return client.getStatusCodeReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -490,7 +489,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* no key was set (at least one key already existed)
|
|
|
|
|
*/
|
|
|
|
|
public Long msetnx(final String... keysvalues) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.msetnx(keysvalues);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -518,7 +517,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* after the increment.
|
|
|
|
|
*/
|
|
|
|
|
public Long decrBy(final String key, final long integer) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.decrBy(key, integer);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -546,7 +545,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* after the increment.
|
|
|
|
|
*/
|
|
|
|
|
public Long decr(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.decr(key);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -574,7 +573,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* after the increment.
|
|
|
|
|
*/
|
|
|
|
|
public Long incrBy(final String key, final long integer) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.incrBy(key, integer);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -602,7 +601,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* after the increment.
|
|
|
|
|
*/
|
|
|
|
|
public Long incr(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.incr(key);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -624,7 +623,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* the append operation.
|
|
|
|
|
*/
|
|
|
|
|
public Long append(final String key, final String value) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.append(key, value);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -648,7 +647,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Bulk reply
|
|
|
|
|
*/
|
|
|
|
|
public String substr(final String key, final int start, final int end) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.substr(key, start, end);
|
|
|
|
|
return client.getBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -669,7 +668,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* 1 is returned.
|
|
|
|
|
*/
|
|
|
|
|
public Long hset(final String key, final String field, final String value) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.hset(key, field, value);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -688,7 +687,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Bulk reply
|
|
|
|
|
*/
|
|
|
|
|
public String hget(final String key, final String field) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.hget(key, field);
|
|
|
|
|
return client.getBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -705,7 +704,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* field is created 1 is returned.
|
|
|
|
|
*/
|
|
|
|
|
public Long hsetnx(final String key, final String field, final String value) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.hsetnx(key, field, value);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -723,7 +722,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Always OK because HMSET can't fail
|
|
|
|
|
*/
|
|
|
|
|
public String hmset(final String key, final Map<String, String> hash) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.hmset(key, hash);
|
|
|
|
|
return client.getStatusCodeReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -742,7 +741,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* with the specified fields, in the same order of the request.
|
|
|
|
|
*/
|
|
|
|
|
public List<String> hmget(final String key, final String... fields) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.hmget(key, fields);
|
|
|
|
|
return client.getMultiBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -766,7 +765,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* operation.
|
|
|
|
|
*/
|
|
|
|
|
public Long hincrBy(final String key, final String field, final long value) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.hincrBy(key, field, value);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -782,7 +781,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* Return 0 if the key is not found or the field is not present.
|
|
|
|
|
*/
|
|
|
|
|
public Boolean hexists(final String key, final String field) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.hexists(key, field);
|
|
|
|
|
return client.getIntegerReply() == 1;
|
|
|
|
|
}
|
|
|
|
|
@@ -798,7 +797,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* returned, otherwise 0 is returned and no operation is performed.
|
|
|
|
|
*/
|
|
|
|
|
public Long hdel(final String key, final String field) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.hdel(key, field);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -814,7 +813,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* an empty hash.
|
|
|
|
|
*/
|
|
|
|
|
public Long hlen(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.hlen(key);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -828,7 +827,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return All the fields names contained into a hash.
|
|
|
|
|
*/
|
|
|
|
|
public Set<String> hkeys(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.hkeys(key);
|
|
|
|
|
final List<String> lresult = client.getMultiBulkReply();
|
|
|
|
|
return new HashSet<String>(lresult);
|
|
|
|
|
@@ -843,7 +842,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return All the fields values contained into a hash.
|
|
|
|
|
*/
|
|
|
|
|
public List<String> hvals(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.hvals(key);
|
|
|
|
|
final List<String> lresult = client.getMultiBulkReply();
|
|
|
|
|
return lresult;
|
|
|
|
|
@@ -858,7 +857,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return All the fields and values contained into a hash.
|
|
|
|
|
*/
|
|
|
|
|
public Map<String, String> hgetAll(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.hgetAll(key);
|
|
|
|
|
final List<String> flatHash = client.getMultiBulkReply();
|
|
|
|
|
final Map<String, String> hash = new HashMap<String, String>();
|
|
|
|
|
@@ -886,7 +885,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* list after the push operation.
|
|
|
|
|
*/
|
|
|
|
|
public Long rpush(final String key, final String string) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.rpush(key, string);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -907,7 +906,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* list after the push operation.
|
|
|
|
|
*/
|
|
|
|
|
public Long lpush(final String key, final String string) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.lpush(key, string);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -923,7 +922,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return The length of the list.
|
|
|
|
|
*/
|
|
|
|
|
public Long llen(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.llen(key);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -967,7 +966,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* specified range.
|
|
|
|
|
*/
|
|
|
|
|
public List<String> lrange(final String key, final int start, final int end) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.lrange(key, start, end);
|
|
|
|
|
return client.getMultiBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1007,7 +1006,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Status code reply
|
|
|
|
|
*/
|
|
|
|
|
public String ltrim(final String key, final int start, final int end) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.ltrim(key, start, end);
|
|
|
|
|
return client.getStatusCodeReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1031,7 +1030,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Bulk reply, specifically the requested element
|
|
|
|
|
*/
|
|
|
|
|
public String lindex(final String key, final int index) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.lindex(key, index);
|
|
|
|
|
return client.getBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1058,7 +1057,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Status code reply
|
|
|
|
|
*/
|
|
|
|
|
public String lset(final String key, final int index, final String value) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.lset(key, index, value);
|
|
|
|
|
return client.getStatusCodeReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1083,7 +1082,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* the operation succeeded
|
|
|
|
|
*/
|
|
|
|
|
public Long lrem(final String key, final int count, final String value) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.lrem(key, count, value);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1102,7 +1101,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Bulk reply
|
|
|
|
|
*/
|
|
|
|
|
public String lpop(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.lpop(key);
|
|
|
|
|
return client.getBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1121,7 +1120,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Bulk reply
|
|
|
|
|
*/
|
|
|
|
|
public String rpop(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.rpop(key);
|
|
|
|
|
return client.getBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1145,7 +1144,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Bulk reply
|
|
|
|
|
*/
|
|
|
|
|
public String rpoplpush(final String srckey, final String dstkey) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.rpoplpush(srckey, dstkey);
|
|
|
|
|
return client.getBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1164,7 +1163,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* the element was already a member of the set
|
|
|
|
|
*/
|
|
|
|
|
public Long sadd(final String key, final String member) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.sadd(key, member);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1179,7 +1178,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Multi bulk reply
|
|
|
|
|
*/
|
|
|
|
|
public Set<String> smembers(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.smembers(key);
|
|
|
|
|
final List<String> members = client.getMultiBulkReply();
|
|
|
|
|
return new HashSet<String>(members);
|
|
|
|
|
@@ -1198,7 +1197,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* if the new element was not a member of the set
|
|
|
|
|
*/
|
|
|
|
|
public Long srem(final String key, final String member) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.srem(key, member);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1216,7 +1215,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Bulk reply
|
|
|
|
|
*/
|
|
|
|
|
public String spop(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.spop(key);
|
|
|
|
|
return client.getBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1246,7 +1245,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
public Long smove(final String srckey, final String dstkey,
|
|
|
|
|
final String member) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.smove(srckey, dstkey, member);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1260,7 +1259,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* of the set as an integer.
|
|
|
|
|
*/
|
|
|
|
|
public Long scard(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.scard(key);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1278,7 +1277,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* does not exist
|
|
|
|
|
*/
|
|
|
|
|
public Boolean sismember(final String key, final String member) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.sismember(key, member);
|
|
|
|
|
return client.getIntegerReply() == 1;
|
|
|
|
|
}
|
|
|
|
|
@@ -1303,7 +1302,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Multi bulk reply, specifically the list of common elements.
|
|
|
|
|
*/
|
|
|
|
|
public Set<String> sinter(final String... keys) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.sinter(keys);
|
|
|
|
|
final List<String> members = client.getMultiBulkReply();
|
|
|
|
|
return new HashSet<String>(members);
|
|
|
|
|
@@ -1321,7 +1320,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Status code reply
|
|
|
|
|
*/
|
|
|
|
|
public Long sinterstore(final String dstkey, final String... keys) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.sinterstore(dstkey, keys);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1343,7 +1342,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Multi bulk reply, specifically the list of common elements.
|
|
|
|
|
*/
|
|
|
|
|
public Set<String> sunion(final String... keys) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.sunion(keys);
|
|
|
|
|
final List<String> members = client.getMultiBulkReply();
|
|
|
|
|
return new HashSet<String>(members);
|
|
|
|
|
@@ -1362,7 +1361,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Status code reply
|
|
|
|
|
*/
|
|
|
|
|
public Long sunionstore(final String dstkey, final String... keys) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.sunionstore(dstkey, keys);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1391,7 +1390,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* the first set provided and all the successive sets.
|
|
|
|
|
*/
|
|
|
|
|
public Set<String> sdiff(final String... keys) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.sdiff(keys);
|
|
|
|
|
final List<String> members = client.getMultiBulkReply();
|
|
|
|
|
return new HashSet<String>(members);
|
|
|
|
|
@@ -1406,7 +1405,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Status code reply
|
|
|
|
|
*/
|
|
|
|
|
public Long sdiffstore(final String dstkey, final String... keys) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.sdiffstore(dstkey, keys);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1424,7 +1423,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return Bulk reply
|
|
|
|
|
*/
|
|
|
|
|
public String srandmember(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.srandmember(key);
|
|
|
|
|
return client.getBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1451,13 +1450,13 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* was updated
|
|
|
|
|
*/
|
|
|
|
|
public Long zadd(final String key, final double score, final String member) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zadd(key, score, member);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Set<String> zrange(final String key, final int start, final int end) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zrange(key, start, end);
|
|
|
|
|
final List<String> members = client.getMultiBulkReply();
|
|
|
|
|
return new LinkedHashSet<String>(members);
|
|
|
|
|
@@ -1479,7 +1478,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* if the new element was not a member of the set
|
|
|
|
|
*/
|
|
|
|
|
public Long zrem(final String key, final String member) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zrem(key, member);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1510,7 +1509,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
public Double zincrby(final String key, final double score,
|
|
|
|
|
final String member) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zincrby(key, score, member);
|
|
|
|
|
String newscore = client.getBulkReply();
|
|
|
|
|
return Double.valueOf(newscore);
|
|
|
|
|
@@ -1537,7 +1536,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* reply if there is no such element.
|
|
|
|
|
*/
|
|
|
|
|
public Long zrank(final String key, final String member) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zrank(key, member);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1563,14 +1562,14 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* reply if there is no such element.
|
|
|
|
|
*/
|
|
|
|
|
public Long zrevrank(final String key, final String member) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zrevrank(key, member);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Set<String> zrevrange(final String key, final int start,
|
|
|
|
|
final int end) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zrevrange(key, start, end);
|
|
|
|
|
final List<String> members = client.getMultiBulkReply();
|
|
|
|
|
return new LinkedHashSet<String>(members);
|
|
|
|
|
@@ -1578,7 +1577,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
|
|
|
|
|
public Set<Tuple> zrangeWithScores(final String key, final int start,
|
|
|
|
|
final int end) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zrangeWithScores(key, start, end);
|
|
|
|
|
Set<Tuple> set = getTupledSet();
|
|
|
|
|
return set;
|
|
|
|
|
@@ -1586,7 +1585,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
|
|
|
|
|
public Set<Tuple> zrevrangeWithScores(final String key, final int start,
|
|
|
|
|
final int end) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zrevrangeWithScores(key, start, end);
|
|
|
|
|
Set<Tuple> set = getTupledSet();
|
|
|
|
|
return set;
|
|
|
|
|
@@ -1602,7 +1601,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return the cardinality (number of elements) of the set as an integer.
|
|
|
|
|
*/
|
|
|
|
|
public Long zcard(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zcard(key);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1619,33 +1618,12 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return the score
|
|
|
|
|
*/
|
|
|
|
|
public Double zscore(final String key, final String member) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zscore(key, member);
|
|
|
|
|
final String score = client.getBulkReply();
|
|
|
|
|
return (score != null ? new Double(score) : null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void runChecks() {
|
|
|
|
|
if (client.isInMulti()) {
|
|
|
|
|
throw new JedisDataException(
|
|
|
|
|
"Cannot use Jedis when in Multi. Please use JedisTransaction instead.");
|
|
|
|
|
}
|
|
|
|
|
this.connect();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void connect() {
|
|
|
|
|
if (!client.isConnected()) {
|
|
|
|
|
client.connect();
|
|
|
|
|
if (this.password != null) {
|
|
|
|
|
this.auth(this.password);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void disconnect() {
|
|
|
|
|
client.disconnect();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String watch(final String... keys) {
|
|
|
|
|
client.watch(keys);
|
|
|
|
|
return client.getStatusCodeReply();
|
|
|
|
|
@@ -1669,7 +1647,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* smallest to the biggest number.
|
|
|
|
|
*/
|
|
|
|
|
public List<String> sort(final String key) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.sort(key);
|
|
|
|
|
return client.getMultiBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1752,7 +1730,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
public List<String> sort(final String key,
|
|
|
|
|
final SortingParams sortingParameters) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.sort(key, sortingParameters);
|
|
|
|
|
return client.getMultiBulkReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1830,7 +1808,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* programming language used.
|
|
|
|
|
*/
|
|
|
|
|
public List<String> blpop(final int timeout, final String... keys) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
List<String> args = new ArrayList<String>();
|
|
|
|
|
for (String arg : keys) {
|
|
|
|
|
args.add(arg);
|
|
|
|
|
@@ -1859,7 +1837,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
public Long sort(final String key, final SortingParams sortingParameters,
|
|
|
|
|
final String dstkey) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.sort(key, sortingParameters, dstkey);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1881,7 +1859,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* @return The number of elements of the list at dstkey.
|
|
|
|
|
*/
|
|
|
|
|
public Long sort(final String key, final String dstkey) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.sort(key, dstkey);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -1959,7 +1937,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* programming language used.
|
|
|
|
|
*/
|
|
|
|
|
public List<String> brpop(final int timeout, final String... keys) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
List<String> args = new ArrayList<String>();
|
|
|
|
|
for (String arg : keys) {
|
|
|
|
|
args.add(arg);
|
|
|
|
|
@@ -1991,33 +1969,35 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public String auth(final String password) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.auth(password);
|
|
|
|
|
return client.getStatusCodeReply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void subscribe(JedisPubSub jedisPubSub, String... channels) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
connect();
|
|
|
|
|
client.setTimeoutInfinite();
|
|
|
|
|
jedisPubSub.proceed(client, channels);
|
|
|
|
|
client.rollbackTimeout();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Long publish(String channel, String message) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.publish(channel, message);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void psubscribe(JedisPubSub jedisPubSub, String... patterns) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
connect();
|
|
|
|
|
client.setTimeoutInfinite();
|
|
|
|
|
jedisPubSub.proceedWithPatterns(client, patterns);
|
|
|
|
|
client.rollbackTimeout();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Long zcount(final String key, final double min, final double max) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zcount(key, min, max);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -2081,14 +2061,14 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
public Set<String> zrangeByScore(final String key, final double min,
|
|
|
|
|
final double max) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zrangeByScore(key, min, max);
|
|
|
|
|
return new LinkedHashSet<String>(client.getMultiBulkReply());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Set<String> zrangeByScore(final String key, final String min,
|
|
|
|
|
final String max) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zrangeByScore(key, min, max);
|
|
|
|
|
return new LinkedHashSet<String>(client.getMultiBulkReply());
|
|
|
|
|
}
|
|
|
|
|
@@ -2151,7 +2131,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
public Set<String> zrangeByScore(final String key, final double min,
|
|
|
|
|
final double max, final int offset, final int count) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zrangeByScore(key, min, max, offset, count);
|
|
|
|
|
return new LinkedHashSet<String>(client.getMultiBulkReply());
|
|
|
|
|
}
|
|
|
|
|
@@ -2214,7 +2194,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
public Set<Tuple> zrangeByScoreWithScores(final String key,
|
|
|
|
|
final double min, final double max) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zrangeByScoreWithScores(key, min, max);
|
|
|
|
|
Set<Tuple> set = getTupledSet();
|
|
|
|
|
return set;
|
|
|
|
|
@@ -2279,14 +2259,14 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
public Set<Tuple> zrangeByScoreWithScores(final String key,
|
|
|
|
|
final double min, final double max, final int offset,
|
|
|
|
|
final int count) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zrangeByScoreWithScores(key, min, max, offset, count);
|
|
|
|
|
Set<Tuple> set = getTupledSet();
|
|
|
|
|
return set;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Set<Tuple> getTupledSet() {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
List<String> membersWithScores = client.getMultiBulkReply();
|
|
|
|
|
Set<Tuple> set = new LinkedHashSet<Tuple>();
|
|
|
|
|
Iterator<String> iterator = membersWithScores.iterator();
|
|
|
|
|
@@ -2312,7 +2292,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
public Long zremrangeByRank(final String key, final int start, final int end) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zremrangeByRank(key, start, end);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -2333,7 +2313,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
public Long zremrangeByScore(final String key, final double start,
|
|
|
|
|
final double end) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zremrangeByScore(key, start, end);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -2377,7 +2357,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* set at dstkey
|
|
|
|
|
*/
|
|
|
|
|
public Long zunionstore(final String dstkey, final String... sets) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zunionstore(dstkey, sets);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -2423,7 +2403,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
public Long zunionstore(final String dstkey, final ZParams params,
|
|
|
|
|
final String... sets) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zunionstore(dstkey, params, sets);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -2467,7 +2447,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
* set at dstkey
|
|
|
|
|
*/
|
|
|
|
|
public Long zinterstore(final String dstkey, final String... sets) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zinterstore(dstkey, sets);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
@@ -2513,7 +2493,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
|
|
|
|
*/
|
|
|
|
|
public Long zinterstore(final String dstkey, final ZParams params,
|
|
|
|
|
final String... sets) {
|
|
|
|
|
runChecks();
|
|
|
|
|
checkIsInMulti();
|
|
|
|
|
client.zinterstore(dstkey, params, sets);
|
|
|
|
|
return client.getIntegerReply();
|
|
|
|
|
}
|
|
|
|
|
|