Package io.kroxylicious.proxy.frame
Class DecodedFrame<H extends org.apache.kafka.common.protocol.ApiMessage,B extends org.apache.kafka.common.protocol.ApiMessage>
java.lang.Object
io.netty.util.AbstractReferenceCounted
io.kroxylicious.proxy.frame.DecodedFrame<H,B>
- Type Parameters:
H- The header typeB- The body type
- All Implemented Interfaces:
Frame,io.netty.util.ReferenceCounted
- Direct Known Subclasses:
DecodedRequestFrame,DecodedResponseFrame
public abstract class DecodedFrame<H extends org.apache.kafka.common.protocol.ApiMessage,B extends org.apache.kafka.common.protocol.ApiMessage>
extends io.netty.util.AbstractReferenceCounted
implements Frame
A frame that has been decoded (as opposed to an
OpaqueFrame).-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final shortprotected final Bprotected final intprotected final HFields inherited from interface io.kroxylicious.proxy.frame.Frame
FRAME_SIZE_LENGTH -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(io.netty.buffer.ByteBuf buffer) org.apache.kafka.common.protocol.ApiKeysapiKey()shortapiKeyId()Api key id of this frame.shortApi version of this frame.body()intThe correlation id.protected voidfinal voidencode(ByteBufAccessor out) Write the frame, including the size prefix, to the given bufferfinal intEstimate the expected encoded size in bytes of thisFrame.
In particular, written data byFrame.encode(ByteBufAccessor)should be the same as reported by this method.header()protected abstract shortbooleantrue if this frame is decoded, false otherwisetoString()io.netty.util.ReferenceCountedvoidtransferBuffersTo(DecodedFrame<?, ?> frame) Methods inherited from class io.netty.util.AbstractReferenceCounted
refCnt, release, release, retain, retain, setRefCnt, touch
-
Field Details
-
apiVersion
protected final short apiVersion -
correlationId
protected final int correlationId -
header
-
body
-
-
Method Details
-
correlationId
public int correlationId()Description copied from interface:FrameThe correlation id.- Specified by:
correlationIdin interfaceFrame- Returns:
- The correlation id.
-
apiKeyId
public short apiKeyId()Description copied from interface:FrameApi key id of this frame. -
apiKey
public org.apache.kafka.common.protocol.ApiKeys apiKey() -
apiVersion
public short apiVersion()Description copied from interface:FrameApi version of this frame.- Specified by:
apiVersionin interfaceFrame
-
isDecoded
public boolean isDecoded()Description copied from interface:Frametrue if this frame is decoded, false otherwise -
headerVersion
protected abstract short headerVersion() -
header
-
body
-
estimateEncodedSize
public final 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 -
toString
-
add
public void add(io.netty.buffer.ByteBuf buffer) -
touch
- Specified by:
touchin interfaceio.netty.util.ReferenceCounted
-
deallocate
protected void deallocate()- Specified by:
deallocatein classio.netty.util.AbstractReferenceCounted
-
transferBuffersTo
-