Support Sorted Set with LEX commands

* new commands : ZLEXCOUNT, ZRANGEBYLEX, ZREMRANGEBYLEX
** added commands to Jedis, ShardedJedis, JedisCluster, PipelineBase with Binary
/ Normal(String)
** description links
*** http://redis.io/commands/zlexcount
*** http://redis.io/commands/zrangebylex
*** http://redis.io/commands/zremrangebylex
** Unit test included
This commit is contained in:
Jungtaek Lim
2014-04-22 23:39:37 +09:00
parent ac53759f97
commit 409740f06c
14 changed files with 396 additions and 2 deletions

View File

@@ -2732,6 +2732,35 @@ public class BinaryJedis implements BasicCommands, BinaryJedisCommands,
return client.getIntegerReply();
}
@Override
public Long zlexcount(final byte[] key, final byte[] min, final byte[] max) {
checkIsInMulti();
client.zlexcount(key, min, max);
return client.getIntegerReply();
}
@Override
public Set<byte[]> zrangeByLex(final byte[] key, final byte[] min, final byte[] max) {
checkIsInMulti();
client.zrangeByLex(key, min, max);
return new LinkedHashSet<byte[]>(client.getBinaryMultiBulkReply());
}
@Override
public Set<byte[]> zrangeByLex(final byte[] key, final byte[] min, final byte[] max,
final int offset, final int count) {
checkIsInMulti();
client.zrangeByLex(key, min, max, offset, count);
return new LinkedHashSet<byte[]>(client.getBinaryMultiBulkReply());
}
@Override
public Long zremrangeByLex(final byte[] key, final byte[] min, final byte[] max) {
checkIsInMulti();
client.zremrangeByLex(key, min, max);
return client.getIntegerReply();
}
/**
* Synchronously save the DB on disk.
* <p>