Package io.pravega.shared.protocol.netty
Class AppendDecoder
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.handler.codec.MessageToMessageDecoder<WireCommand>
-
- io.pravega.shared.protocol.netty.AppendDecoder
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
public class AppendDecoder extends io.netty.handler.codec.MessageToMessageDecoder<WireCommand>
AppendBlocks are decoded specially to avoid having to parse every append individually. This is done by holding onto the AppendBlock command and waiting for the following command which must be an AppendBlockEnd. The AppendBlockEnd command should have all of the information need to construct a single Append object with all of the Events in the block.The
decode(io.netty.channel.ChannelHandlerContext, io.pravega.shared.protocol.netty.WireCommand, java.util.List<java.lang.Object>)method invokesprocessCommand(WireCommand)to generateRequestinstances. Please refer toprocessCommand(WireCommand)Javadoc for important information about returned objects.
-
-
Constructor Summary
Constructors Constructor Description AppendDecoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptInboundMessage(java.lang.Object msg)protected voiddecode(io.netty.channel.ChannelHandlerContext ctx, WireCommand command, java.util.List<java.lang.Object> out)-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Method Detail
-
acceptInboundMessage
public boolean acceptInboundMessage(java.lang.Object msg) throws java.lang.Exception- Overrides:
acceptInboundMessagein classio.netty.handler.codec.MessageToMessageDecoder<WireCommand>- Throws:
java.lang.Exception
-
decode
protected void decode(io.netty.channel.ChannelHandlerContext ctx, WireCommand command, java.util.List<java.lang.Object> out) throws java.lang.Exception- Specified by:
decodein classio.netty.handler.codec.MessageToMessageDecoder<WireCommand>- Throws:
java.lang.Exception
-
-