-
Notifications
You must be signed in to change notification settings - Fork 615
/
DBSIZE.java
29 lines (24 loc) · 928 Bytes
/
DBSIZE.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package org.infinispan.server.resp.commands.connection;
import java.util.List;
import java.util.concurrent.CompletionStage;
import org.infinispan.server.resp.Consumers;
import org.infinispan.server.resp.Resp3Handler;
import org.infinispan.server.resp.RespCommand;
import org.infinispan.server.resp.RespRequestHandler;
import org.infinispan.server.resp.commands.Resp3Command;
import io.netty.channel.ChannelHandlerContext;
/**
* <a href="https://redis.io/commands/dbsize/">DBSIZE</a>
*
* @since 15.0
*/
public class DBSIZE extends RespCommand implements Resp3Command {
public DBSIZE() {
super(1, 0, 0, 0);
}
@Override
public CompletionStage<RespRequestHandler> perform(Resp3Handler handler, ChannelHandlerContext ctx,
List<byte[]> arguments) {
return handler.stageToReturn(handler.cache().sizeAsync(), ctx, Consumers.LONG_BICONSUMER);
}
}