Interface Record<T extends RecordValue>

All Superinterfaces:
JsonSerializable
All Known Implementing Classes:
ImmutableRecord

@Immutable public interface Record<T extends RecordValue> extends JsonSerializable
Represents a record published to the log stream.
  • Method Details

    • getPosition

      long getPosition()
      Retrieves the position of the record. Positions are locally unique to the partition, and monotonically increasing. Records are then ordered on the partition by their positions, i.e. lower position means the record was published earlier.
      Returns:
      position the record
    • getSourceRecordPosition

      long getSourceRecordPosition()
      Returns the position of the source record. The source record denotes the record which caused the current record. It can be unset (meaning there is no source record), at which point the position returned here will be -1. Anything >= 0 implies a source record.
      Returns:
      position of the source record
    • getKey

      long getKey()
      Retrieves the key of the record.

      Multiple records can have the same key if they belongs to the same logical entity. Keys are unique for the combination of partition and record type.

      Returns:
      the key of the record
    • getTimestamp

      long getTimestamp()
      Returns:
      the unix timestamp at which the record was published on the partition.
    • getIntent

      Intent getIntent()
      Returns:
      the intent of the record
    • getPartitionId

      int getPartitionId()
      Returns:
      the partition ID on which the record was published
    • getRecordType

      RecordType getRecordType()
      Returns:
      the type of the record (event, command or command rejection)
    • getRejectionType

      RejectionType getRejectionType()
      Returns:
      the type of rejection if getRecordType() returns RecordType.COMMAND_REJECTION or else null.
    • getRejectionReason

      String getRejectionReason()
      Returns:
      the reason why a command was rejected if getRecordType() returns RecordType.COMMAND_REJECTION or else null.
    • getBrokerVersion

      String getBrokerVersion()
      Returns:
      the version of the broker that wrote this record
    • getValueType

      ValueType getValueType()
      Returns:
      the type of the record (e.g. job, process, process instance, etc.)
    • getValue

      T getValue()
      Returns the raw value of the record, which should implement one of the interfaces in the io.camunda.zeebe.protocol.record.value package.

      The record value is essentially the record specific data, e.g. for a process instance creation event, it would contain information relevant to the process instance being created.

      Returns:
      record value
    • copyOf

      @NonAttribute default Record<T> copyOf()
      Creates a deep copy of the current record. Can be used to collect records.
      Returns:
      a deep copy of this record