Package io.aeron.protocol
Class NakFlyweight
java.lang.Object
org.agrona.AbstractMutableDirectBuffer
org.agrona.concurrent.UnsafeBuffer
io.aeron.protocol.HeaderFlyweight
io.aeron.protocol.NakFlyweight
- All Implemented Interfaces:
Comparable<DirectBuffer>,AtomicBuffer,DirectBuffer,MutableDirectBuffer
Flyweight for a NAK Message Frame.
Data Loss Recovery wiki page.
-
Field Summary
FieldsFields inherited from class io.aeron.protocol.HeaderFlyweight
CURRENT_VERSION, FLAGS_FIELD_OFFSET, FRAME_LENGTH_FIELD_OFFSET, HDR_TYPE_ATS_DATA, HDR_TYPE_ATS_SETUP, HDR_TYPE_ATS_SM, HDR_TYPE_DATA, HDR_TYPE_ERR, HDR_TYPE_EXT, HDR_TYPE_NAK, HDR_TYPE_PAD, HDR_TYPE_RES, HDR_TYPE_RSP_SETUP, HDR_TYPE_RTTM, HDR_TYPE_SETUP, HDR_TYPE_SM, MIN_HEADER_LENGTH, TYPE_FIELD_OFFSET, VERSION_FIELD_OFFSETFields inherited from class org.agrona.concurrent.UnsafeBuffer
ALIGNMENT, DISABLE_BOUNDS_CHECKS_PROP_NAME, SHOULD_BOUNDS_CHECKFields inherited from class org.agrona.AbstractMutableDirectBuffer
addressOffset, byteArray, capacityFields inherited from interface org.agrona.concurrent.AtomicBuffer
STRICT_ALIGNMENT_CHECKS, STRICT_ALIGNMENT_CHECKS_PROP_NAMEFields inherited from interface org.agrona.DirectBuffer
DISABLE_ARRAY_CONTENT_PRINTOUT_PROP_NAME, STR_HEADER_LEN -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor which can later be used to wrap a frame.NakFlyweight(ByteBuffer buffer) Construct the flyweight over a frame.NakFlyweight(UnsafeBuffer buffer) Construct the flyweight over a frame. -
Method Summary
Modifier and TypeMethodDescriptionintlength()The length of the encoded frame.length(int length) Set length of the encoded frame.intThe session-id for the stream.sessionId(int sessionId) Set session-id for the stream.intstreamId()The stream-id for the stream.streamId(int streamId) Set stream-id for the stream.inttermId()The term-id for the stream.termId(int termId) Set term-id for the stream.intThe term-offset for the stream.termOffset(int termOffset) Set term-offset for the stream.toString()Methods inherited from class io.aeron.protocol.HeaderFlyweight
appendFlagsAsChars, flags, flags, flagsToChars, frameLength, frameLength, headerType, headerType, version, versionMethods inherited from class org.agrona.concurrent.UnsafeBuffer
addIntOpaque, addIntOrdered, addIntRelease, addLongOpaque, addLongOrdered, addLongRelease, byteBuffer, compareAndExchangeInt, compareAndExchangeLong, compareAndSetInt, compareAndSetLong, ensureCapacity, getAndAddInt, getAndAddLong, getAndSetInt, getAndSetLong, getByteVolatile, getCharVolatile, getIntAcquire, getIntOpaque, getIntVolatile, getLongAcquire, getLongOpaque, getLongVolatile, getShortVolatile, isExpandable, putByteVolatile, putCharVolatile, putIntOpaque, putIntOrdered, putIntRelease, putIntVolatile, putLongOpaque, putLongOrdered, putLongRelease, putLongVolatile, putShortVolatile, verifyAlignment, wrap, wrap, wrap, wrap, wrap, wrap, wrap, wrapAdjustmentMethods inherited from class org.agrona.AbstractMutableDirectBuffer
addressOffset, boundsCheck, boundsCheck0, byteArray, capacity, checkLimit, compareTo, equals, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getChar, getChar, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, getShort, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringUtf8, getStringUtf8, getStringUtf8, getStringWithoutLengthAscii, getStringWithoutLengthAscii, getStringWithoutLengthUtf8, hashCode, parseIntAscii, parseLongAscii, parseNaturalIntAscii, parseNaturalLongAscii, putByte, putBytes, putBytes, putBytes, putBytes, putBytes, putChar, putChar, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putIntAscii, putLong, putLong, putLongAscii, putNaturalIntAscii, putNaturalIntAsciiFromEnd, putNaturalLongAscii, putNaturalPaddedIntAscii, putShort, putShort, putStringAscii, putStringAscii, putStringAscii, putStringAscii, putStringUtf8, putStringUtf8, putStringUtf8, putStringUtf8, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthUtf8, setMemoryMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.agrona.DirectBuffer
addressOffset, boundsCheck, byteArray, capacity, checkLimit, getByte, getBytes, getBytes, getBytes, getBytes, getBytes, getChar, getChar, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, getShort, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringAscii, getStringUtf8, getStringUtf8, getStringUtf8, getStringWithoutLengthAscii, getStringWithoutLengthAscii, getStringWithoutLengthUtf8, parseIntAscii, parseLongAscii, parseNaturalIntAscii, parseNaturalLongAsciiMethods inherited from interface org.agrona.MutableDirectBuffer
putByte, putBytes, putBytes, putBytes, putBytes, putBytes, putChar, putChar, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putIntAscii, putLong, putLong, putLongAscii, putNaturalIntAscii, putNaturalIntAsciiFromEnd, putNaturalLongAscii, putNaturalPaddedIntAscii, putShort, putShort, putStringAscii, putStringAscii, putStringAscii, putStringAscii, putStringUtf8, putStringUtf8, putStringUtf8, putStringUtf8, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthAscii, putStringWithoutLengthUtf8, setMemory
-
Field Details
-
HEADER_LENGTH
public static final int HEADER_LENGTHLength of the frame in bytes.- See Also:
-
-
Constructor Details
-
NakFlyweight
public NakFlyweight()Default constructor which can later be used to wrap a frame. -
NakFlyweight
Construct the flyweight over a frame.- Parameters:
buffer- containing the frame.
-
NakFlyweight
Construct the flyweight over a frame.- Parameters:
buffer- containing the frame.
-
-
Method Details
-
sessionId
public int sessionId()The session-id for the stream.- Returns:
- session-id for the stream.
-
sessionId
Set session-id for the stream.- Parameters:
sessionId- session-id for the stream.- Returns:
- this for a fluent API.
-
streamId
public int streamId()The stream-id for the stream.- Returns:
- stream-id for the stream.
-
streamId
Set stream-id for the stream.- Parameters:
streamId- stream-id for the stream.- Returns:
- this for a fluent API.
-
termId
public int termId()The term-id for the stream.- Returns:
- term-id for the stream.
-
termId
Set term-id for the stream.- Parameters:
termId- term-id for the stream.- Returns:
- this for a fluent API.
-
termOffset
public int termOffset()The term-offset for the stream.- Returns:
- term-offset for the stream.
-
termOffset
Set term-offset for the stream.- Parameters:
termOffset- term-offset for the stream.- Returns:
- for a fluent API.
-
length
public int length()The length of the encoded frame.- Returns:
- length of the encoded frame.
-
length
Set length of the encoded frame.- Parameters:
length- of the encoded frame.- Returns:
- this for a fluent API.
-
toString
- Overrides:
toStringin classUnsafeBuffer
-