Browse files

hincr, incr and decr long support

  • Loading branch information...
1 parent ff8ac4c commit afd34c8af65650c7fda894286ea7c72927d1f948 Jonathan Leibiusky committed Dec 10, 2010
View
6 src/main/java/redis/clients/jedis/BinaryClient.java
@@ -140,15 +140,15 @@ public void msetnx(final byte[]... keysvalues) {
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));
}
public void decr(final byte[] key) {
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 void hmget(final byte[] key, final byte[]... fields) {
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));
}
View
6 src/main/java/redis/clients/jedis/BinaryJedis.java
@@ -520,7 +520,7 @@ public Long msetnx(final byte[]... keysvalues) {
* @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 Long decr(final byte[] key) {
* @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 String hmset(final byte[] key, final Map<byte[], byte[]> hash) {
* @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();
View
6 src/main/java/redis/clients/jedis/BinaryJedisCommands.java
@@ -31,11 +31,11 @@
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 @@
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);
View
6 src/main/java/redis/clients/jedis/BinaryShardedJedis.java
@@ -90,7 +90,7 @@ public String setex(byte[] key, int seconds, byte[] value) {
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 Long decr(byte[] key) {
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 String hmset(byte[] key, Map<byte[], byte[]> hash) {
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);
}
View
6 src/main/java/redis/clients/jedis/Client.java
@@ -103,15 +103,15 @@ public void msetnx(final String... keysvalues) {
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);
}
public void decr(final String key) {
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 void hmget(final String key, final String... fields) {
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);
}
View
6 src/main/java/redis/clients/jedis/Commands.java
@@ -42,11 +42,11 @@
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 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);
View
6 src/main/java/redis/clients/jedis/Jedis.java
@@ -518,7 +518,7 @@ public Long msetnx(final String... keysvalues) {
* @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 Long decr(final String key) {
* @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 String hmset(final String key, final Map<String, String> hash) {
* @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();
View
6 src/main/java/redis/clients/jedis/JedisCommands.java
@@ -29,11 +29,11 @@
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 @@
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);
View
6 src/main/java/redis/clients/jedis/Pipeline.java
@@ -28,7 +28,7 @@ public void decr(String key) {
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 void hgetAll(String key) {
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 void incr(String key) {
client.incr(key);
}
- public void incrBy(String key, int integer) {
+ public void incrBy(String key, long integer) {
client.incrBy(key, integer);
}
View
6 src/main/java/redis/clients/jedis/PipelineBlock.java
@@ -27,7 +27,7 @@ public void decr(String key) {
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 void hgetAll(String key) {
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 void incr(String key) {
client.incr(key);
}
- public void incrBy(String key, int integer) {
+ public void incrBy(String key, long integer) {
client.incrBy(key, integer);
}
View
6 src/main/java/redis/clients/jedis/ShardedJedis.java
@@ -86,7 +86,7 @@ public String setex(String key, int seconds, String value) {
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 Long decr(String key) {
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 String hmset(String key, Map<String, String> hash) {
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);
}

0 comments on commit afd34c8

Please sign in to comment.