Package org.agrona.concurrent.broadcast
Class BroadcastBufferDescriptor
java.lang.Object
org.agrona.concurrent.broadcast.BroadcastBufferDescriptor
Layout of the broadcast buffer. The buffer consists of a ring of messages that is a power of 2 in size.
This is followed by a trailer section containing state information about the ring.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Offset within the trailer for where the latest sequence value is stored.static final int
Offset within the trailer for where the tail value is stored.static final int
Offset within the trailer for where the tail intended value is stored.static final int
Total size of the trailer. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkCapacity
(int capacity) Check the buffer capacity is the correct size.
-
Field Details
-
TAIL_INTENT_COUNTER_OFFSET
public static final int TAIL_INTENT_COUNTER_OFFSETOffset within the trailer for where the tail intended value is stored. -
TAIL_COUNTER_OFFSET
public static final int TAIL_COUNTER_OFFSETOffset within the trailer for where the tail value is stored. -
LATEST_COUNTER_OFFSET
public static final int LATEST_COUNTER_OFFSETOffset within the trailer for where the latest sequence value is stored. -
TRAILER_LENGTH
public static final int TRAILER_LENGTHTotal size of the trailer.
-
-
Constructor Details
-
BroadcastBufferDescriptor
private BroadcastBufferDescriptor()
-
-
Method Details
-
checkCapacity
public static void checkCapacity(int capacity) Check the buffer capacity is the correct size.- Parameters:
capacity
- to be checked.- Throws:
IllegalStateException
- if the buffer capacity is not a power of 2.
-