@ -131,4 +131,11 @@ public interface RedisNode {
*/
void bgRewriteAOF();
/**
* Returns keys amount stored in this Redis node.
*
* @return keys amount
long size();
}
@ -123,4 +123,11 @@ public interface RedisNodeAsync {
RFuture<Void> bgRewriteAOFAsync();
RFuture<Long> sizeAsync();
@ -389,4 +389,15 @@ public class RedisNode implements RedisClusterMaster, RedisClusterSlave, RedisMa
public RFuture<Void> bgRewriteAOFAsync() {
return commandExecutor.writeAsync(client, StringCodec.INSTANCE, RedisCommands.BGREWRITEAOF);
@Override
public long size() {
return commandExecutor.get(sizeAsync());
public RFuture<Long> sizeAsync() {
return commandExecutor.writeAsync(client, StringCodec.INSTANCE, RedisCommands.DBSIZE);
@ -320,4 +320,15 @@ public class SentinelRedisNode implements RedisSentinel, RedisSentinelAsync {
return executeAsync(null, StringCodec.INSTANCE, -1, RedisCommands.BGREWRITEAOF);
return commandAsyncService.get(sizeAsync());
return executeAsync(null, StringCodec.INSTANCE, -1, RedisCommands.DBSIZE);