Adding setbit/getbit to ShardedJedis
This commit is contained in:
committed by
Jonathan Leibiusky
parent
ffebfe120b
commit
e12f655fa3
@@ -23,6 +23,10 @@ public interface JedisCommands {
|
|||||||
|
|
||||||
Long ttl(String key);
|
Long ttl(String key);
|
||||||
|
|
||||||
|
boolean setbit(String key, long offset, boolean value);
|
||||||
|
|
||||||
|
boolean getbit(String key, long offset);
|
||||||
|
|
||||||
String getSet(String key, String value);
|
String getSet(String key, String value);
|
||||||
|
|
||||||
Long setnx(String key, String value);
|
Long setnx(String key, String value);
|
||||||
|
|||||||
@@ -69,6 +69,16 @@ public class ShardedJedis extends BinaryShardedJedis implements JedisCommands {
|
|||||||
return j.ttl(key);
|
return j.ttl(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean setbit(String key, long offset, boolean value) {
|
||||||
|
Jedis j = getShard(key);
|
||||||
|
return j.setbit(key, offset, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getbit(String key, long offset) {
|
||||||
|
Jedis j = getShard(key);
|
||||||
|
return j.getbit(key, offset);
|
||||||
|
}
|
||||||
|
|
||||||
public String getSet(String key, String value) {
|
public String getSet(String key, String value) {
|
||||||
Jedis j = getShard(key);
|
Jedis j = getShard(key);
|
||||||
return j.getSet(key, value);
|
return j.getSet(key, value);
|
||||||
|
|||||||
Reference in New Issue
Block a user