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 Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A batch of events that share the same source record position.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    seekToNextBatch(long position)
    Seeks to the next batch after the given position.

    Methods inherited from interface io.camunda.zeebe.util.CloseableSilently

    close

    Methods 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