Package org.infinispan.server.resp
Class RespRequestHandler
java.lang.Object
org.infinispan.server.resp.RespRequestHandler
- Direct Known Subclasses:
CacheRespRequestHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final io.netty.util.AttributeKey<ByteBufPool>protected final CompletionStage<RespRequestHandler> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CompletionStage<RespRequestHandler>actualHandleRequest(io.netty.channel.ChannelHandlerContext ctx, RespCommand type, List<byte[]> arguments) Handles the RESP request returning a stage that when complete notifies the command has completed as well as providing the request handler for subsequent commands.protected static io.netty.buffer.ByteBufbytesToResult(byte[] result, ByteBufPool alloc) voidhandleChannelDisconnect(io.netty.channel.ChannelHandlerContext ctx) handleRequest(io.netty.channel.ChannelHandlerContext ctx, RespCommand type, List<byte[]> arguments) protected voidinitializeIfNecessary(io.netty.channel.ChannelHandlerContext ctx) protected static intsetIntChars(int i, int index, io.netty.buffer.ByteBuf buf) protected <E> CompletionStage<RespRequestHandler>stageToReturn(CompletionStage<E> stage, io.netty.channel.ChannelHandlerContext ctx, BiConsumer<? super E, ByteBufPool> biConsumer) protected <E> CompletionStage<RespRequestHandler>stageToReturn(CompletionStage<E> stage, io.netty.channel.ChannelHandlerContext ctx, Function<E, RespRequestHandler> handlerWhenComplete) protected static intstringSize(int x) protected static io.netty.buffer.ByteBufstringToByteBuf(CharSequence string, ByteBufPool alloc) protected static io.netty.buffer.ByteBufstringToByteBufWithExtra(CharSequence string, ByteBufPool alloc, int extraBytes)
-
Field Details
-
myStage
-
BYTE_BUF_POOL_ATTRIBUTE_KEY
-
-
Constructor Details
-
RespRequestHandler
public RespRequestHandler()
-
-
Method Details
-
initializeIfNecessary
protected void initializeIfNecessary(io.netty.channel.ChannelHandlerContext ctx) -
handleRequest
public final CompletionStage<RespRequestHandler> handleRequest(io.netty.channel.ChannelHandlerContext ctx, RespCommand type, List<byte[]> arguments) -
actualHandleRequest
protected CompletionStage<RespRequestHandler> actualHandleRequest(io.netty.channel.ChannelHandlerContext ctx, RespCommand type, List<byte[]> arguments) Handles the RESP request returning a stage that when complete notifies the command has completed as well as providing the request handler for subsequent commands.Implementations should never use the ByteBufAllocator in the context. Instead, they should use
allocatorToUseto retrieve a ByteBuffer. This ByteBuffer should only have bytes written to it adding up to the size requested. The ByteBuffer itself should never be written to the context or channel and flush should also never be invoked. Failure to do so may cause mis-ordering or responses as requests support pipelining and a ByteBuf may not be send down stream until later in the pipeline.- Parameters:
ctx- Netty context pipeline for this requesttype- The command typearguments- The remaining arguments to the command- Returns:
- stage that when complete returns the new handler to instate. This stage must be completed on the event loop
-
handleChannelDisconnect
public void handleChannelDisconnect(io.netty.channel.ChannelHandlerContext ctx) -
stageToReturn
protected <E> CompletionStage<RespRequestHandler> stageToReturn(CompletionStage<E> stage, io.netty.channel.ChannelHandlerContext ctx, BiConsumer<? super E, ByteBufPool> biConsumer) -
stageToReturn
protected <E> CompletionStage<RespRequestHandler> stageToReturn(CompletionStage<E> stage, io.netty.channel.ChannelHandlerContext ctx, Function<E, RespRequestHandler> handlerWhenComplete) -
stringToByteBufWithExtra
protected static io.netty.buffer.ByteBuf stringToByteBufWithExtra(CharSequence string, ByteBufPool alloc, int extraBytes) -
stringToByteBuf
-
bytesToResult
-
stringSize
protected static int stringSize(int x) -
setIntChars
protected static int setIntChars(int i, int index, io.netty.buffer.ByteBuf buf)
-