Class NettyMessageClientDecoderDelegate
java.lang.Object
org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerAdapter
org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter
org.apache.flink.runtime.io.network.netty.NettyMessageClientDecoderDelegate
- All Implemented Interfaces:
org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler,org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler
public class NettyMessageClientDecoderDelegate
extends org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter
Decodes messages from the received netty buffers. This decoder assumes the messages have the
following format: +-----------------------------------+--------------------------------+ |
FRAME_HEADER || MESSAGE_HEADER | DATA BUFFER (Optional) |
+-----------------------------------+--------------------------------+
This decoder decodes the frame header and delegates the following work to the corresponding message decoders according to the message type. During this process The frame header and message header are only accumulated if they span received multiple netty buffers, and the data buffer is copied directly to the buffer of corresponding input channel to avoid more copying.
The format of the frame header is +------------------+------------------+--------+ | FRAME LENGTH (4) | MAGIC NUMBER (4) | ID (1) | +------------------+------------------+--------+
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler
org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler.Sharable -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelActive(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx) voidchannelInactive(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx) Releases resources when the channel is closed.voidchannelRead(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx, Object msg) Methods inherited from class org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Method Details
-
channelActive
public void channelActive(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx) throws Exception - Specified by:
channelActivein interfaceorg.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler- Overrides:
channelActivein classorg.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-
channelInactive
public void channelInactive(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx) throws Exception Releases resources when the channel is closed. When exceptions are thrown during processing received netty buffers,CreditBasedPartitionRequestClientHandleris expected to catch the exception and close the channel and trigger this notification.- Specified by:
channelInactivein interfaceorg.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler- Overrides:
channelInactivein classorg.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter- Parameters:
ctx- The context of the channel close notification.- Throws:
Exception
-
channelRead
public void channelRead(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx, Object msg) throws Exception - Specified by:
channelReadin interfaceorg.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classorg.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter- Throws:
Exception
-