Package io.camunda.zeebe.logstreams.log
Interface LogStream
- All Superinterfaces:
AutoCloseable
- 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()voidclose()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.
-
Method Details
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-
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
LogStreamReader newLogStreamReader()- Returns:
- a future, when successfully completed it returns a newly created log stream reader
-
newLogStreamWriter
LogStreamWriter newLogStreamWriter()- Returns:
- a future, when successfully completed it returns a newly created log stream record writer
-
getFlowControl
FlowControl getFlowControl()- Returns:
- a handle to the flow control used by this log stream.
-
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
-