Package io.kroxylicious.proxy.frame
Class OpaqueFrame
java.lang.Object
io.kroxylicious.proxy.frame.OpaqueFrame
- All Implemented Interfaces:
Frame
- Direct Known Subclasses:
OpaqueRequestFrame,OpaqueResponseFrame
A frame in the Kafka protocol which has not been decoded.
The wrapped buffer does not include the frame size prefix.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final io.netty.buffer.ByteBufThe message buffer excluding the frame size, including the header and body.protected final intprotected final intFields inherited from interface io.kroxylicious.proxy.frame.Frame
FRAME_SIZE_LENGTH -
Method Summary
Modifier and TypeMethodDescriptionshortapiKeyId()Api key id of this frame.shortApi version of this frame.io.netty.buffer.ByteBufbuf()intThe correlation id.voidencode(ByteBufAccessor out) Write the frame, including the size prefix, to the given bufferintEstimate the expected encoded size in bytes of thisFrame.
In particular, written data byFrame.encode(ByteBufAccessor)should be the same as reported by this method.booleantrue if this frame is decoded, false otherwisevoidReleases the underlying buffer.toString()
-
Field Details
-
length
protected final int length -
correlationId
protected final int correlationId -
buf
protected final io.netty.buffer.ByteBuf bufThe message buffer excluding the frame size, including the header and body.
-
-
Method Details
-
apiKeyId
public short apiKeyId()Description copied from interface:FrameApi key id of this frame. -
apiVersion
public short apiVersion()Description copied from interface:FrameApi version of this frame.- Specified by:
apiVersionin interfaceFrame
-
correlationId
public int correlationId()Description copied from interface:FrameThe correlation id.- Specified by:
correlationIdin interfaceFrame- Returns:
- The correlation id.
-
isDecoded
public boolean isDecoded()Description copied from interface:Frametrue if this frame is decoded, false otherwise -
estimateEncodedSize
public int estimateEncodedSize()Description copied from interface:FrameEstimate the expected encoded size in bytes of thisFrame.
In particular, written data byFrame.encode(ByteBufAccessor)should be the same as reported by this method.- Specified by:
estimateEncodedSizein interfaceFrame
-
encode
Description copied from interface:FrameWrite the frame, including the size prefix, to the given 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
-