Interface LogStream

All Superinterfaces:
AsyncClosable, AutoCloseable, HealthMonitorable
All Known Implementing Classes:
LogStreamImpl

public interface LogStream extends AsyncClosable, AutoCloseable, HealthMonitorable
Represents a stream of events. New events are append to the end of the log. With newLogStreamRecordWriter() or newLogStreamBatchWriter() new writers can be created, which can be used to append new events to the log.

To read events, the newLogStreamReader() ()} can be used.

  • Method Details

    • builder

      static LogStreamBuilder builder()
      Returns:
      a new default LogStream builder
    • getPartitionId

      int getPartitionId()
      Returns:
      the partition id of the log stream
    • getLogName

      String getLogName()
      Returns the name of the log stream.
      Returns:
      the log stream name
    • newLogStreamReader

      ActorFuture<LogStreamReader> newLogStreamReader()
      Returns:
      a future, when successfully completed it returns a newly created log stream reader
    • newLogStreamRecordWriter

      ActorFuture<LogStreamRecordWriter> newLogStreamRecordWriter()
      Returns:
      a future, when successfully completed it returns a newly created log stream record writer
    • newLogStreamBatchWriter

      ActorFuture<LogStreamBatchWriter> newLogStreamBatchWriter()
      Returns:
      a future, when successfully completed it returns a newly created log stream batch writer
    • registerRecordAvailableListener

      void registerRecordAvailableListener(LogRecordAwaiter recordAwaiter)
      Registers a listener that will be notified when new records are available to read from the logstream.
      Parameters:
      recordAwaiter - the listener to be notified
    • removeRecordAvailableListener

      void removeRecordAvailableListener(LogRecordAwaiter recordAwaiter)
      Removes the listener.
      Parameters:
      recordAwaiter - the listener to remove