Class BatchDecoder

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.ByteToMessageDecoder
org.apache.nifi.processors.beats.handler.BatchDecoder
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

public class BatchDecoder extends io.netty.handler.codec.ByteToMessageDecoder
Byte Buffer to Batch Decoder parses bytes to batches of Beats messages
  • Field Details

  • Constructor Details

    • BatchDecoder

      public BatchDecoder(ComponentLog log)
      Beats Batch Decoder with required arguments
      Parameters:
      log - Processor Log
  • Method Details

    • decode

      protected void decode(io.netty.channel.ChannelHandlerContext context, io.netty.buffer.ByteBuf buffer, List<Object> objects)
      Decode Batch of Beats Messages from Byte Buffer
      Specified by:
      decode in class io.netty.handler.codec.ByteToMessageDecoder
      Parameters:
      context - Channel Handler Context
      buffer - Byte Buffer
      objects - List of Batch objects
    • decodeFrameType

      private void decodeFrameType(FrameType frameType, io.netty.channel.ChannelHandlerContext context, io.netty.buffer.ByteBuf buffer, List<Object> batches)
    • processWindowSize

      private void processWindowSize(io.netty.channel.ChannelHandlerContext context, io.netty.buffer.ByteBuf buffer)
    • processCompressed

      private void processCompressed(io.netty.channel.ChannelHandlerContext context, io.netty.buffer.ByteBuf buffer, List<Object> batches)
    • processCompressed

      private void processCompressed(io.netty.channel.ChannelHandlerContext context, io.netty.buffer.ByteBuf buffer, int compressedSize, List<Object> batches)
    • processJson

      private void processJson(io.netty.channel.ChannelHandlerContext context, io.netty.buffer.ByteBuf buffer, List<Object> batches)
    • processJson

      private void processJson(int sequenceNumber, int payloadSize, io.netty.channel.ChannelHandlerContext context, io.netty.buffer.ByteBuf buffer, List<Object> batches)
    • readJsonMessage

      private BatchMessage readJsonMessage(io.netty.channel.ChannelHandlerContext context, int sequenceNumber, int payloadSize, io.netty.buffer.ByteBuf buffer)
    • getRemoteHostAddress

      private String getRemoteHostAddress(io.netty.channel.Channel channel)
    • processBatchMessage

      private void processBatchMessage(BatchMessage batchMessage, List<Object> batches)
    • readCompressedBuffer

      private void readCompressedBuffer(io.netty.buffer.ByteBuf compressedBuffer, io.netty.buffer.ByteBuf inflated, int compressedSize)
    • readSequenceNumber

      private Integer readSequenceNumber(io.netty.buffer.ByteBuf buffer)
    • readPayloadSize

      private Integer readPayloadSize(io.netty.buffer.ByteBuf buffer)
    • readCompressedSize

      private Integer readCompressedSize(io.netty.buffer.ByteBuf buffer)
    • readUnsignedInteger

      private Integer readUnsignedInteger(io.netty.buffer.ByteBuf buffer)
    • readFrameType

      private FrameType readFrameType(io.netty.buffer.ByteBuf buffer)
    • readVersion

      private ProtocolVersion readVersion(io.netty.buffer.ByteBuf buffer)
    • resetSequenceVersionPayloadSize

      private void resetSequenceVersionPayloadSize()
    • resetFrameTypeVersion

      private void resetFrameTypeVersion()
    • resetWindowSize

      private void resetWindowSize()