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

@@ -1008,6 +1008,56 @@ abstract class PipelineBase extends Queable implements BinaryRedisPipeline,
return getResponse(BuilderFactory.DOUBLE);
}
@Override
public Response<Long> zlexcount(final byte[] key, final byte[] min, final byte[] max) {
getClient(key).zlexcount(key, min, max);
return getResponse(BuilderFactory.LONG);
}
@Override
public Response<Long> zlexcount(final String key, final String min, final String max) {
getClient(key).zlexcount(key, min, max);
return getResponse(BuilderFactory.LONG);
}
@Override
public Response<Set<byte[]>> zrangeByLex(final byte[] key, final byte[] max, final byte[] min) {
getClient(key).zrangeByLex(key, min, max);
return getResponse(BuilderFactory.BYTE_ARRAY_ZSET);
}
@Override
public Response<Set<String>> zrangeByLex(final String key, final String max, final String min) {
getClient(key).zrangeByLex(key, min, max);
return getResponse(BuilderFactory.STRING_ZSET);
}
@Override
public Response<Set<byte[]>> zrangeByLex(final byte[] key, final byte[] max,
final byte[] min, final int offset, final int count) {
getClient(key).zrangeByLex(key, min, max, offset, count);
return getResponse(BuilderFactory.BYTE_ARRAY_ZSET);
}
@Override
public Response<Set<String>> zrangeByLex(final String key, final String max,
final String min, final int offset, final int count) {
getClient(key).zrangeByLex(key, min, max, offset, count);
return getResponse(BuilderFactory.STRING_ZSET);
}
@Override
public Response<Long> zremrangeByLex(final byte[] key, final byte[] min, final byte[] max) {
getClient(key).zremrangeByLex(key, min, max);
return getResponse(BuilderFactory.LONG);
}
@Override
public Response<Long> zremrangeByLex(final String key, final String min, final String max) {
getClient(key).zremrangeByLex(key, min, max);
return getResponse(BuilderFactory.LONG);
}
public Response<Long> bitcount(String key) {
getClient(key).bitcount(key);
return getResponse(BuilderFactory.LONG);