Package io.camunda.zeebe.logstreams.log
Interface LogStream
- All Superinterfaces:
AsyncClosable,AutoCloseable,HealthMonitorable
- All Known Implementing Classes:
LogStreamImpl
Represents a stream of events. New events are append to the end of the log. With
newLogStreamWriter() 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 Summary
Modifier and TypeMethodDescriptionstatic LogStreamBuilderbuilder()Returns the name of the log stream.intvoidregisterRecordAvailableListener(LogRecordAwaiter recordAwaiter) Registers a listener that will be notified when new records are available to read from the logstream.voidremoveRecordAvailableListener(LogRecordAwaiter recordAwaiter) Removes the listener.Methods inherited from interface io.camunda.zeebe.scheduler.AsyncClosable
closeAsyncMethods inherited from interface java.lang.AutoCloseable
closeMethods inherited from interface io.camunda.zeebe.util.health.HealthMonitorable
addFailureListener, getHealthReport, getName, removeFailureListener
-
Method Details
-
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
-
newLogStreamWriter
ActorFuture<LogStreamWriter> newLogStreamWriter()- Returns:
- a future, when successfully completed it returns a newly created log stream record writer
-
registerRecordAvailableListener
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
Removes the listener.- Parameters:
recordAwaiter- the listener to remove
-