Class MessageLogMaintenance

java.lang.Object
io.fluxzero.common.tracking.MessageLogMaintenance

public class MessageLogMaintenance extends Object
Coordinates maintenance operations that span the message log, tracking positions and active trackers.
  • 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 maintain
      positionStore - the position store associated with the message log
      trackingStrategy - the tracking strategy that owns active trackers for the message log
  • Method Details

    • getMessageStore

      public MessageStore getMessageStore()
      Returns the message store maintained by this instance.
      Returns:
      the message store
    • getPositionStore

      public PositionStore getPositionStore()
      Returns the position store maintained by this instance.
      Returns:
      the position store
    • getTrackingStrategy

      public TrackingStrategy getTrackingStrategy()
      Returns the tracking strategy whose active trackers are coordinated by this instance.
      Returns:
      the tracking strategy
    • truncate

      public CompletableFuture<Void> 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.