Interface Frame

All Known Subinterfaces:
RequestFrame, ResponseFrame
All Known Implementing Classes:
BareSaslRequest, BareSaslResponse, DecodedFrame, DecodedRequestFrame, DecodedResponseFrame, InternalRequestFrame, InternalResponseFrame, OpaqueFrame, OpaqueRequestFrame, OpaqueResponseFrame

public interface Frame
A frame in the Kafka protocol, which may or may not be fully decoded.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Number of bytes required for storing the frame length.
  • Method Summary

    Modifier and Type
    Method
    Description
    short
    Api key id of this frame.
    short
    Api version of this frame.
    int
    The correlation id.
    void
    Write the frame, including the size prefix, to the given buffer
    int
    Estimate the expected encoded size in bytes of this Frame.
    In particular, written data by encode(ByteBufAccessor) should be the same as reported by this method.
    boolean
    true if this frame is decoded, false otherwise
  • Field Details

    • FRAME_SIZE_LENGTH

      static final int FRAME_SIZE_LENGTH
      Number of bytes required for storing the frame length.
      See Also:
  • Method Details

    • estimateEncodedSize

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

      void encode(ByteBufAccessor out)
      Write the frame, including the size prefix, to the given buffer
      Parameters:
      out - The output buffer
    • correlationId

      int correlationId()
      The correlation id.
      Returns:
      The correlation id.
    • apiKeyId

      short apiKeyId()
      Api key id of this frame.
    • apiVersion

      short apiVersion()
      Api version of this frame.
    • isDecoded

      boolean isDecoded()
      true if this frame is decoded, false otherwise