Class InMemoryPositionStore

java.lang.Object
io.fluxcapacitor.common.tracking.InMemoryPositionStore
All Implemented Interfaces:
PositionStore

public class InMemoryPositionStore extends Object implements PositionStore
  • Constructor Details

    • InMemoryPositionStore

      public InMemoryPositionStore()
  • Method Details

    • storePosition

      public CompletableFuture<Void> storePosition(String consumer, int[] segment, long lastIndex)
      Description copied from interface: PositionStore
      Stores the latest processed index for a given segment range and consumer.
      Specified by:
      storePosition in interface PositionStore
      Parameters:
      consumer - the consumer name (e.g., the tracking processor)
      segment - the segment range for which this index applies
      lastIndex - the last index successfully handled
      Returns:
      a future that completes when the position is stored
    • resetPosition

      public CompletableFuture<Void> resetPosition(String consumer, long lastIndex)
      Description copied from interface: PositionStore
      Resets the position of the consumer for all segments to the given index.
      Specified by:
      resetPosition in interface PositionStore
      Parameters:
      consumer - the consumer name
      lastIndex - the new index to assign for all segments
      Returns:
      a future that completes when the reset is applied
    • position

      public Position position(String consumer)
      Description copied from interface: PositionStore
      Retrieves the full multi-segment position for the given consumer.
      Specified by:
      position in interface PositionStore
      Parameters:
      consumer - the consumer name
      Returns:
      the current Position of that consumer
    • close

      public void close()
      Description copied from interface: PositionStore
      Closes any underlying resources held by the store.
      Specified by:
      close in interface PositionStore