hincr, incr and decr long support
This commit is contained in:
@@ -140,7 +140,7 @@ public class BinaryClient extends Connection {
|
||||
sendCommand(MSETNX, keysvalues);
|
||||
}
|
||||
|
||||
public void decrBy(final byte[] key, final int integer) {
|
||||
public void decrBy(final byte[] key, final long integer) {
|
||||
sendCommand(DECRBY, key, toByteArray(integer));
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ public class BinaryClient extends Connection {
|
||||
sendCommand(DECR, key);
|
||||
}
|
||||
|
||||
public void incrBy(final byte[] key, final int integer) {
|
||||
public void incrBy(final byte[] key, final long integer) {
|
||||
sendCommand(INCRBY, key, toByteArray(integer));
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ public class BinaryClient extends Connection {
|
||||
sendCommand(HMGET, params);
|
||||
}
|
||||
|
||||
public void hincrBy(final byte[] key, final byte[] field, final int value) {
|
||||
public void hincrBy(final byte[] key, final byte[] field, final long value) {
|
||||
sendCommand(HINCRBY, key, field, toByteArray(value));
|
||||
}
|
||||
|
||||
|
||||
@@ -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 Long decrBy(final byte[] key, final int integer) {
|
||||
public Long decrBy(final byte[] key, final long integer) {
|
||||
checkIsInMulti();
|
||||
client.decrBy(key, integer);
|
||||
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 Long incrBy(final byte[] key, final int integer) {
|
||||
public Long incrBy(final byte[] key, final long integer) {
|
||||
checkIsInMulti();
|
||||
client.incrBy(key, integer);
|
||||
return client.getIntegerReply();
|
||||
@@ -768,7 +768,7 @@ public class BinaryJedis implements BinaryJedisCommands {
|
||||
* @return Integer reply The new value at field after the increment
|
||||
* operation.
|
||||
*/
|
||||
public Long hincrBy(final byte[] key, final byte[] field, final int value) {
|
||||
public Long hincrBy(final byte[] key, final byte[] field, final long value) {
|
||||
checkIsInMulti();
|
||||
client.hincrBy(key, field, value);
|
||||
return client.getIntegerReply();
|
||||
|
||||
@@ -31,11 +31,11 @@ public interface BinaryJedisCommands {
|
||||
|
||||
String setex(byte[] key, int seconds, byte[] value);
|
||||
|
||||
Long decrBy(byte[] key, int integer);
|
||||
Long decrBy(byte[] key, long integer);
|
||||
|
||||
Long decr(byte[] key);
|
||||
|
||||
Long incrBy(byte[] key, int integer);
|
||||
Long incrBy(byte[] key, long integer);
|
||||
|
||||
Long incr(byte[] key);
|
||||
|
||||
@@ -53,7 +53,7 @@ public interface BinaryJedisCommands {
|
||||
|
||||
List<byte[]> hmget(byte[] key, byte[]... fields);
|
||||
|
||||
Long hincrBy(byte[] key, byte[] field, int value);
|
||||
Long hincrBy(byte[] key, byte[] field, long value);
|
||||
|
||||
Boolean hexists(byte[] key, byte[] field);
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.setex(key, seconds, value);
|
||||
}
|
||||
|
||||
public Long decrBy(byte[] key, int integer) {
|
||||
public Long decrBy(byte[] key, long integer) {
|
||||
Jedis j = getShard(key);
|
||||
return j.decrBy(key, integer);
|
||||
}
|
||||
@@ -100,7 +100,7 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.decr(key);
|
||||
}
|
||||
|
||||
public Long incrBy(byte[] key, int integer) {
|
||||
public Long incrBy(byte[] key, long integer) {
|
||||
Jedis j = getShard(key);
|
||||
return j.incrBy(key, integer);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ public class BinaryShardedJedis extends Sharded<Jedis, JedisShardInfo>
|
||||
return j.hmget(key, fields);
|
||||
}
|
||||
|
||||
public Long hincrBy(byte[] key, byte[] field, int value) {
|
||||
public Long hincrBy(byte[] key, byte[] field, long value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.hincrBy(key, field, value);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public class Client extends BinaryClient implements Commands {
|
||||
msetnx(bkeysvalues);
|
||||
}
|
||||
|
||||
public void decrBy(final String key, final int integer) {
|
||||
public void decrBy(final String key, final long integer) {
|
||||
decrBy(SafeEncoder.encode(key), integer);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class Client extends BinaryClient implements Commands {
|
||||
decr(SafeEncoder.encode(key));
|
||||
}
|
||||
|
||||
public void incrBy(final String key, final int integer) {
|
||||
public void incrBy(final String key, final long integer) {
|
||||
incrBy(SafeEncoder.encode(key), integer);
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@ public class Client extends BinaryClient implements Commands {
|
||||
hmget(SafeEncoder.encode(key), bfields);
|
||||
}
|
||||
|
||||
public void hincrBy(final String key, final String field, final int value) {
|
||||
public void hincrBy(final String key, final String field, final long value) {
|
||||
hincrBy(SafeEncoder.encode(key), SafeEncoder.encode(field), value);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,11 +42,11 @@ public interface Commands {
|
||||
|
||||
public void msetnx(final String... keysvalues);
|
||||
|
||||
public void decrBy(final String key, final int integer);
|
||||
public void decrBy(final String key, final long integer);
|
||||
|
||||
public void decr(final String key);
|
||||
|
||||
public void incrBy(final String key, final int integer);
|
||||
public void incrBy(final String key, final long integer);
|
||||
|
||||
public void incr(final String key);
|
||||
|
||||
@@ -64,7 +64,7 @@ public interface Commands {
|
||||
|
||||
public void hmget(final String key, final String... fields);
|
||||
|
||||
public void hincrBy(final String key, final String field, final int value);
|
||||
public void hincrBy(final String key, final String field, final long value);
|
||||
|
||||
public void hexists(final String key, final String field);
|
||||
|
||||
|
||||
@@ -518,7 +518,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 Long decrBy(final String key, final int integer) {
|
||||
public Long decrBy(final String key, final long integer) {
|
||||
runChecks();
|
||||
client.decrBy(key, integer);
|
||||
return client.getIntegerReply();
|
||||
@@ -574,7 +574,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 Long incrBy(final String key, final int integer) {
|
||||
public Long incrBy(final String key, final long integer) {
|
||||
runChecks();
|
||||
client.incrBy(key, integer);
|
||||
return client.getIntegerReply();
|
||||
@@ -766,7 +766,7 @@ public class Jedis extends BinaryJedis implements JedisCommands {
|
||||
* @return Integer reply The new value at field after the increment
|
||||
* operation.
|
||||
*/
|
||||
public Long hincrBy(final String key, final String field, final int value) {
|
||||
public Long hincrBy(final String key, final String field, final long value) {
|
||||
runChecks();
|
||||
client.hincrBy(key, field, value);
|
||||
return client.getIntegerReply();
|
||||
|
||||
@@ -29,11 +29,11 @@ public interface JedisCommands {
|
||||
|
||||
String setex(String key, int seconds, String value);
|
||||
|
||||
Long decrBy(String key, int integer);
|
||||
Long decrBy(String key, long integer);
|
||||
|
||||
Long decr(String key);
|
||||
|
||||
Long incrBy(String key, int integer);
|
||||
Long incrBy(String key, long integer);
|
||||
|
||||
Long incr(String key);
|
||||
|
||||
@@ -51,7 +51,7 @@ public interface JedisCommands {
|
||||
|
||||
List<String> hmget(String key, String... fields);
|
||||
|
||||
Long hincrBy(String key, String field, int value);
|
||||
Long hincrBy(String key, String field, long value);
|
||||
|
||||
Boolean hexists(String key, String field);
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class Pipeline implements Commands {
|
||||
client.decr(key);
|
||||
}
|
||||
|
||||
public void decrBy(String key, int integer) {
|
||||
public void decrBy(String key, long integer) {
|
||||
client.decrBy(key, integer);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class Pipeline implements Commands {
|
||||
client.hgetAll(key);
|
||||
}
|
||||
|
||||
public void hincrBy(String key, String field, int value) {
|
||||
public void hincrBy(String key, String field, long value) {
|
||||
client.hincrBy(key, field, value);
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ public class Pipeline implements Commands {
|
||||
client.incr(key);
|
||||
}
|
||||
|
||||
public void incrBy(String key, int integer) {
|
||||
public void incrBy(String key, long integer) {
|
||||
client.incrBy(key, integer);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public abstract class PipelineBlock implements Commands {
|
||||
client.decr(key);
|
||||
}
|
||||
|
||||
public void decrBy(String key, int integer) {
|
||||
public void decrBy(String key, long integer) {
|
||||
client.decrBy(key, integer);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public abstract class PipelineBlock implements Commands {
|
||||
client.hgetAll(key);
|
||||
}
|
||||
|
||||
public void hincrBy(String key, String field, int value) {
|
||||
public void hincrBy(String key, String field, long value) {
|
||||
client.hincrBy(key, field, value);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public abstract class PipelineBlock implements Commands {
|
||||
client.incr(key);
|
||||
}
|
||||
|
||||
public void incrBy(String key, int integer) {
|
||||
public void incrBy(String key, long integer) {
|
||||
client.incrBy(key, integer);
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.setex(key, seconds, value);
|
||||
}
|
||||
|
||||
public Long decrBy(String key, int integer) {
|
||||
public Long decrBy(String key, long integer) {
|
||||
Jedis j = getShard(key);
|
||||
return j.decrBy(key, integer);
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.decr(key);
|
||||
}
|
||||
|
||||
public Long incrBy(String key, int integer) {
|
||||
public Long incrBy(String key, long integer) {
|
||||
Jedis j = getShard(key);
|
||||
return j.incrBy(key, integer);
|
||||
}
|
||||
@@ -141,7 +141,7 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
||||
return j.hmget(key, fields);
|
||||
}
|
||||
|
||||
public Long hincrBy(String key, String field, int value) {
|
||||
public Long hincrBy(String key, String field, long value) {
|
||||
Jedis j = getShard(key);
|
||||
return j.hincrBy(key, field, value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user