Class LogStreamImpl

java.lang.Object
io.camunda.zeebe.logstreams.impl.log.LogStreamImpl
All Implemented Interfaces:
LogStream, LogStorage.CommitListener, AutoCloseable

public final class LogStreamImpl extends Object implements LogStream, LogStorage.CommitListener
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface LogStream
    • getPartitionId

      public int getPartitionId()
      Specified by:
      getPartitionId in interface LogStream
      Returns:
      the partition id of the log stream
    • getLogName

      public String getLogName()
      Description copied from interface: LogStream
      Returns the name of the log stream.
      Specified by:
      getLogName in interface LogStream
      Returns:
      the log stream name
    • newLogStreamReader

      public LogStreamReader newLogStreamReader()
      Specified by:
      newLogStreamReader in interface LogStream
      Returns:
      a future, when successfully completed it returns a newly created log stream reader
    • newLogStreamWriter

      public LogStreamWriter newLogStreamWriter()
      Specified by:
      newLogStreamWriter in interface LogStream
      Returns:
      a future, when successfully completed it returns a newly created log stream record writer
    • getFlowControl

      public FlowControl getFlowControl()
      Specified by:
      getFlowControl in interface LogStream
      Returns:
      a handle to the flow control used by this log stream.
    • registerRecordAvailableListener

      public void registerRecordAvailableListener(LogRecordAwaiter recordAwaiter)
      Description copied from interface: LogStream
      Registers a listener that will be notified when new records are available to read from the logstream.
      Specified by:
      registerRecordAvailableListener in interface LogStream
      Parameters:
      recordAwaiter - the listener to be notified
    • removeRecordAvailableListener

      public void removeRecordAvailableListener(LogRecordAwaiter recordAwaiter)
      Description copied from interface: LogStream
      Removes the listener.
      Specified by:
      removeRecordAvailableListener in interface LogStream
      Parameters:
      recordAwaiter - the listener to remove
    • onCommit

      public void onCommit()
      Description copied from interface: LogStorage.CommitListener
      Called when a new record is committed in the storage
      Specified by:
      onCommit in interface LogStorage.CommitListener