Class Protocol

java.lang.Object
io.camunda.zeebe.protocol.Protocol

public final class Protocol extends Object
  • Field Details

    • PROTOCOL_VERSION

      public static final int PROTOCOL_VERSION
      See Also:
    • ENDIANNESS

      public static final ByteOrder ENDIANNESS
      The endianness of multibyte values encoded in the protocol. This MUST match the default byte order in the SBE XML schema.
    • DEPLOYMENT_PARTITION

      public static final int DEPLOYMENT_PARTITION
      By convention, the partition to deploy to
      See Also:
    • START_PARTITION_ID

      public static final int START_PARTITION_ID
      Id of the first partition. partition ids are in the range(START_PARTITION_ID, START_PARTITION_ID + partitionCount)
      See Also:
    • PARTITION_BITS

      public static final int PARTITION_BITS
      The partition space is derived from the keyspace and the maximum bytes of long.

      partitionSpace = 2^64 - KEYSPACE

      See Also:
    • MAXIMUM_PARTITIONS

      public static final long MAXIMUM_PARTITIONS
      The maximum number of partitions that can be created in a cluster, i.e. 2^13, or 8192.
      See Also:
    • KEY_BITS

      public static final int KEY_BITS
      Keyspace is defined for each partition. To define the keyspace size, the maximum events, which can be written to the dispatcher implementation, has to be calculated.

      If we change or replace the dispatcher implementation we should check if the current defined key space size is still valid.

      Calculation is done as follows:

      On each segment 2^32 bytes can be written, we can have 2^32 segments. This means we can at maximum write 2*32 * 2^32 = 18446744073709551616 bytes. If we assume an avg event size of 15_000 bytes (due to variables and so on) we can calculate the maximum events which can be written to the dispatcher. `maximumEvents = maximumBytes / eventAvgSize = 1229782938247303.5` We can then calculate the min pow of 2 to reach this value like: log(2, 1229782938247303.5). This means we need a keyspace of 2^51 to have more keys then possible writable events.

      See Also:
    • USER_TASK_JOB_TYPE

      public static final String USER_TASK_JOB_TYPE
      Job typ used for user tasks handled by Camunda Cloud Tasklist
      See Also:
    • RESERVED_HEADER_NAME_PREFIX

      public static final String RESERVED_HEADER_NAME_PREFIX
      Prefix for key of reserved task headers
      See Also:
    • USER_TASK_FORM_KEY_HEADER_NAME

      public static final String USER_TASK_FORM_KEY_HEADER_NAME
      Task header key used for user tasks to contain form key from BPMN XML
      See Also:
    • USER_TASK_ASSIGNEE_HEADER_NAME

      public static final String USER_TASK_ASSIGNEE_HEADER_NAME
      Task header key used for assignee
      See Also:
    • USER_TASK_CANDIDATE_GROUPS_HEADER_NAME

      public static final String USER_TASK_CANDIDATE_GROUPS_HEADER_NAME
      Task header key used for candidate groups
      See Also:
    • USER_TASK_CANDIDATE_USERS_HEADER_NAME

      public static final String USER_TASK_CANDIDATE_USERS_HEADER_NAME
      Task header key used for candidate users
      See Also:
    • USER_TASK_DUE_DATE_HEADER_NAME

      public static final String USER_TASK_DUE_DATE_HEADER_NAME
      Task header key used for due date
      See Also:
    • USER_TASK_FOLLOW_UP_DATE_HEADER_NAME

      public static final String USER_TASK_FOLLOW_UP_DATE_HEADER_NAME
      Task header key used for follow-up date
      See Also:
  • Constructor Details

    • Protocol

      public Protocol()
  • Method Details

    • encodePartitionId

      public static long encodePartitionId(int partitionId, long key)
    • decodePartitionId

      public static int decodePartitionId(long key)
    • decodeKeyInPartition

      public static long decodeKeyInPartition(long key)