Class OpaqueFrame

java.lang.Object
io.kroxylicious.proxy.frame.OpaqueFrame
All Implemented Interfaces:
Frame
Direct Known Subclasses:
OpaqueRequestFrame, OpaqueResponseFrame

public abstract class OpaqueFrame extends Object implements Frame
A frame in the Kafka protocol which has not been decoded. The wrapped buffer does not include the frame size prefix.
  • Field Details

    • length

      protected final int length
    • correlationId

      protected final int correlationId
    • buf

      protected final io.netty.buffer.ByteBuf buf
      The message buffer excluding the frame size, including the header and body.
  • Method Details

    • apiKeyId

      public short apiKeyId()
      Description copied from interface: Frame
      Api key id of this frame.
      Specified by:
      apiKeyId in interface Frame
    • apiVersion

      public short apiVersion()
      Description copied from interface: Frame
      Api version of this frame.
      Specified by:
      apiVersion in interface Frame
    • correlationId

      public int correlationId()
      Description copied from interface: Frame
      The correlation id.
      Specified by:
      correlationId in interface Frame
      Returns:
      The correlation id.
    • isDecoded

      public boolean isDecoded()
      Description copied from interface: Frame
      true if this frame is decoded, false otherwise
      Specified by:
      isDecoded in interface Frame
    • estimateEncodedSize

      public int estimateEncodedSize()
      Description copied from interface: Frame
      Estimate the expected encoded size in bytes of this Frame.
      In particular, written data by Frame.encode(ByteBufAccessor) should be the same as reported by this method.
      Specified by:
      estimateEncodedSize in interface Frame
    • encode

      public void encode(ByteBufAccessor out)
      Description copied from interface: Frame
      Write the frame, including the size prefix, to the given buffer
      Specified by:
      encode in interface Frame
      Parameters:
      out - The output buffer
    • releaseBuffer

      public void releaseBuffer()
      Releases the underlying buffer. This is used in the situation where the proxy knows that the frame cannot be forwarded to the upstream or downstream (probably owing to previous network error) and the proxy needs to release the buffer to prevent a resource leak.
    • buf

      @VisibleForTesting public io.netty.buffer.ByteBuf buf()
    • toString

      public String toString()
      Overrides:
      toString in class Object