Package org.apache.hadoop.hbase.ipc
Class NettyRpcFrameDecoder
java.lang.Object
org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerAdapter
org.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandlerAdapter
org.apache.hbase.thirdparty.io.netty.handler.codec.ByteToMessageDecoder
org.apache.hadoop.hbase.ipc.NettyRpcFrameDecoder
- All Implemented Interfaces:
org.apache.hbase.thirdparty.io.netty.channel.ChannelHandler
,org.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandler
@Private
class NettyRpcFrameDecoder
extends org.apache.hbase.thirdparty.io.netty.handler.codec.ByteToMessageDecoder
Decoder for extracting frame
- Since:
- 2.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hbase.thirdparty.io.netty.handler.codec.ByteToMessageDecoder
org.apache.hbase.thirdparty.io.netty.handler.codec.ByteToMessageDecoder.Cumulator
Nested classes/interfaces inherited from interface org.apache.hbase.thirdparty.io.netty.channel.ChannelHandler
org.apache.hbase.thirdparty.io.netty.channel.ChannelHandler.Sharable
-
Field Summary
Modifier and TypeFieldDescription(package private) final NettyServerRpcConnection
private static int
private final int
private boolean
private String
private boolean
Fields inherited from class org.apache.hbase.thirdparty.io.netty.handler.codec.ByteToMessageDecoder
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
-
Constructor Summary
ConstructorDescriptionNettyRpcFrameDecoder
(int maxFrameLength, NettyServerRpcConnection connection) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
decode
(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf in, List<Object> out) private org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader
getHeader
(org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf in, int headerSize) private void
handleTooBigRequest
(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf in) private static int
readRawVarint32
(org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf buffer) Reads variable length 32bit int from buffer This method is from ProtobufVarint32FrameDecoder in Netty and modified a little bit to pass the cyeckstyle rule.Methods inherited from class org.apache.hbase.thirdparty.io.netty.handler.codec.ByteToMessageDecoder
actualReadableBytes, callDecode, channelInactive, channelRead, channelReadComplete, decodeLast, discardSomeReadBytes, handlerRemoved, handlerRemoved0, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
Methods inherited from class org.apache.hbase.thirdparty.io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
Methods inherited from class org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hbase.thirdparty.io.netty.channel.ChannelHandler
handlerAdded
-
Field Details
-
FRAME_LENGTH_FIELD_LENGTH
-
maxFrameLength
-
connection
-
requestTooBig
-
requestTooBigSent
-
requestTooBigMessage
-
-
Constructor Details
-
NettyRpcFrameDecoder
-
-
Method Details
-
decode
protected void decode(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf in, List<Object> out) throws Exception - Specified by:
decode
in classorg.apache.hbase.thirdparty.io.netty.handler.codec.ByteToMessageDecoder
- Throws:
Exception
-
handleTooBigRequest
private void handleTooBigRequest(org.apache.hbase.thirdparty.io.netty.channel.ChannelHandlerContext ctx, org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf in) throws IOException - Throws:
IOException
-
getHeader
private org.apache.hadoop.hbase.shaded.protobuf.generated.RPCProtos.RequestHeader getHeader(org.apache.hbase.thirdparty.io.netty.buffer.ByteBuf in, int headerSize) throws IOException - Throws:
IOException
-
readRawVarint32
Reads variable length 32bit int from buffer This method is from ProtobufVarint32FrameDecoder in Netty and modified a little bit to pass the cyeckstyle rule.- Returns:
- decoded int if buffers readerIndex has been forwarded else nonsense value
-