Package io.camunda.zeebe.logstreams.log
Interface LogStreamBatchWriter
- All Superinterfaces:
LogStreamWriter
Write log entries to the log stream write buffer as batch. This ensures that the log entries are
written atomically.
Note that the log entry data is buffered until LogStreamWriter.tryWrite() is called.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilder to add a log entry to the batch. -
Method Summary
Modifier and TypeMethodDescriptionbooleancanWriteAdditionalEvent(int length) Returns whether an additional event of lengthlengthcould be written to the batch or not.booleancanWriteAdditionalEvent(int eventCount, int batchSize) Returns true if the given eventCount with the given batchLength could potentially be written with the BatchWriter, false otherwise.event()Returns the builder to add a new log entry to the batch.intvoidreset()Discard all non-written batch data.sourceRecordPosition(long position) Set the source event for all log entries.Methods inherited from interface io.camunda.zeebe.logstreams.log.LogStreamWriter
tryWrite
-
Method Details
-
sourceRecordPosition
Set the source event for all log entries. -
event
Returns the builder to add a new log entry to the batch. -
getMaxFragmentLength
int getMaxFragmentLength() -
reset
void reset()Discard all non-written batch data. -
canWriteAdditionalEvent
boolean canWriteAdditionalEvent(int length) Returns whether an additional event of lengthlengthcould be written to the batch or not.- Parameters:
length- the length of the event's value and metadata summed, i.e.LoggedEvent.getValueLength()+LoggedEvent.getMetadataLength()- Returns:
- true if the additional event could be written, false otherwise
-
canWriteAdditionalEvent
boolean canWriteAdditionalEvent(int eventCount, int batchSize) Returns true if the given eventCount with the given batchLength could potentially be written with the BatchWriter, false otherwise.- Parameters:
eventCount- the potential event count we want to checkbatchSize- the potential batch Size (in bytes) we want to check- Returns:
- true if the event count with corresponding size could be written, false otherwise
-