Package io.camunda.zeebe.logstreams.log
Interface LogAppendEntry
- All Known Implementing Classes:
LogAppendEntryImpl,ProcessedLogAppendEntryImpl
public interface LogAppendEntry
Represents an unmodifiable application record entry to be appended on the log.
-
Method Summary
Modifier and TypeMethodDescriptiondefault intdefault booleanlongkey()static LogAppendEntryof(long key, RecordMetadata recordMetadata, UnifiedRecordValue recordValue) Creates a default representation of aLogAppendEntryusing default null values for the source index.static LogAppendEntryof(RecordMetadata recordMetadata, UnifiedRecordValue recordValue) Creates a default representation of aLogAppendEntryusing default null values for the key and source index.static LogAppendEntryofProcessed(LogAppendEntry entry) Creates a newLogAppendEntrywhich wraps the givenLogAppendEntryand marks the entry as processed.int
-
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
Creates a default representation of aLogAppendEntryusing default null values for the key and source index.- Parameters:
recordMetadata- the metadata of the entryrecordValue- the value of the entry- Returns:
- a simple value class implementation of a
LogAppendEntrywith the parameters - Throws:
NullPointerException- if either ofrecordMetadataorrecordValueis null
-
of
Creates a default representation of aLogAppendEntryusing default null values for the source index.- Parameters:
key- the key of the entryrecordMetadata- the metadata of the entryrecordValue- the value of the entry- Returns:
- a simple value class implementation of a
LogAppendEntrywith the parameters - Throws:
NullPointerException- if either ofrecordMetadataorrecordValueis null
-
ofProcessed
Creates a newLogAppendEntrywhich wraps the givenLogAppendEntryand marks the entry as processed.- Parameters:
entry- the entry which should be written to the log- Returns:
- a simple value class implementation of a
LogAppendEntrywith the parameters
-