Class MessageLogMaintenance
java.lang.Object
io.fluxzero.common.tracking.MessageLogMaintenance
Coordinates maintenance operations that span the message log, tracking positions and active trackers.
-
Constructor Summary
ConstructorsConstructorDescriptionMessageLogMaintenance(MessageStore messageStore, PositionStore positionStore, TrackingStrategy trackingStrategy) Creates message log maintenance for the given shared log components. -
Method Summary
Modifier and TypeMethodDescriptionReturns the message store maintained by this instance.Returns the position store maintained by this instance.Returns the tracking strategy whose active trackers are coordinated by this instance.truncate()Truncates the message log and clears all tracking positions.
-
Constructor Details
-
MessageLogMaintenance
public MessageLogMaintenance(MessageStore messageStore, PositionStore positionStore, TrackingStrategy trackingStrategy) Creates message log maintenance for the given shared log components.- Parameters:
messageStore- the message store to maintainpositionStore- the position store associated with the message logtrackingStrategy- the tracking strategy that owns active trackers for the message log
-
-
Method Details
-
getMessageStore
Returns the message store maintained by this instance.- Returns:
- the message store
-
getPositionStore
Returns the position store maintained by this instance.- Returns:
- the position store
-
getTrackingStrategy
Returns the tracking strategy whose active trackers are coordinated by this instance.- Returns:
- the tracking strategy
-
truncate
Truncates the message log and clears all tracking positions.Active trackers are disconnected first and receive a final empty batch so consumers can stop waiting before the underlying stores are cleared.
-