Package io.atomix.primitive.log
Interface LogSession
public interface LogSession
Log session.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classLogSession.BuilderLog session builder. -
Method Summary
Modifier and Type Method Description voidaddStateChangeListener(java.util.function.Consumer<PrimitiveState> listener)Registers a session state change listener.CompletableFuture<Void>close()Closes the log session.CompletableFuture<LogSession>connect()Connects the log session.LogConsumerconsumer()Returns the log consumer.io.atomix.utils.concurrent.ThreadContextcontext()Returns the partition thread context.PrimitiveStategetState()Returns the current session state.PartitionIdpartitionId()Returns the session partition ID.LogProducerproducer()Returns the log producer.voidremoveStateChangeListener(java.util.function.Consumer<PrimitiveState> listener)Removes a state change listener.SessionIdsessionId()Returns the session identifier.
-
Method Details
-
partitionId
PartitionId partitionId()Returns the session partition ID.- Returns:
- the session partition ID
-
sessionId
SessionId sessionId()Returns the session identifier.- Returns:
- the session identifier
-
context
io.atomix.utils.concurrent.ThreadContext context()Returns the partition thread context.- Returns:
- the partition thread context
-
producer
LogProducer producer()Returns the log producer.- Returns:
- the log producer
-
consumer
LogConsumer consumer()Returns the log consumer.- Returns:
- the log consumer
-
getState
PrimitiveState getState()Returns the current session state.- Returns:
- the current session state
-
addStateChangeListener
Registers a session state change listener.- Parameters:
listener- The callback to call when the session state changes.
-
removeStateChangeListener
Removes a state change listener.- Parameters:
listener- the state change listener to remove
-
connect
CompletableFuture<LogSession> connect()Connects the log session.- Returns:
- a future to be completed once the log session has been connected
-
close
CompletableFuture<Void> close()Closes the log session.- Returns:
- a future to be completed once the log session has been closed
-