Package io.camunda.zeebe.logstreams.log
Interface LogStreamBatchReader
- All Superinterfaces:
AutoCloseable,CloseableSilently,Iterator<LogStreamBatchReader.Batch>
- All Known Implementing Classes:
LogStreamBatchReaderImpl
public interface LogStreamBatchReader
extends Iterator<LogStreamBatchReader.Batch>, CloseableSilently
Reads the log stream in batches. Similar to
LogStreamReader but groups events with the
same source event position in batches. Can be used to read all follow-up events at once.
// optionally
reader.seekToNextBatch(position);
while (reader.hasNext()) {
final Batch batch = reader.next();
while (batch.hasNext()) {
final LoggedEvent event = batch.next();
// ...
}
}
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA batch of events that share the same source record position. -
Method Summary
Modifier and TypeMethodDescriptionbooleanseekToNextBatch(long position) Seeks to the next batch after the given position.Methods inherited from interface io.camunda.zeebe.util.CloseableSilently
closeMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Method Details
-
seekToNextBatch
boolean seekToNextBatch(long position) Seeks to the next batch after the given position. If the position is negative then it seeks to the first event.- Parameters:
position- the position to seek for the next event- Returns:
true, if the given position exists, or if it is negative
-