Class LogBufferDescriptor
java.lang.Object
io.camunda.zeebe.dispatcher.impl.log.LogBufferDescriptor
Describes data layout in the log buffer
+----------------------------+ | Partition 0 | +----------------------------+ | Partition 1 | +----------------------------+ | Partition 2 | +----------------------------+ | Partition Meta Data 0 | +----------------------------+ | Partition Meta Data 1 | +----------------------------+ | Partition Meta Data 2 | +----------------------------+ | Log Meta Data | +----------------------------+
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intOffset within the log meta data where the active Partition id is stored.static final intOffset within the log meta data which the MTU length is stored;static final intTotal length of the log meta data buffer in bytes.static final intOffset within the log meta data where the current publisher limit is stored.static final intA Partition which is clean or in use.static final intThe number of Partitions the log is divided intostatic final intTotal length of the Partition meta data buffer in bytes.static final intMinimum buffer length for a Partitionstatic final intA Partition is dirty and requires cleaning.static final intOffset within the Partition meta data where current status is storedstatic final intOffset within the Partition meta data where the tail value is stored. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intlogMetadataOffset(int partitionSize) static intpartitionDataSectionOffset(int partitionSize, int partitionNumber) static intpartitionMetadataSectionOffset(int partitionSize, int partitionNumber) static intrequiredCapacity(int partitionSize) Calculates the required capacity for a log buffer which can hold up to the provided bytes of data.
-
Field Details
-
PARTITION_COUNT
public static final int PARTITION_COUNTThe number of Partitions the log is divided into- See Also:
-
PARTITION_MIN_LENGTH
public static final int PARTITION_MIN_LENGTHMinimum buffer length for a Partition- See Also:
-
PARTITION_CLEAN
public static final int PARTITION_CLEANA Partition which is clean or in use.- See Also:
-
PARTITION_NEEDS_CLEANING
public static final int PARTITION_NEEDS_CLEANINGA Partition is dirty and requires cleaning.- See Also:
-
PARTITION_TAIL_COUNTER_OFFSET
public static final int PARTITION_TAIL_COUNTER_OFFSETOffset within the Partition meta data where the tail value is stored. -
PARTITION_STATUS_OFFSET
public static final int PARTITION_STATUS_OFFSETOffset within the Partition meta data where current status is stored -
PARTITION_META_DATA_LENGTH
public static final int PARTITION_META_DATA_LENGTHTotal length of the Partition meta data buffer in bytes. -
LOG_PUBLISHER_LIMIT_OFFSET
public static final int LOG_PUBLISHER_LIMIT_OFFSETOffset within the log meta data where the current publisher limit is stored. -
LOG_ACTIVE_PARTITION_ID_OFFSET
public static final int LOG_ACTIVE_PARTITION_ID_OFFSETOffset within the log meta data where the active Partition id is stored. -
LOG_MAX_FRAME_LENGTH_OFFSET
public static final int LOG_MAX_FRAME_LENGTH_OFFSETOffset within the log meta data which the MTU length is stored; -
LOG_META_DATA_LENGTH
public static final int LOG_META_DATA_LENGTHTotal length of the log meta data buffer in bytes.0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Publisher limit | | | +---------------------------------------------------------------+ | Cache Line Padding ... ... | +---------------------------------------------------------------+ | Active Partition Id | +---------------------------------------------------------------+ | Cache Line Padding ... ... | +---------------------------------------------------------------+ | Max Frame Length | +---------------------------------------------------------------+
-
-
Constructor Details
-
LogBufferDescriptor
public LogBufferDescriptor()
-
-
Method Details
-
requiredCapacity
public static int requiredCapacity(int partitionSize) Calculates the required capacity for a log buffer which can hold up to the provided bytes of data. -
partitionMetadataSectionOffset
public static int partitionMetadataSectionOffset(int partitionSize, int partitionNumber) -
partitionDataSectionOffset
public static int partitionDataSectionOffset(int partitionSize, int partitionNumber) -
logMetadataOffset
public static int logMetadataOffset(int partitionSize)
-