Class LogBufferDescriptor

java.lang.Object
io.camunda.zeebe.dispatcher.impl.log.LogBufferDescriptor

public final class LogBufferDescriptor extends Object
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 Details

    • PARTITION_COUNT

      public static final int PARTITION_COUNT
      The number of Partitions the log is divided into
      See Also:
    • PARTITION_MIN_LENGTH

      public static final int PARTITION_MIN_LENGTH
      Minimum buffer length for a Partition
      See Also:
    • PARTITION_CLEAN

      public static final int PARTITION_CLEAN
      A Partition which is clean or in use.
      See Also:
    • PARTITION_NEEDS_CLEANING

      public static final int PARTITION_NEEDS_CLEANING
      A Partition is dirty and requires cleaning.
      See Also:
    • PARTITION_TAIL_COUNTER_OFFSET

      public static final int PARTITION_TAIL_COUNTER_OFFSET
      Offset within the Partition meta data where the tail value is stored.
    • PARTITION_STATUS_OFFSET

      public static final int PARTITION_STATUS_OFFSET
      Offset within the Partition meta data where current status is stored
    • PARTITION_META_DATA_LENGTH

      public static final int PARTITION_META_DATA_LENGTH
      Total length of the Partition meta data buffer in bytes.
    • LOG_PUBLISHER_LIMIT_OFFSET

      public static final int LOG_PUBLISHER_LIMIT_OFFSET
      Offset 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_OFFSET
      Offset 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_OFFSET
      Offset within the log meta data which the MTU length is stored;
    • LOG_META_DATA_LENGTH

      public static final int LOG_META_DATA_LENGTH
      Total 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)