Interface LogAppendEntry


public interface LogAppendEntry
Represents an unmodifiable application record entry to be appended on the log.
  • Method Details

    • key

      long key()
      Returns:
      the key of the record
    • sourceIndex

      int sourceIndex()
      Returns:
      points to a command which is part of the same batch, which caused that entry
    • recordMetadata

      RecordMetadata recordMetadata()
      Returns:
      metadata of the record, like ValueType, Intent, RecordType etc.
    • recordValue

      UnifiedRecordValue recordValue()
      Returns:
      the actual record value, this method returns a general type but can be casted to the right record value class if necessary
    • getLength

      default int getLength()
      Returns:
      the length of the entry, used by writers to determine whether this entry can be written
    • isProcessed

      default boolean isProcessed()
      Returns:
      true if the entry was already processed, defaults to false
    • of

      static LogAppendEntry of(RecordMetadata recordMetadata, UnifiedRecordValue recordValue)
      Creates a default representation of a LogAppendEntry using default null values for the key and source index.
      Parameters:
      recordMetadata - the metadata of the entry
      recordValue - the value of the entry
      Returns:
      a simple value class implementation of a LogAppendEntry with the parameters
      Throws:
      NullPointerException - if either of recordMetadata or recordValue is null
    • of

      static LogAppendEntry of(long key, RecordMetadata recordMetadata, UnifiedRecordValue recordValue)
      Creates a default representation of a LogAppendEntry using default null values for the source index.
      Parameters:
      key - the key of the entry
      recordMetadata - the metadata of the entry
      recordValue - the value of the entry
      Returns:
      a simple value class implementation of a LogAppendEntry with the parameters
      Throws:
      NullPointerException - if either of recordMetadata or recordValue is null
    • ofProcessed

      static LogAppendEntry ofProcessed(LogAppendEntry entry)
      Creates a new LogAppendEntry which wraps the given LogAppendEntry and marks the entry as processed.
      Parameters:
      entry - the entry which should be written to the log
      Returns:
      a simple value class implementation of a LogAppendEntry with the parameters