incr/decr operate on 64-bit numbers. Switching from Integer to Long
This commit is contained in:
committed by
Jonathan Leibiusky
parent
a1815f3881
commit
d18cc4bd13
@@ -93,7 +93,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @param key
|
||||
* @return Integer reply, "0" if the key exists, otherwise "1"
|
||||
*/
|
||||
public Integer exists(final byte[] key) {
|
||||
public Long exists(final byte[] key) {
|
||||
checkIsInMulti();
|
||||
client.exists(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -109,7 +109,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically: an integer greater than 0 if one or
|
||||
* more keys were removed 0 if none of the specified key existed
|
||||
*/
|
||||
public Integer del(final byte[]... keys) {
|
||||
public Long del(final byte[]... keys) {
|
||||
checkIsInMulti();
|
||||
client.del(keys);
|
||||
return client.getIntegerReply();
|
||||
@@ -228,7 +228,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically: 1 if the key was renamed 0 if the
|
||||
* target key already exist
|
||||
*/
|
||||
public Integer renamenx(final byte[] oldkey, final byte[] newkey) {
|
||||
public Long renamenx(final byte[] oldkey, final byte[] newkey) {
|
||||
checkIsInMulti();
|
||||
client.renamenx(oldkey, newkey);
|
||||
return client.getIntegerReply();
|
||||
@@ -239,7 +239,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
*
|
||||
* @return Integer reply
|
||||
*/
|
||||
public Integer dbSize() {
|
||||
public Long dbSize() {
|
||||
checkIsInMulti();
|
||||
client.dbSize();
|
||||
return client.getIntegerReply();
|
||||
@@ -273,7 +273,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* 2.1.3 will happily update the timeout), or the key does not
|
||||
* exist.
|
||||
*/
|
||||
public Integer expire(final byte[] key, final int seconds) {
|
||||
public Long expire(final byte[] key, final int seconds) {
|
||||
checkIsInMulti();
|
||||
client.expire(key, seconds);
|
||||
return client.getIntegerReply();
|
||||
@@ -309,7 +309,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* 2.1.3 will happily update the timeout), or the key does not
|
||||
* exist.
|
||||
*/
|
||||
public Integer expireAt(final byte[] key, final long unixTime) {
|
||||
public Long expireAt(final byte[] key, final long unixTime) {
|
||||
checkIsInMulti();
|
||||
client.expireAt(key, unixTime);
|
||||
return client.getIntegerReply();
|
||||
@@ -326,7 +326,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* key that has an EXPIRE. If the Key does not exists or does not
|
||||
* have an associated expire, -1 is returned.
|
||||
*/
|
||||
public Integer ttl(final byte[] key) {
|
||||
public Long ttl(final byte[] key) {
|
||||
checkIsInMulti();
|
||||
client.ttl(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -358,7 +358,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* was not moved because already present on the target DB or was not
|
||||
* found in the current DB.
|
||||
*/
|
||||
public Integer move(final byte[] key, final int dbIndex) {
|
||||
public Long move(final byte[] key, final int dbIndex) {
|
||||
checkIsInMulti();
|
||||
client.move(key, dbIndex);
|
||||
return client.getIntegerReply();
|
||||
@@ -421,7 +421,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically: 1 if the key was set 0 if the key
|
||||
* was not set
|
||||
*/
|
||||
public Integer setnx(final byte[] key, final byte[] value) {
|
||||
public Long setnx(final byte[] key, final byte[] value) {
|
||||
checkIsInMulti();
|
||||
client.setnx(key, value);
|
||||
return client.getIntegerReply();
|
||||
@@ -492,7 +492,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically: 1 if the all the keys were set 0 if
|
||||
* no key was set (at least one key already existed)
|
||||
*/
|
||||
public Integer msetnx(final byte[]... keysvalues) {
|
||||
public Long msetnx(final byte[]... keysvalues) {
|
||||
checkIsInMulti();
|
||||
client.msetnx(keysvalues);
|
||||
return client.getIntegerReply();
|
||||
@@ -520,7 +520,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, this commands will reply with the new value of key
|
||||
* after the increment.
|
||||
*/
|
||||
public Integer decrBy(final byte[] key, final int integer) {
|
||||
public Long decrBy(final byte[] key, final int integer) {
|
||||
checkIsInMulti();
|
||||
client.decrBy(key, integer);
|
||||
return client.getIntegerReply();
|
||||
@@ -548,7 +548,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, this commands will reply with the new value of key
|
||||
* after the increment.
|
||||
*/
|
||||
public Integer decr(final byte[] key) {
|
||||
public Long decr(final byte[] key) {
|
||||
checkIsInMulti();
|
||||
client.decr(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -576,7 +576,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, this commands will reply with the new value of key
|
||||
* after the increment.
|
||||
*/
|
||||
public Integer incrBy(final byte[] key, final int integer) {
|
||||
public Long incrBy(final byte[] key, final int integer) {
|
||||
checkIsInMulti();
|
||||
client.incrBy(key, integer);
|
||||
return client.getIntegerReply();
|
||||
@@ -604,7 +604,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, this commands will reply with the new value of key
|
||||
* after the increment.
|
||||
*/
|
||||
public Integer incr(final byte[] key) {
|
||||
public Long incr(final byte[] key) {
|
||||
checkIsInMulti();
|
||||
client.incr(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -626,7 +626,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically the total length of the string after
|
||||
* the append operation.
|
||||
*/
|
||||
public Integer append(final byte[] key, final byte[] value) {
|
||||
public Long append(final byte[] key, final byte[] value) {
|
||||
checkIsInMulti();
|
||||
client.append(key, value);
|
||||
return client.getIntegerReply();
|
||||
@@ -671,7 +671,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* of the value, 0 is returned, otherwise if a new field is created
|
||||
* 1 is returned.
|
||||
*/
|
||||
public Integer hset(final byte[] key, final byte[] field, final byte[] value) {
|
||||
public Long hset(final byte[] key, final byte[] field, final byte[] value) {
|
||||
checkIsInMulti();
|
||||
client.hset(key, field, value);
|
||||
return client.getIntegerReply();
|
||||
@@ -707,7 +707,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return If the field already exists, 0 is returned, otherwise if a new
|
||||
* field is created 1 is returned.
|
||||
*/
|
||||
public Integer hsetnx(final byte[] key, final byte[] field,
|
||||
public Long hsetnx(final byte[] key, final byte[] field,
|
||||
final byte[] value) {
|
||||
checkIsInMulti();
|
||||
client.hsetnx(key, field, value);
|
||||
@@ -769,7 +769,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply The new value at field after the increment
|
||||
* operation.
|
||||
*/
|
||||
public Integer hincrBy(final byte[] key, final byte[] field, final int value) {
|
||||
public Long hincrBy(final byte[] key, final byte[] field, final int value) {
|
||||
checkIsInMulti();
|
||||
client.hincrBy(key, field, value);
|
||||
return client.getIntegerReply();
|
||||
@@ -785,7 +785,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Return 1 if the hash stored at key contains the specified field.
|
||||
* Return 0 if the key is not found or the field is not present.
|
||||
*/
|
||||
public Integer hexists(final byte[] key, final byte[] field) {
|
||||
public Long hexists(final byte[] key, final byte[] field) {
|
||||
checkIsInMulti();
|
||||
client.hexists(key, field);
|
||||
return client.getIntegerReply();
|
||||
@@ -801,7 +801,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return If the field was present in the hash it is deleted and 1 is
|
||||
* returned, otherwise 0 is returned and no operation is performed.
|
||||
*/
|
||||
public Integer hdel(final byte[] key, final byte[] field) {
|
||||
public Long hdel(final byte[] key, final byte[] field) {
|
||||
checkIsInMulti();
|
||||
client.hdel(key, field);
|
||||
return client.getIntegerReply();
|
||||
@@ -817,7 +817,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* key. If the specified key does not exist, 0 is returned assuming
|
||||
* an empty hash.
|
||||
*/
|
||||
public Integer hlen(final byte[] key) {
|
||||
public Long hlen(final byte[] key) {
|
||||
checkIsInMulti();
|
||||
client.hlen(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -889,7 +889,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically, the number of elements inside the
|
||||
* list after the push operation.
|
||||
*/
|
||||
public Integer rpush(final byte[] key, final byte[] string) {
|
||||
public Long rpush(final byte[] key, final byte[] string) {
|
||||
checkIsInMulti();
|
||||
client.rpush(key, string);
|
||||
return client.getIntegerReply();
|
||||
@@ -910,7 +910,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically, the number of elements inside the
|
||||
* list after the push operation.
|
||||
*/
|
||||
public Integer lpush(final byte[] key, final byte[] string) {
|
||||
public Long lpush(final byte[] key, final byte[] string) {
|
||||
checkIsInMulti();
|
||||
client.lpush(key, string);
|
||||
return client.getIntegerReply();
|
||||
@@ -926,7 +926,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @param key
|
||||
* @return The length of the list.
|
||||
*/
|
||||
public Integer llen(final byte[] key) {
|
||||
public Long llen(final byte[] key) {
|
||||
checkIsInMulti();
|
||||
client.llen(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -1086,7 +1086,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer Reply, specifically: The number of removed elements if
|
||||
* the operation succeeded
|
||||
*/
|
||||
public Integer lrem(final byte[] key, final int count, final byte[] value) {
|
||||
public Long lrem(final byte[] key, final int count, final byte[] value) {
|
||||
checkIsInMulti();
|
||||
client.lrem(key, count, value);
|
||||
return client.getIntegerReply();
|
||||
@@ -1167,7 +1167,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically: 1 if the new element was added 0 if
|
||||
* the element was already a member of the set
|
||||
*/
|
||||
public Integer sadd(final byte[] key, final byte[] member) {
|
||||
public Long sadd(final byte[] key, final byte[] member) {
|
||||
checkIsInMulti();
|
||||
client.sadd(key, member);
|
||||
return client.getIntegerReply();
|
||||
@@ -1201,7 +1201,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically: 1 if the new element was removed 0
|
||||
* if the new element was not a member of the set
|
||||
*/
|
||||
public Integer srem(final byte[] key, final byte[] member) {
|
||||
public Long srem(final byte[] key, final byte[] member) {
|
||||
checkIsInMulti();
|
||||
client.srem(key, member);
|
||||
return client.getIntegerReply();
|
||||
@@ -1248,7 +1248,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* element was not found on the first set and no operation was
|
||||
* performed
|
||||
*/
|
||||
public Integer smove(final byte[] srckey, final byte[] dstkey,
|
||||
public Long smove(final byte[] srckey, final byte[] dstkey,
|
||||
final byte[] member) {
|
||||
checkIsInMulti();
|
||||
client.smove(srckey, dstkey, member);
|
||||
@@ -1263,7 +1263,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically: the cardinality (number of elements)
|
||||
* of the set as an integer.
|
||||
*/
|
||||
public Integer scard(final byte[] key) {
|
||||
public Long scard(final byte[] key) {
|
||||
checkIsInMulti();
|
||||
client.scard(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -1281,7 +1281,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* set 0 if the element is not a member of the set OR if the key
|
||||
* does not exist
|
||||
*/
|
||||
public Integer sismember(final byte[] key, final byte[] member) {
|
||||
public Long sismember(final byte[] key, final byte[] member) {
|
||||
checkIsInMulti();
|
||||
client.sismember(key, member);
|
||||
return client.getIntegerReply();
|
||||
@@ -1324,7 +1324,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @param keys
|
||||
* @return Status code reply
|
||||
*/
|
||||
public Integer sinterstore(final byte[] dstkey, final byte[]... keys) {
|
||||
public Long sinterstore(final byte[] dstkey, final byte[]... keys) {
|
||||
checkIsInMulti();
|
||||
client.sinterstore(dstkey, keys);
|
||||
return client.getIntegerReply();
|
||||
@@ -1365,7 +1365,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @param keys
|
||||
* @return Status code reply
|
||||
*/
|
||||
public Integer sunionstore(final byte[] dstkey, final byte[]... keys) {
|
||||
public Long sunionstore(final byte[] dstkey, final byte[]... keys) {
|
||||
checkIsInMulti();
|
||||
client.sunionstore(dstkey, keys);
|
||||
return client.getIntegerReply();
|
||||
@@ -1409,7 +1409,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @param keys
|
||||
* @return Status code reply
|
||||
*/
|
||||
public Integer sdiffstore(final byte[] dstkey, final byte[]... keys) {
|
||||
public Long sdiffstore(final byte[] dstkey, final byte[]... keys) {
|
||||
checkIsInMulti();
|
||||
client.sdiffstore(dstkey, keys);
|
||||
return client.getIntegerReply();
|
||||
@@ -1454,7 +1454,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* the element was already a member of the sorted set and the score
|
||||
* was updated
|
||||
*/
|
||||
public Integer zadd(final byte[] key, final double score,
|
||||
public Long zadd(final byte[] key, final double score,
|
||||
final byte[] member) {
|
||||
checkIsInMulti();
|
||||
client.zadd(key, score, member);
|
||||
@@ -1483,7 +1483,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically: 1 if the new element was removed 0
|
||||
* if the new element was not a member of the set
|
||||
*/
|
||||
public Integer zrem(final byte[] key, final byte[] member) {
|
||||
public Long zrem(final byte[] key, final byte[] member) {
|
||||
checkIsInMulti();
|
||||
client.zrem(key, member);
|
||||
return client.getIntegerReply();
|
||||
@@ -1541,7 +1541,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* element as an integer reply if the element exists. A nil bulk
|
||||
* reply if there is no such element.
|
||||
*/
|
||||
public Integer zrank(final byte[] key, final byte[] member) {
|
||||
public Long zrank(final byte[] key, final byte[] member) {
|
||||
checkIsInMulti();
|
||||
client.zrank(key, member);
|
||||
return client.getIntegerReply();
|
||||
@@ -1567,7 +1567,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* element as an integer reply if the element exists. A nil bulk
|
||||
* reply if there is no such element.
|
||||
*/
|
||||
public Integer zrevrank(final byte[] key, final byte[] member) {
|
||||
public Long zrevrank(final byte[] key, final byte[] member) {
|
||||
checkIsInMulti();
|
||||
client.zrevrank(key, member);
|
||||
return client.getIntegerReply();
|
||||
@@ -1606,7 +1606,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @param key
|
||||
* @return the cardinality (number of elements) of the set as an integer.
|
||||
*/
|
||||
public Integer zcard(final byte[] key) {
|
||||
public Long zcard(final byte[] key) {
|
||||
checkIsInMulti();
|
||||
client.zcard(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -1880,7 +1880,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @param dstkey
|
||||
* @return The number of elements of the list at dstkey.
|
||||
*/
|
||||
public Integer sort(final byte[] key,
|
||||
public Long sort(final byte[] key,
|
||||
final SortingParams sortingParameters, final byte[] dstkey) {
|
||||
checkIsInMulti();
|
||||
client.sort(key, sortingParameters, dstkey);
|
||||
@@ -1903,7 +1903,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @param dstkey
|
||||
* @return The number of elements of the list at dstkey.
|
||||
*/
|
||||
public Integer sort(final byte[] key, final byte[] dstkey) {
|
||||
public Long sort(final byte[] key, final byte[] dstkey) {
|
||||
checkIsInMulti();
|
||||
client.sort(key, dstkey);
|
||||
return client.getIntegerReply();
|
||||
@@ -2031,7 +2031,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
client.rollbackTimeout();
|
||||
}
|
||||
|
||||
public Integer publish(final String channel, final String message) {
|
||||
public Long publish(final String channel, final String message) {
|
||||
client.publish(channel, message);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
@@ -2043,7 +2043,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
client.rollbackTimeout();
|
||||
}
|
||||
|
||||
public Integer zcount(final byte[] key, final double min, final double max) {
|
||||
public Long zcount(final byte[] key, final double min, final double max) {
|
||||
checkIsInMulti();
|
||||
client.zcount(key, min, max);
|
||||
return client.getIntegerReply();
|
||||
@@ -2337,7 +2337,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* operation
|
||||
*
|
||||
*/
|
||||
public Integer zremrangeByRank(final byte[] key, final int start,
|
||||
public Long zremrangeByRank(final byte[] key, final int start,
|
||||
final int end) {
|
||||
checkIsInMulti();
|
||||
client.zremrangeByRank(key, start, end);
|
||||
@@ -2358,7 +2358,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @param end
|
||||
* @return Integer reply, specifically the number of elements removed.
|
||||
*/
|
||||
public Integer zremrangeByScore(final byte[] key, final double start,
|
||||
public Long zremrangeByScore(final byte[] key, final double start,
|
||||
final double end) {
|
||||
checkIsInMulti();
|
||||
client.zremrangeByScore(key, start, end);
|
||||
@@ -2403,7 +2403,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically the number of elements in the sorted
|
||||
* set at dstkey
|
||||
*/
|
||||
public Integer zunionstore(final byte[] dstkey, final byte[]... sets) {
|
||||
public Long zunionstore(final byte[] dstkey, final byte[]... sets) {
|
||||
checkIsInMulti();
|
||||
client.zunionstore(dstkey, sets);
|
||||
return client.getIntegerReply();
|
||||
@@ -2448,7 +2448,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically the number of elements in the sorted
|
||||
* set at dstkey
|
||||
*/
|
||||
public Integer zunionstore(final byte[] dstkey, final ZParams params,
|
||||
public Long zunionstore(final byte[] dstkey, final ZParams params,
|
||||
final byte[]... sets) {
|
||||
checkIsInMulti();
|
||||
client.zunionstore(dstkey, params, sets);
|
||||
@@ -2493,7 +2493,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically the number of elements in the sorted
|
||||
* set at dstkey
|
||||
*/
|
||||
public Integer zinterstore(final byte[] dstkey, final byte[]... sets) {
|
||||
public Long zinterstore(final byte[] dstkey, final byte[]... sets) {
|
||||
checkIsInMulti();
|
||||
client.zinterstore(dstkey, sets);
|
||||
return client.getIntegerReply();
|
||||
@@ -2538,7 +2538,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically the number of elements in the sorted
|
||||
* set at dstkey
|
||||
*/
|
||||
public Integer zinterstore(final byte[] dstkey, final ZParams params,
|
||||
public Long zinterstore(final byte[] dstkey, final ZParams params,
|
||||
final byte[]... sets) {
|
||||
checkIsInMulti();
|
||||
client.zinterstore(dstkey, params, sets);
|
||||
@@ -2615,7 +2615,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
*
|
||||
* @return Integer reply, specifically an UNIX time stamp.
|
||||
*/
|
||||
public Integer lastsave() {
|
||||
public Long lastsave() {
|
||||
client.lastsave();
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
@@ -2822,7 +2822,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
return client.isConnected();
|
||||
}
|
||||
|
||||
public Integer strlen(final byte[] key) {
|
||||
public Long strlen(final byte[] key) {
|
||||
client.strlen(key);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
@@ -2831,7 +2831,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
client.sync();
|
||||
}
|
||||
|
||||
public Integer lpushx(final byte[] key, final byte[] string) {
|
||||
public Long lpushx(final byte[] key, final byte[] string) {
|
||||
client.lpushx(key, string);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
@@ -2846,12 +2846,12 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply, specifically: 1: the key is now persist. 0: the
|
||||
* key is not persist (only happens when key not set).
|
||||
*/
|
||||
public Integer persist(final byte[] key) {
|
||||
public Long persist(final byte[] key) {
|
||||
client.persist(key);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
|
||||
public Integer rpushx(final byte[] key, final byte[] string) {
|
||||
public Long rpushx(final byte[] key, final byte[] string) {
|
||||
client.rpushx(key, string);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
@@ -2861,7 +2861,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
return client.getBinaryBulkReply();
|
||||
}
|
||||
|
||||
public Integer linsert(final byte[] key, final LIST_POSITION where,
|
||||
public Long linsert(final byte[] key, final LIST_POSITION where,
|
||||
final byte[] pivot, final byte[] value) {
|
||||
client.linsert(key, where, pivot, value);
|
||||
return client.getIntegerReply();
|
||||
|
||||
@@ -15,51 +15,51 @@ public interface BinaryJedisCommands {
|
||||
|
||||
byte[] get(byte[] key);
|
||||
|
||||
Integer exists(byte[] key);
|
||||
Long exists(byte[] key);
|
||||
|
||||
String type(byte[] key);
|
||||
|
||||
Integer expire(byte[] key, int seconds);
|
||||
Long expire(byte[] key, int seconds);
|
||||
|
||||
Integer expireAt(byte[] key, long unixTime);
|
||||
Long expireAt(byte[] key, long unixTime);
|
||||
|
||||
Integer ttl(byte[] key);
|
||||
Long ttl(byte[] key);
|
||||
|
||||
byte[] getSet(byte[] key, byte[] value);
|
||||
|
||||
Integer setnx(byte[] key, byte[] value);
|
||||
Long setnx(byte[] key, byte[] value);
|
||||
|
||||
String setex(byte[] key, int seconds, byte[] value);
|
||||
|
||||
Integer decrBy(byte[] key, int integer);
|
||||
Long decrBy(byte[] key, int integer);
|
||||
|
||||
Integer decr(byte[] key);
|
||||
Long decr(byte[] key);
|
||||
|
||||
Integer incrBy(byte[] key, int integer);
|
||||
Long incrBy(byte[] key, int integer);
|
||||
|
||||
Integer incr(byte[] key);
|
||||
Long incr(byte[] key);
|
||||
|
||||
Integer append(byte[] key, byte[] value);
|
||||
Long append(byte[] key, byte[] value);
|
||||
|
||||
byte[] substr(byte[] key, int start, int end);
|
||||
|
||||
Integer hset(byte[] key, byte[] field, byte[] value);
|
||||
Long hset(byte[] key, byte[] field, byte[] value);
|
||||
|
||||
byte[] hget(byte[] key, byte[] field);
|
||||
|
||||
Integer hsetnx(byte[] key, byte[] field, byte[] value);
|
||||
Long hsetnx(byte[] key, byte[] field, byte[] value);
|
||||
|
||||
String hmset(byte[] key, Map<byte[], byte[]> hash);
|
||||
|
||||
List<byte[]> hmget(byte[] key, byte[]... fields);
|
||||
|
||||
Integer hincrBy(byte[] key, byte[] field, int value);
|
||||
Long hincrBy(byte[] key, byte[] field, int value);
|
||||
|
||||
Integer hexists(byte[] key, byte[] field);
|
||||
Long hexists(byte[] key, byte[] field);
|
||||
|
||||
Integer hdel(byte[] key, byte[] field);
|
||||
Long hdel(byte[] key, byte[] field);
|
||||
|
||||
Integer hlen(byte[] key);
|
||||
Long hlen(byte[] key);
|
||||
|
||||
Set<byte[]> hkeys(byte[] key);
|
||||
|
||||
@@ -67,11 +67,11 @@ public interface BinaryJedisCommands {
|
||||
|
||||
Map<byte[], byte[]> hgetAll(byte[] key);
|
||||
|
||||
Integer rpush(byte[] key, byte[] string);
|
||||
Long rpush(byte[] key, byte[] string);
|
||||
|
||||
Integer lpush(byte[] key, byte[] string);
|
||||
Long lpush(byte[] key, byte[] string);
|
||||
|
||||
Integer llen(byte[] key);
|
||||
Long llen(byte[] key);
|
||||
|
||||
List<byte[]> lrange(byte[] key, int start, int end);
|
||||
|
||||
@@ -81,37 +81,37 @@ public interface BinaryJedisCommands {
|
||||
|
||||
String lset(byte[] key, int index, byte[] value);
|
||||
|
||||
Integer lrem(byte[] key, int count, byte[] value);
|
||||
Long lrem(byte[] key, int count, byte[] value);
|
||||
|
||||
byte[] lpop(byte[] key);
|
||||
|
||||
byte[] rpop(byte[] key);
|
||||
|
||||
Integer sadd(byte[] key, byte[] member);
|
||||
Long sadd(byte[] key, byte[] member);
|
||||
|
||||
Set<byte[]> smembers(byte[] key);
|
||||
|
||||
Integer srem(byte[] key, byte[] member);
|
||||
Long srem(byte[] key, byte[] member);
|
||||
|
||||
byte[] spop(byte[] key);
|
||||
|
||||
Integer scard(byte[] key);
|
||||
Long scard(byte[] key);
|
||||
|
||||
Integer sismember(byte[] key, byte[] member);
|
||||
Long sismember(byte[] key, byte[] member);
|
||||
|
||||
byte[] srandmember(byte[] key);
|
||||
|
||||
Integer zadd(byte[] key, double score, byte[] member);
|
||||
Long zadd(byte[] key, double score, byte[] member);
|
||||
|
||||
Set<byte[]> zrange(byte[] key, int start, int end);
|
||||
|
||||
Integer zrem(byte[] key, byte[] member);
|
||||
Long zrem(byte[] key, byte[] member);
|
||||
|
||||
Double zincrby(byte[] key, double score, byte[] member);
|
||||
|
||||
Integer zrank(byte[] key, byte[] member);
|
||||
Long zrank(byte[] key, byte[] member);
|
||||
|
||||
Integer zrevrank(byte[] key, byte[] member);
|
||||
Long zrevrank(byte[] key, byte[] member);
|
||||
|
||||
Set<byte[]> zrevrange(byte[] key, int start, int end);
|
||||
|
||||
@@ -119,7 +119,7 @@ public interface BinaryJedisCommands {
|
||||
|
||||
Set<Tuple> zrevrangeWithScores(byte[] key, int start, int end);
|
||||
|
||||
Integer zcard(byte[] key);
|
||||
Long zcard(byte[] key);
|
||||
|
||||
Double zscore(byte[] key, byte[] member);
|
||||
|
||||
@@ -127,7 +127,7 @@ public interface BinaryJedisCommands {
|
||||
|
||||
List<byte[]> sort(byte[] key, SortingParams sortingParameters);
|
||||
|
||||
Integer zcount(byte[] key, double min, double max);
|
||||
Long zcount(byte[] key, double min, double max);
|
||||
|
||||
Set<byte[]> zrangeByScore(byte[] key, double min, double max);
|
||||
|
||||
@@ -147,11 +147,11 @@ public interface BinaryJedisCommands {
|
||||
int offset,
|
||||
int count);
|
||||
|
||||
Integer zremrangeByRank(byte[] key, int start, int end);
|
||||
Long zremrangeByRank(byte[] key, int start, int end);
|
||||
|
||||
Integer zremrangeByScore(byte[] key, double start, double end);
|
||||
Long zremrangeByScore(byte[] key, double start, double end);
|
||||
|
||||
Integer linsert(
|
||||
Long linsert(
|
||||
byte[] key,
|
||||
LIST_POSITION where,
|
||||
byte[] pivot,
|
||||
|
||||
@@ -50,7 +50,7 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.get(key);
|
||||
}
|
||||
|
||||
public Integer exists(byte[] key) {
|
||||
public Long exists(byte[] key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.exists(key);
|
||||
}
|
||||
@@ -60,17 +60,17 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.type(key);
|
||||
}
|
||||
|
||||
public Integer expire(byte[] key, int seconds) {
|
||||
public Long expire(byte[] key, int seconds) {
|
||||
Jedis j = getShard(key);
|
||||
return j.expire(key, seconds);
|
||||
}
|
||||
|
||||
public Integer expireAt(byte[] key, long unixTime) {
|
||||
public Long expireAt(byte[] key, long unixTime) {
|
||||
Jedis j = getShard(key);
|
||||
return j.expireAt(key, unixTime);
|
||||
}
|
||||
|
||||
public Integer ttl(byte[] key) {
|
||||
public Long ttl(byte[] key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.ttl(key);
|
||||
}
|
||||
@@ -80,7 +80,7 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.getSet(key, value);
|
||||
}
|
||||
|
||||
public Integer setnx(byte[] key, byte[] value) {
|
||||
public Long setnx(byte[] key, byte[] value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.setnx(key, value);
|
||||
}
|
||||
@@ -90,27 +90,27 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.setex(key, seconds, value);
|
||||
}
|
||||
|
||||
public Integer decrBy(byte[] key, int integer) {
|
||||
public Long decrBy(byte[] key, int integer) {
|
||||
Jedis j = getShard(key);
|
||||
return j.decrBy(key, integer);
|
||||
}
|
||||
|
||||
public Integer decr(byte[] key) {
|
||||
public Long decr(byte[] key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.decr(key);
|
||||
}
|
||||
|
||||
public Integer incrBy(byte[] key, int integer) {
|
||||
public Long incrBy(byte[] key, int integer) {
|
||||
Jedis j = getShard(key);
|
||||
return j.incrBy(key, integer);
|
||||
}
|
||||
|
||||
public Integer incr(byte[] key) {
|
||||
public Long incr(byte[] key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.incr(key);
|
||||
}
|
||||
|
||||
public Integer append(byte[] key, byte[] value) {
|
||||
public Long append(byte[] key, byte[] value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.append(key, value);
|
||||
}
|
||||
@@ -120,7 +120,7 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.substr(key, start, end);
|
||||
}
|
||||
|
||||
public Integer hset(byte[] key, byte[] field, byte[] value) {
|
||||
public Long hset(byte[] key, byte[] field, byte[] value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.hset(key, field, value);
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.hget(key, field);
|
||||
}
|
||||
|
||||
public Integer hsetnx(byte[] key, byte[] field, byte[] value) {
|
||||
public Long hsetnx(byte[] key, byte[] field, byte[] value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.hsetnx(key, field, value);
|
||||
}
|
||||
@@ -145,22 +145,22 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.hmget(key, fields);
|
||||
}
|
||||
|
||||
public Integer hincrBy(byte[] key, byte[] field, int value) {
|
||||
public Long hincrBy(byte[] key, byte[] field, int value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.hincrBy(key, field, value);
|
||||
}
|
||||
|
||||
public Integer hexists(byte[] key, byte[] field) {
|
||||
public Long hexists(byte[] key, byte[] field) {
|
||||
Jedis j = getShard(key);
|
||||
return j.hexists(key, field);
|
||||
}
|
||||
|
||||
public Integer hdel(byte[] key, byte[] field) {
|
||||
public Long hdel(byte[] key, byte[] field) {
|
||||
Jedis j = getShard(key);
|
||||
return j.hdel(key, field);
|
||||
}
|
||||
|
||||
public Integer hlen(byte[] key) {
|
||||
public Long hlen(byte[] key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.hlen(key);
|
||||
}
|
||||
@@ -180,17 +180,17 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.hgetAll(key);
|
||||
}
|
||||
|
||||
public Integer rpush(byte[] key, byte[] string) {
|
||||
public Long rpush(byte[] key, byte[] string) {
|
||||
Jedis j = getShard(key);
|
||||
return j.rpush(key, string);
|
||||
}
|
||||
|
||||
public Integer lpush(byte[] key, byte[] string) {
|
||||
public Long lpush(byte[] key, byte[] string) {
|
||||
Jedis j = getShard(key);
|
||||
return j.lpush(key, string);
|
||||
}
|
||||
|
||||
public Integer llen(byte[] key) {
|
||||
public Long llen(byte[] key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.llen(key);
|
||||
}
|
||||
@@ -215,7 +215,7 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.lset(key, index, value);
|
||||
}
|
||||
|
||||
public Integer lrem(byte[] key, int count, byte[] value) {
|
||||
public Long lrem(byte[] key, int count, byte[] value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.lrem(key, count, value);
|
||||
}
|
||||
@@ -230,7 +230,7 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.rpop(key);
|
||||
}
|
||||
|
||||
public Integer sadd(byte[] key, byte[] member) {
|
||||
public Long sadd(byte[] key, byte[] member) {
|
||||
Jedis j = getShard(key);
|
||||
return j.sadd(key, member);
|
||||
}
|
||||
@@ -240,7 +240,7 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.smembers(key);
|
||||
}
|
||||
|
||||
public Integer srem(byte[] key, byte[] member) {
|
||||
public Long srem(byte[] key, byte[] member) {
|
||||
Jedis j = getShard(key);
|
||||
return j.srem(key, member);
|
||||
}
|
||||
@@ -250,12 +250,12 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.spop(key);
|
||||
}
|
||||
|
||||
public Integer scard(byte[] key) {
|
||||
public Long scard(byte[] key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.scard(key);
|
||||
}
|
||||
|
||||
public Integer sismember(byte[] key, byte[] member) {
|
||||
public Long sismember(byte[] key, byte[] member) {
|
||||
Jedis j = getShard(key);
|
||||
return j.sismember(key, member);
|
||||
}
|
||||
@@ -265,7 +265,7 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.srandmember(key);
|
||||
}
|
||||
|
||||
public Integer zadd(byte[] key, double score, byte[] member) {
|
||||
public Long zadd(byte[] key, double score, byte[] member) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zadd(key, score, member);
|
||||
}
|
||||
@@ -275,7 +275,7 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.zrange(key, start, end);
|
||||
}
|
||||
|
||||
public Integer zrem(byte[] key, byte[] member) {
|
||||
public Long zrem(byte[] key, byte[] member) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zrem(key, member);
|
||||
}
|
||||
@@ -285,12 +285,12 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.zincrby(key, score, member);
|
||||
}
|
||||
|
||||
public Integer zrank(byte[] key, byte[] member) {
|
||||
public Long zrank(byte[] key, byte[] member) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zrank(key, member);
|
||||
}
|
||||
|
||||
public Integer zrevrank(byte[] key, byte[] member) {
|
||||
public Long zrevrank(byte[] key, byte[] member) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zrevrank(key, member);
|
||||
}
|
||||
@@ -310,7 +310,7 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.zrevrangeWithScores(key, start, end);
|
||||
}
|
||||
|
||||
public Integer zcard(byte[] key) {
|
||||
public Long zcard(byte[] key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zcard(key);
|
||||
}
|
||||
@@ -330,7 +330,7 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.sort(key, sortingParameters);
|
||||
}
|
||||
|
||||
public Integer zcount(byte[] key, double min, double max) {
|
||||
public Long zcount(byte[] key, double min, double max) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zcount(key, min, max);
|
||||
}
|
||||
@@ -357,17 +357,17 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.zrangeByScoreWithScores(key, min, max, offset, count);
|
||||
}
|
||||
|
||||
public Integer zremrangeByRank(byte[] key, int start, int end) {
|
||||
public Long zremrangeByRank(byte[] key, int start, int end) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zremrangeByRank(key, start, end);
|
||||
}
|
||||
|
||||
public Integer zremrangeByScore(byte[] key, double start, double end) {
|
||||
public Long zremrangeByScore(byte[] key, double start, double end) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zremrangeByScore(key, start, end);
|
||||
}
|
||||
|
||||
public Integer linsert(byte[] key, LIST_POSITION where, byte[] pivot,
|
||||
public Long linsert(byte[] key, LIST_POSITION where, byte[] pivot,
|
||||
byte[] value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.linsert(key, where, pivot, value);
|
||||
|
||||
@@ -163,9 +163,9 @@ public class Connection {
|
||||
return (byte[]) protocol.read(inputStream);
|
||||
}
|
||||
|
||||
public Integer getIntegerReply() {
|
||||
public Long getIntegerReply() {
|
||||
pipelinedCommands--;
|
||||
return (Integer) protocol.read(inputStream);
|
||||
return (Long) protocol.read(inputStream);
|
||||
}
|
||||
|
||||
public List<String> getMultiBulkReply() {
|
||||
|
||||
@@ -30,7 +30,8 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
super(shardInfo);
|
||||
}
|
||||
|
||||
public String ping() {
|
||||
@Override
|
||||
public String ping() {
|
||||
runChecks();
|
||||
client.ping();
|
||||
return client.getStatusCodeReply();
|
||||
@@ -71,7 +72,8 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
/**
|
||||
* Ask the server to silently close the connection.
|
||||
*/
|
||||
public void quit() {
|
||||
@Override
|
||||
public void quit() {
|
||||
runChecks();
|
||||
client.quit();
|
||||
}
|
||||
@@ -86,7 +88,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @param key
|
||||
* @return Integer reply, "0" if the key exists, otherwise "1"
|
||||
*/
|
||||
public Integer exists(final String key) {
|
||||
public Long exists(final String key) {
|
||||
runChecks();
|
||||
client.exists(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -102,7 +104,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically: an integer greater than 0 if one or
|
||||
* more keys were removed 0 if none of the specified key existed
|
||||
*/
|
||||
public Integer del(final String... keys) {
|
||||
public Long del(final String... keys) {
|
||||
runChecks();
|
||||
client.del(keys);
|
||||
return client.getIntegerReply();
|
||||
@@ -134,7 +136,8 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
*
|
||||
* @return Status code reply
|
||||
*/
|
||||
public String flushDB() {
|
||||
@Override
|
||||
public String flushDB() {
|
||||
runChecks();
|
||||
client.flushDB();
|
||||
return client.getStatusCodeReply();
|
||||
@@ -221,7 +224,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically: 1 if the key was renamed 0 if the
|
||||
* target key already exist
|
||||
*/
|
||||
public Integer renamenx(final String oldkey, final String newkey) {
|
||||
public Long renamenx(final String oldkey, final String newkey) {
|
||||
runChecks();
|
||||
client.renamenx(oldkey, newkey);
|
||||
return client.getIntegerReply();
|
||||
@@ -232,7 +235,8 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
*
|
||||
* @return Integer reply
|
||||
*/
|
||||
public Integer dbSize() {
|
||||
@Override
|
||||
public Long dbSize() {
|
||||
runChecks();
|
||||
client.dbSize();
|
||||
return client.getIntegerReply();
|
||||
@@ -266,7 +270,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* 2.1.3 will happily update the timeout), or the key does not
|
||||
* exist.
|
||||
*/
|
||||
public Integer expire(final String key, final int seconds) {
|
||||
public Long expire(final String key, final int seconds) {
|
||||
runChecks();
|
||||
client.expire(key, seconds);
|
||||
return client.getIntegerReply();
|
||||
@@ -302,7 +306,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* 2.1.3 will happily update the timeout), or the key does not
|
||||
* exist.
|
||||
*/
|
||||
public Integer expireAt(final String key, final long unixTime) {
|
||||
public Long expireAt(final String key, final long unixTime) {
|
||||
runChecks();
|
||||
client.expireAt(key, unixTime);
|
||||
return client.getIntegerReply();
|
||||
@@ -319,7 +323,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* key that has an EXPIRE. If the Key does not exists or does not
|
||||
* have an associated expire, -1 is returned.
|
||||
*/
|
||||
public Integer ttl(final String key) {
|
||||
public Long ttl(final String key) {
|
||||
runChecks();
|
||||
client.ttl(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -332,7 +336,8 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @param index
|
||||
* @return Status code reply
|
||||
*/
|
||||
public String select(final int index) {
|
||||
@Override
|
||||
public String select(final int index) {
|
||||
runChecks();
|
||||
client.select(index);
|
||||
return client.getStatusCodeReply();
|
||||
@@ -351,7 +356,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* was not moved because already present on the target DB or was not
|
||||
* found in the current DB.
|
||||
*/
|
||||
public Integer move(final String key, final int dbIndex) {
|
||||
public Long move(final String key, final int dbIndex) {
|
||||
runChecks();
|
||||
client.move(key, dbIndex);
|
||||
return client.getIntegerReply();
|
||||
@@ -363,7 +368,8 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
*
|
||||
* @return Status code reply
|
||||
*/
|
||||
public String flushAll() {
|
||||
@Override
|
||||
public String flushAll() {
|
||||
runChecks();
|
||||
client.flushAll();
|
||||
return client.getStatusCodeReply();
|
||||
@@ -414,7 +420,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically: 1 if the key was set 0 if the key
|
||||
* was not set
|
||||
*/
|
||||
public Integer setnx(final String key, final String value) {
|
||||
public Long setnx(final String key, final String value) {
|
||||
runChecks();
|
||||
client.setnx(key, value);
|
||||
return client.getIntegerReply();
|
||||
@@ -485,7 +491,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically: 1 if the all the keys were set 0 if
|
||||
* no key was set (at least one key already existed)
|
||||
*/
|
||||
public Integer msetnx(final String... keysvalues) {
|
||||
public Long msetnx(final String... keysvalues) {
|
||||
runChecks();
|
||||
client.msetnx(keysvalues);
|
||||
return client.getIntegerReply();
|
||||
@@ -513,7 +519,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, this commands will reply with the new value of key
|
||||
* after the increment.
|
||||
*/
|
||||
public Integer decrBy(final String key, final int integer) {
|
||||
public Long decrBy(final String key, final int integer) {
|
||||
runChecks();
|
||||
client.decrBy(key, integer);
|
||||
return client.getIntegerReply();
|
||||
@@ -541,7 +547,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, this commands will reply with the new value of key
|
||||
* after the increment.
|
||||
*/
|
||||
public Integer decr(final String key) {
|
||||
public Long decr(final String key) {
|
||||
runChecks();
|
||||
client.decr(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -569,7 +575,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, this commands will reply with the new value of key
|
||||
* after the increment.
|
||||
*/
|
||||
public Integer incrBy(final String key, final int integer) {
|
||||
public Long incrBy(final String key, final int integer) {
|
||||
runChecks();
|
||||
client.incrBy(key, integer);
|
||||
return client.getIntegerReply();
|
||||
@@ -597,7 +603,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, this commands will reply with the new value of key
|
||||
* after the increment.
|
||||
*/
|
||||
public Integer incr(final String key) {
|
||||
public Long incr(final String key) {
|
||||
runChecks();
|
||||
client.incr(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -619,7 +625,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically the total length of the string after
|
||||
* the append operation.
|
||||
*/
|
||||
public Integer append(final String key, final String value) {
|
||||
public Long append(final String key, final String value) {
|
||||
runChecks();
|
||||
client.append(key, value);
|
||||
return client.getIntegerReply();
|
||||
@@ -664,7 +670,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* of the value, 0 is returned, otherwise if a new field is created
|
||||
* 1 is returned.
|
||||
*/
|
||||
public Integer hset(final String key, final String field, final String value) {
|
||||
public Long hset(final String key, final String field, final String value) {
|
||||
runChecks();
|
||||
client.hset(key, field, value);
|
||||
return client.getIntegerReply();
|
||||
@@ -700,7 +706,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return If the field already exists, 0 is returned, otherwise if a new
|
||||
* field is created 1 is returned.
|
||||
*/
|
||||
public Integer hsetnx(final String key, final String field,
|
||||
public Long hsetnx(final String key, final String field,
|
||||
final String value) {
|
||||
runChecks();
|
||||
client.hsetnx(key, field, value);
|
||||
@@ -762,7 +768,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply The new value at field after the increment
|
||||
* operation.
|
||||
*/
|
||||
public Integer hincrBy(final String key, final String field, final int value) {
|
||||
public Long hincrBy(final String key, final String field, final int value) {
|
||||
runChecks();
|
||||
client.hincrBy(key, field, value);
|
||||
return client.getIntegerReply();
|
||||
@@ -778,7 +784,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Return 1 if the hash stored at key contains the specified field.
|
||||
* Return 0 if the key is not found or the field is not present.
|
||||
*/
|
||||
public Integer hexists(final String key, final String field) {
|
||||
public Long hexists(final String key, final String field) {
|
||||
runChecks();
|
||||
client.hexists(key, field);
|
||||
return client.getIntegerReply();
|
||||
@@ -794,7 +800,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return If the field was present in the hash it is deleted and 1 is
|
||||
* returned, otherwise 0 is returned and no operation is performed.
|
||||
*/
|
||||
public Integer hdel(final String key, final String field) {
|
||||
public Long hdel(final String key, final String field) {
|
||||
runChecks();
|
||||
client.hdel(key, field);
|
||||
return client.getIntegerReply();
|
||||
@@ -810,7 +816,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* key. If the specified key does not exist, 0 is returned assuming
|
||||
* an empty hash.
|
||||
*/
|
||||
public Integer hlen(final String key) {
|
||||
public Long hlen(final String key) {
|
||||
runChecks();
|
||||
client.hlen(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -882,7 +888,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically, the number of elements inside the
|
||||
* list after the push operation.
|
||||
*/
|
||||
public Integer rpush(final String key, final String string) {
|
||||
public Long rpush(final String key, final String string) {
|
||||
runChecks();
|
||||
client.rpush(key, string);
|
||||
return client.getIntegerReply();
|
||||
@@ -903,7 +909,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically, the number of elements inside the
|
||||
* list after the push operation.
|
||||
*/
|
||||
public Integer lpush(final String key, final String string) {
|
||||
public Long lpush(final String key, final String string) {
|
||||
runChecks();
|
||||
client.lpush(key, string);
|
||||
return client.getIntegerReply();
|
||||
@@ -919,7 +925,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @param key
|
||||
* @return The length of the list.
|
||||
*/
|
||||
public Integer llen(final String key) {
|
||||
public Long llen(final String key) {
|
||||
runChecks();
|
||||
client.llen(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -1079,7 +1085,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer Reply, specifically: The number of removed elements if
|
||||
* the operation succeeded
|
||||
*/
|
||||
public Integer lrem(final String key, final int count, final String value) {
|
||||
public Long lrem(final String key, final int count, final String value) {
|
||||
runChecks();
|
||||
client.lrem(key, count, value);
|
||||
return client.getIntegerReply();
|
||||
@@ -1160,7 +1166,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically: 1 if the new element was added 0 if
|
||||
* the element was already a member of the set
|
||||
*/
|
||||
public Integer sadd(final String key, final String member) {
|
||||
public Long sadd(final String key, final String member) {
|
||||
runChecks();
|
||||
client.sadd(key, member);
|
||||
return client.getIntegerReply();
|
||||
@@ -1194,7 +1200,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically: 1 if the new element was removed 0
|
||||
* if the new element was not a member of the set
|
||||
*/
|
||||
public Integer srem(final String key, final String member) {
|
||||
public Long srem(final String key, final String member) {
|
||||
runChecks();
|
||||
client.srem(key, member);
|
||||
return client.getIntegerReply();
|
||||
@@ -1241,7 +1247,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* element was not found on the first set and no operation was
|
||||
* performed
|
||||
*/
|
||||
public Integer smove(final String srckey, final String dstkey,
|
||||
public Long smove(final String srckey, final String dstkey,
|
||||
final String member) {
|
||||
runChecks();
|
||||
client.smove(srckey, dstkey, member);
|
||||
@@ -1256,7 +1262,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically: the cardinality (number of elements)
|
||||
* of the set as an integer.
|
||||
*/
|
||||
public Integer scard(final String key) {
|
||||
public Long scard(final String key) {
|
||||
runChecks();
|
||||
client.scard(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -1274,7 +1280,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* set 0 if the element is not a member of the set OR if the key
|
||||
* does not exist
|
||||
*/
|
||||
public Integer sismember(final String key, final String member) {
|
||||
public Long sismember(final String key, final String member) {
|
||||
runChecks();
|
||||
client.sismember(key, member);
|
||||
return client.getIntegerReply();
|
||||
@@ -1317,7 +1323,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @param keys
|
||||
* @return Status code reply
|
||||
*/
|
||||
public Integer sinterstore(final String dstkey, final String... keys) {
|
||||
public Long sinterstore(final String dstkey, final String... keys) {
|
||||
runChecks();
|
||||
client.sinterstore(dstkey, keys);
|
||||
return client.getIntegerReply();
|
||||
@@ -1358,7 +1364,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @param keys
|
||||
* @return Status code reply
|
||||
*/
|
||||
public Integer sunionstore(final String dstkey, final String... keys) {
|
||||
public Long sunionstore(final String dstkey, final String... keys) {
|
||||
runChecks();
|
||||
client.sunionstore(dstkey, keys);
|
||||
return client.getIntegerReply();
|
||||
@@ -1402,7 +1408,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @param keys
|
||||
* @return Status code reply
|
||||
*/
|
||||
public Integer sdiffstore(final String dstkey, final String... keys) {
|
||||
public Long sdiffstore(final String dstkey, final String... keys) {
|
||||
runChecks();
|
||||
client.sdiffstore(dstkey, keys);
|
||||
return client.getIntegerReply();
|
||||
@@ -1447,7 +1453,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* the element was already a member of the sorted set and the score
|
||||
* was updated
|
||||
*/
|
||||
public Integer zadd(final String key, final double score,
|
||||
public Long zadd(final String key, final double score,
|
||||
final String member) {
|
||||
runChecks();
|
||||
client.zadd(key, score, member);
|
||||
@@ -1476,7 +1482,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically: 1 if the new element was removed 0
|
||||
* if the new element was not a member of the set
|
||||
*/
|
||||
public Integer zrem(final String key, final String member) {
|
||||
public Long zrem(final String key, final String member) {
|
||||
runChecks();
|
||||
client.zrem(key, member);
|
||||
return client.getIntegerReply();
|
||||
@@ -1534,7 +1540,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* element as an integer reply if the element exists. A nil bulk
|
||||
* reply if there is no such element.
|
||||
*/
|
||||
public Integer zrank(final String key, final String member) {
|
||||
public Long zrank(final String key, final String member) {
|
||||
runChecks();
|
||||
client.zrank(key, member);
|
||||
return client.getIntegerReply();
|
||||
@@ -1560,7 +1566,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* element as an integer reply if the element exists. A nil bulk
|
||||
* reply if there is no such element.
|
||||
*/
|
||||
public Integer zrevrank(final String key, final String member) {
|
||||
public Long zrevrank(final String key, final String member) {
|
||||
runChecks();
|
||||
client.zrevrank(key, member);
|
||||
return client.getIntegerReply();
|
||||
@@ -1599,7 +1605,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @param key
|
||||
* @return the cardinality (number of elements) of the set as an integer.
|
||||
*/
|
||||
public Integer zcard(final String key) {
|
||||
public Long zcard(final String key) {
|
||||
runChecks();
|
||||
client.zcard(key);
|
||||
return client.getIntegerReply();
|
||||
@@ -1623,13 +1629,15 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
return (score != null ? new Double(score) : null);
|
||||
}
|
||||
|
||||
public Transaction multi() {
|
||||
@Override
|
||||
public Transaction multi() {
|
||||
client.multi();
|
||||
client.getStatusCodeReply();
|
||||
return new Transaction(client);
|
||||
}
|
||||
|
||||
public List<Object> multi(TransactionBlock jedisTransaction) {
|
||||
@Override
|
||||
public List<Object> multi(TransactionBlock jedisTransaction) {
|
||||
List<Object> results = null;
|
||||
try {
|
||||
jedisTransaction.setClient(client);
|
||||
@@ -1656,7 +1664,8 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
}
|
||||
}
|
||||
|
||||
public void connect() throws UnknownHostException, IOException {
|
||||
@Override
|
||||
public void connect() throws UnknownHostException, IOException {
|
||||
if (!client.isConnected()) {
|
||||
client.connect();
|
||||
if (this.password != null) {
|
||||
@@ -1665,7 +1674,8 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
}
|
||||
}
|
||||
|
||||
public void disconnect() throws IOException {
|
||||
@Override
|
||||
public void disconnect() throws IOException {
|
||||
client.disconnect();
|
||||
}
|
||||
|
||||
@@ -1880,7 +1890,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @param dstkey
|
||||
* @return The number of elements of the list at dstkey.
|
||||
*/
|
||||
public Integer sort(final String key,
|
||||
public Long sort(final String key,
|
||||
final SortingParams sortingParameters, final String dstkey) {
|
||||
runChecks();
|
||||
client.sort(key, sortingParameters, dstkey);
|
||||
@@ -1903,7 +1913,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @param dstkey
|
||||
* @return The number of elements of the list at dstkey.
|
||||
*/
|
||||
public Integer sort(final String key, final String dstkey) {
|
||||
public Long sort(final String key, final String dstkey) {
|
||||
runChecks();
|
||||
client.sort(key, dstkey);
|
||||
return client.getIntegerReply();
|
||||
@@ -2012,36 +2022,41 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @param password
|
||||
* @return Status code reply
|
||||
*/
|
||||
public String auth(final String password) {
|
||||
@Override
|
||||
public String auth(final String password) {
|
||||
runChecks();
|
||||
client.auth(password);
|
||||
return client.getStatusCodeReply();
|
||||
}
|
||||
|
||||
public List<Object> pipelined(JedisPipeline jedisPipeline) {
|
||||
@Override
|
||||
public List<Object> pipelined(JedisPipeline jedisPipeline) {
|
||||
jedisPipeline.setClient(client);
|
||||
jedisPipeline.execute();
|
||||
return client.getAll();
|
||||
}
|
||||
|
||||
public void subscribe(JedisPubSub jedisPubSub, String... channels) {
|
||||
@Override
|
||||
public void subscribe(JedisPubSub jedisPubSub, String... channels) {
|
||||
client.setTimeoutInfinite();
|
||||
jedisPubSub.proceed(client, channels);
|
||||
client.rollbackTimeout();
|
||||
}
|
||||
|
||||
public Integer publish(String channel, String message) {
|
||||
@Override
|
||||
public Long publish(String channel, String message) {
|
||||
client.publish(channel, message);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
|
||||
public void psubscribe(JedisPubSub jedisPubSub, String... patterns) {
|
||||
@Override
|
||||
public void psubscribe(JedisPubSub jedisPubSub, String... patterns) {
|
||||
client.setTimeoutInfinite();
|
||||
jedisPubSub.proceedWithPatterns(client, patterns);
|
||||
client.rollbackTimeout();
|
||||
}
|
||||
|
||||
public Integer zcount(final String key, final double min, final double max) {
|
||||
public Long zcount(final String key, final double min, final double max) {
|
||||
runChecks();
|
||||
client.zcount(key, min, max);
|
||||
return client.getIntegerReply();
|
||||
@@ -2336,7 +2351,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* operation
|
||||
*
|
||||
*/
|
||||
public Integer zremrangeByRank(final String key, final int start,
|
||||
public Long zremrangeByRank(final String key, final int start,
|
||||
final int end) {
|
||||
runChecks();
|
||||
client.zremrangeByRank(key, start, end);
|
||||
@@ -2357,7 +2372,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @param end
|
||||
* @return Integer reply, specifically the number of elements removed.
|
||||
*/
|
||||
public Integer zremrangeByScore(final String key, final double start,
|
||||
public Long zremrangeByScore(final String key, final double start,
|
||||
final double end) {
|
||||
runChecks();
|
||||
client.zremrangeByScore(key, start, end);
|
||||
@@ -2402,7 +2417,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically the number of elements in the sorted
|
||||
* set at dstkey
|
||||
*/
|
||||
public Integer zunionstore(final String dstkey, final String... sets) {
|
||||
public Long zunionstore(final String dstkey, final String... sets) {
|
||||
runChecks();
|
||||
client.zunionstore(dstkey, sets);
|
||||
return client.getIntegerReply();
|
||||
@@ -2447,7 +2462,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically the number of elements in the sorted
|
||||
* set at dstkey
|
||||
*/
|
||||
public Integer zunionstore(final String dstkey, final ZParams params,
|
||||
public Long zunionstore(final String dstkey, final ZParams params,
|
||||
final String... sets) {
|
||||
runChecks();
|
||||
client.zunionstore(dstkey, params, sets);
|
||||
@@ -2492,7 +2507,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically the number of elements in the sorted
|
||||
* set at dstkey
|
||||
*/
|
||||
public Integer zinterstore(final String dstkey, final String... sets) {
|
||||
public Long zinterstore(final String dstkey, final String... sets) {
|
||||
runChecks();
|
||||
client.zinterstore(dstkey, sets);
|
||||
return client.getIntegerReply();
|
||||
@@ -2537,19 +2552,19 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically the number of elements in the sorted
|
||||
* set at dstkey
|
||||
*/
|
||||
public Integer zinterstore(final String dstkey, final ZParams params,
|
||||
public Long zinterstore(final String dstkey, final ZParams params,
|
||||
final String... sets) {
|
||||
runChecks();
|
||||
client.zinterstore(dstkey, params, sets);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
|
||||
public Integer strlen(final String key) {
|
||||
public Long strlen(final String key) {
|
||||
client.strlen(key);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
|
||||
public Integer lpushx(final String key, final String string) {
|
||||
public Long lpushx(final String key, final String string) {
|
||||
client.lpushx(key, string);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
@@ -2564,12 +2579,12 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply, specifically: 1: the key is now persist. 0: the
|
||||
* key is not persist (only happens when key not set).
|
||||
*/
|
||||
public Integer persist(final String key) {
|
||||
public Long persist(final String key) {
|
||||
client.persist(key);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
|
||||
public Integer rpushx(final String key, final String string) {
|
||||
public Long rpushx(final String key, final String string) {
|
||||
client.rpushx(key, string);
|
||||
return client.getIntegerReply();
|
||||
}
|
||||
@@ -2579,7 +2594,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
return client.getBulkReply();
|
||||
}
|
||||
|
||||
public Integer linsert(final String key, final LIST_POSITION where,
|
||||
public Long linsert(final String key, final LIST_POSITION where,
|
||||
final String pivot, final String value) {
|
||||
client.linsert(key, where, pivot, value);
|
||||
return client.getIntegerReply();
|
||||
|
||||
@@ -13,51 +13,51 @@ public interface JedisCommands {
|
||||
|
||||
String get(String key);
|
||||
|
||||
Integer exists(String key);
|
||||
Long exists(String key);
|
||||
|
||||
String type(String key);
|
||||
|
||||
Integer expire(String key, int seconds);
|
||||
Long expire(String key, int seconds);
|
||||
|
||||
Integer expireAt(String key, long unixTime);
|
||||
Long expireAt(String key, long unixTime);
|
||||
|
||||
Integer ttl(String key);
|
||||
Long ttl(String key);
|
||||
|
||||
String getSet(String key, String value);
|
||||
|
||||
Integer setnx(String key, String value);
|
||||
Long setnx(String key, String value);
|
||||
|
||||
String setex(String key, int seconds, String value);
|
||||
|
||||
Integer decrBy(String key, int integer);
|
||||
Long decrBy(String key, int integer);
|
||||
|
||||
Integer decr(String key);
|
||||
Long decr(String key);
|
||||
|
||||
Integer incrBy(String key, int integer);
|
||||
Long incrBy(String key, int integer);
|
||||
|
||||
Integer incr(String key);
|
||||
Long incr(String key);
|
||||
|
||||
Integer append(String key, String value);
|
||||
Long append(String key, String value);
|
||||
|
||||
String substr(String key, int start, int end);
|
||||
|
||||
Integer hset(String key, String field, String value);
|
||||
Long hset(String key, String field, String value);
|
||||
|
||||
String hget(String key, String field);
|
||||
|
||||
Integer hsetnx(String key, String field, String value);
|
||||
Long hsetnx(String key, String field, String value);
|
||||
|
||||
String hmset(String key, Map<String, String> hash);
|
||||
|
||||
List<String> hmget(String key, String... fields);
|
||||
|
||||
Integer hincrBy(String key, String field, int value);
|
||||
Long hincrBy(String key, String field, int value);
|
||||
|
||||
Integer hexists(String key, String field);
|
||||
Long hexists(String key, String field);
|
||||
|
||||
Integer hdel(String key, String field);
|
||||
Long hdel(String key, String field);
|
||||
|
||||
Integer hlen(String key);
|
||||
Long hlen(String key);
|
||||
|
||||
Set<String> hkeys(String key);
|
||||
|
||||
@@ -65,11 +65,11 @@ public interface JedisCommands {
|
||||
|
||||
Map<String, String> hgetAll(String key);
|
||||
|
||||
Integer rpush(String key, String string);
|
||||
Long rpush(String key, String string);
|
||||
|
||||
Integer lpush(String key, String string);
|
||||
Long lpush(String key, String string);
|
||||
|
||||
Integer llen(String key);
|
||||
Long llen(String key);
|
||||
|
||||
List<String> lrange(String key, int start, int end);
|
||||
|
||||
@@ -79,37 +79,37 @@ public interface JedisCommands {
|
||||
|
||||
String lset(String key, int index, String value);
|
||||
|
||||
Integer lrem(String key, int count, String value);
|
||||
Long lrem(String key, int count, String value);
|
||||
|
||||
String lpop(String key);
|
||||
|
||||
String rpop(String key);
|
||||
|
||||
Integer sadd(String key, String member);
|
||||
Long sadd(String key, String member);
|
||||
|
||||
Set<String> smembers(String key);
|
||||
|
||||
Integer srem(String key, String member);
|
||||
Long srem(String key, String member);
|
||||
|
||||
String spop(String key);
|
||||
|
||||
Integer scard(String key);
|
||||
Long scard(String key);
|
||||
|
||||
Integer sismember(String key, String member);
|
||||
Long sismember(String key, String member);
|
||||
|
||||
String srandmember(String key);
|
||||
|
||||
Integer zadd(String key, double score, String member);
|
||||
Long zadd(String key, double score, String member);
|
||||
|
||||
Set<String> zrange(String key, int start, int end);
|
||||
|
||||
Integer zrem(String key, String member);
|
||||
Long zrem(String key, String member);
|
||||
|
||||
Double zincrby(String key, double score, String member);
|
||||
|
||||
Integer zrank(String key, String member);
|
||||
Long zrank(String key, String member);
|
||||
|
||||
Integer zrevrank(String key, String member);
|
||||
Long zrevrank(String key, String member);
|
||||
|
||||
Set<String> zrevrange(String key, int start, int end);
|
||||
|
||||
@@ -117,7 +117,7 @@ public interface JedisCommands {
|
||||
|
||||
Set<Tuple> zrevrangeWithScores(String key, int start, int end);
|
||||
|
||||
Integer zcard(String key);
|
||||
Long zcard(String key);
|
||||
|
||||
Double zscore(String key, String member);
|
||||
|
||||
@@ -125,7 +125,7 @@ public interface JedisCommands {
|
||||
|
||||
List<String> sort(String key, SortingParams sortingParameters);
|
||||
|
||||
Integer zcount(String key, double min, double max);
|
||||
Long zcount(String key, double min, double max);
|
||||
|
||||
Set<String> zrangeByScore(String key, double min, double max);
|
||||
|
||||
@@ -137,10 +137,10 @@ public interface JedisCommands {
|
||||
Set<Tuple> zrangeByScoreWithScores(String key, double min,
|
||||
double max, int offset, int count);
|
||||
|
||||
Integer zremrangeByRank(String key, int start, int end);
|
||||
Long zremrangeByRank(String key, int start, int end);
|
||||
|
||||
Integer zremrangeByScore(String key, double start, double end);
|
||||
Long zremrangeByScore(String key, double start, double end);
|
||||
|
||||
Integer linsert(String key, Client.LIST_POSITION where, String pivot,
|
||||
Long linsert(String key, Client.LIST_POSITION where, String pivot,
|
||||
String value);
|
||||
}
|
||||
|
||||
@@ -78,13 +78,13 @@ public abstract class JedisPubSub {
|
||||
}
|
||||
final byte[] resp = (byte[]) firstObj;
|
||||
if (Arrays.equals(SUBSCRIBE.raw, resp)) {
|
||||
subscribedChannels = ((Integer) reply.get(2)).intValue();
|
||||
subscribedChannels = ((Long) reply.get(2)).intValue();
|
||||
final byte[] bchannel = (byte[]) reply.get(1);
|
||||
final String strchannel = (bchannel == null) ? null
|
||||
: SafeEncoder.encode(bchannel);
|
||||
onSubscribe(strchannel, subscribedChannels);
|
||||
} else if (Arrays.equals(UNSUBSCRIBE.raw, resp)) {
|
||||
subscribedChannels = ((Integer) reply.get(2)).intValue();
|
||||
subscribedChannels = ((Long) reply.get(2)).intValue();
|
||||
final byte[] bchannel = (byte[]) reply.get(1);
|
||||
final String strchannel = (bchannel == null) ? null
|
||||
: SafeEncoder.encode(bchannel);
|
||||
@@ -109,13 +109,13 @@ public abstract class JedisPubSub {
|
||||
.encode(bmesg);
|
||||
onPMessage(strpattern, strchannel, strmesg);
|
||||
} else if (Arrays.equals(PSUBSCRIBE.raw, resp)) {
|
||||
subscribedChannels = ((Integer) reply.get(2)).intValue();
|
||||
subscribedChannels = ((Long) reply.get(2)).intValue();
|
||||
final byte[] bpattern = (byte[]) reply.get(1);
|
||||
final String strpattern = (bpattern == null) ? null
|
||||
: SafeEncoder.encode(bpattern);
|
||||
onPSubscribe(strpattern, subscribedChannels);
|
||||
} else if (Arrays.equals(PUNSUBSCRIBE.raw, resp)) {
|
||||
subscribedChannels = ((Integer) reply.get(2)).intValue();
|
||||
subscribedChannels = ((Long) reply.get(2)).intValue();
|
||||
final byte[] bpattern = (byte[]) reply.get(1);
|
||||
final String strpattern = (bpattern == null) ? null
|
||||
: SafeEncoder.encode(bpattern);
|
||||
|
||||
@@ -100,9 +100,9 @@ public final class Protocol {
|
||||
return read;
|
||||
}
|
||||
|
||||
private Integer processInteger(final RedisInputStream is) {
|
||||
private Long processInteger(final RedisInputStream is) {
|
||||
String num = is.readLine();
|
||||
return Integer.valueOf(num);
|
||||
return Long.valueOf(num);
|
||||
}
|
||||
|
||||
private List<Object> processMultiBulkReply(final RedisInputStream is) {
|
||||
|
||||
@@ -28,7 +28,8 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
super(shards, algo, keyTagPattern);
|
||||
}
|
||||
|
||||
public void disconnect() throws IOException {
|
||||
@Override
|
||||
public void disconnect() throws IOException {
|
||||
for (Jedis jedis : getAllShards()) {
|
||||
jedis.quit();
|
||||
jedis.disconnect();
|
||||
@@ -45,7 +46,7 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.get(key);
|
||||
}
|
||||
|
||||
public Integer exists(String key) {
|
||||
public Long exists(String key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.exists(key);
|
||||
}
|
||||
@@ -55,17 +56,17 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.type(key);
|
||||
}
|
||||
|
||||
public Integer expire(String key, int seconds) {
|
||||
public Long expire(String key, int seconds) {
|
||||
Jedis j = getShard(key);
|
||||
return j.expire(key, seconds);
|
||||
}
|
||||
|
||||
public Integer expireAt(String key, long unixTime) {
|
||||
public Long expireAt(String key, long unixTime) {
|
||||
Jedis j = getShard(key);
|
||||
return j.expireAt(key, unixTime);
|
||||
}
|
||||
|
||||
public Integer ttl(String key) {
|
||||
public Long ttl(String key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.ttl(key);
|
||||
}
|
||||
@@ -75,7 +76,7 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.getSet(key, value);
|
||||
}
|
||||
|
||||
public Integer setnx(String key, String value) {
|
||||
public Long setnx(String key, String value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.setnx(key, value);
|
||||
}
|
||||
@@ -85,27 +86,27 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.setex(key, seconds, value);
|
||||
}
|
||||
|
||||
public Integer decrBy(String key, int integer) {
|
||||
public Long decrBy(String key, int integer) {
|
||||
Jedis j = getShard(key);
|
||||
return j.decrBy(key, integer);
|
||||
}
|
||||
|
||||
public Integer decr(String key) {
|
||||
public Long decr(String key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.decr(key);
|
||||
}
|
||||
|
||||
public Integer incrBy(String key, int integer) {
|
||||
public Long incrBy(String key, int integer) {
|
||||
Jedis j = getShard(key);
|
||||
return j.incrBy(key, integer);
|
||||
}
|
||||
|
||||
public Integer incr(String key) {
|
||||
public Long incr(String key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.incr(key);
|
||||
}
|
||||
|
||||
public Integer append(String key, String value) {
|
||||
public Long append(String key, String value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.append(key, value);
|
||||
}
|
||||
@@ -115,7 +116,7 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.substr(key, start, end);
|
||||
}
|
||||
|
||||
public Integer hset(String key, String field, String value) {
|
||||
public Long hset(String key, String field, String value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.hset(key, field, value);
|
||||
}
|
||||
@@ -125,7 +126,7 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.hget(key, field);
|
||||
}
|
||||
|
||||
public Integer hsetnx(String key, String field, String value) {
|
||||
public Long hsetnx(String key, String field, String value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.hsetnx(key, field, value);
|
||||
}
|
||||
@@ -140,22 +141,22 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.hmget(key, fields);
|
||||
}
|
||||
|
||||
public Integer hincrBy(String key, String field, int value) {
|
||||
public Long hincrBy(String key, String field, int value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.hincrBy(key, field, value);
|
||||
}
|
||||
|
||||
public Integer hexists(String key, String field) {
|
||||
public Long hexists(String key, String field) {
|
||||
Jedis j = getShard(key);
|
||||
return j.hexists(key, field);
|
||||
}
|
||||
|
||||
public Integer hdel(String key, String field) {
|
||||
public Long hdel(String key, String field) {
|
||||
Jedis j = getShard(key);
|
||||
return j.hdel(key, field);
|
||||
}
|
||||
|
||||
public Integer hlen(String key) {
|
||||
public Long hlen(String key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.hlen(key);
|
||||
}
|
||||
@@ -175,17 +176,17 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.hgetAll(key);
|
||||
}
|
||||
|
||||
public Integer rpush(String key, String string) {
|
||||
public Long rpush(String key, String string) {
|
||||
Jedis j = getShard(key);
|
||||
return j.rpush(key, string);
|
||||
}
|
||||
|
||||
public Integer lpush(String key, String string) {
|
||||
public Long lpush(String key, String string) {
|
||||
Jedis j = getShard(key);
|
||||
return j.lpush(key, string);
|
||||
}
|
||||
|
||||
public Integer llen(String key) {
|
||||
public Long llen(String key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.llen(key);
|
||||
}
|
||||
@@ -210,7 +211,7 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.lset(key, index, value);
|
||||
}
|
||||
|
||||
public Integer lrem(String key, int count, String value) {
|
||||
public Long lrem(String key, int count, String value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.lrem(key, count, value);
|
||||
}
|
||||
@@ -225,7 +226,7 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.rpop(key);
|
||||
}
|
||||
|
||||
public Integer sadd(String key, String member) {
|
||||
public Long sadd(String key, String member) {
|
||||
Jedis j = getShard(key);
|
||||
return j.sadd(key, member);
|
||||
}
|
||||
@@ -235,7 +236,7 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.smembers(key);
|
||||
}
|
||||
|
||||
public Integer srem(String key, String member) {
|
||||
public Long srem(String key, String member) {
|
||||
Jedis j = getShard(key);
|
||||
return j.srem(key, member);
|
||||
}
|
||||
@@ -245,12 +246,12 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.spop(key);
|
||||
}
|
||||
|
||||
public Integer scard(String key) {
|
||||
public Long scard(String key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.scard(key);
|
||||
}
|
||||
|
||||
public Integer sismember(String key, String member) {
|
||||
public Long sismember(String key, String member) {
|
||||
Jedis j = getShard(key);
|
||||
return j.sismember(key, member);
|
||||
}
|
||||
@@ -260,7 +261,7 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.srandmember(key);
|
||||
}
|
||||
|
||||
public Integer zadd(String key, double score, String member) {
|
||||
public Long zadd(String key, double score, String member) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zadd(key, score, member);
|
||||
}
|
||||
@@ -270,7 +271,7 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.zrange(key, start, end);
|
||||
}
|
||||
|
||||
public Integer zrem(String key, String member) {
|
||||
public Long zrem(String key, String member) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zrem(key, member);
|
||||
}
|
||||
@@ -280,12 +281,12 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.zincrby(key, score, member);
|
||||
}
|
||||
|
||||
public Integer zrank(String key, String member) {
|
||||
public Long zrank(String key, String member) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zrank(key, member);
|
||||
}
|
||||
|
||||
public Integer zrevrank(String key, String member) {
|
||||
public Long zrevrank(String key, String member) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zrevrank(key, member);
|
||||
}
|
||||
@@ -305,7 +306,7 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.zrevrangeWithScores(key, start, end);
|
||||
}
|
||||
|
||||
public Integer zcard(String key) {
|
||||
public Long zcard(String key) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zcard(key);
|
||||
}
|
||||
@@ -325,7 +326,7 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.sort(key, sortingParameters);
|
||||
}
|
||||
|
||||
public Integer zcount(String key, double min, double max) {
|
||||
public Long zcount(String key, double min, double max) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zcount(key, min, max);
|
||||
}
|
||||
@@ -352,17 +353,17 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.zrangeByScoreWithScores(key, min, max, offset, count);
|
||||
}
|
||||
|
||||
public Integer zremrangeByRank(String key, int start, int end) {
|
||||
public Long zremrangeByRank(String key, int start, int end) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zremrangeByRank(key, start, end);
|
||||
}
|
||||
|
||||
public Integer zremrangeByScore(String key, double start, double end) {
|
||||
public Long zremrangeByScore(String key, double start, double end) {
|
||||
Jedis j = getShard(key);
|
||||
return j.zremrangeByScore(key, start, end);
|
||||
}
|
||||
|
||||
public Integer linsert(String key, LIST_POSITION where, String pivot,
|
||||
public Long linsert(String key, LIST_POSITION where, String pivot,
|
||||
String value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.linsert(key, where, pivot, value);
|
||||
|
||||
Reference in New Issue
Block a user