Class InMemoryPositionStore
java.lang.Object
io.fluxzero.common.tracking.InMemoryPositionStore
- All Implemented Interfaces:
PositionStore
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes any underlying resources held by the store.Retrieves the full multi-segment position for the given consumer.resetPosition(String consumer, long lastIndex) Resets the position of the consumer for all segments to the given index.storePosition(String consumer, int[] segment, long lastIndex) Stores the latest processed index for a given segment range and consumer.
-
Constructor Details
-
InMemoryPositionStore
public InMemoryPositionStore()
-
-
Method Details
-
storePosition
Description copied from interface:PositionStoreStores the latest processed index for a given segment range and consumer.- Specified by:
storePositionin interfacePositionStore- Parameters:
consumer- the consumer name (e.g., the tracking processor)segment- the segment range for which this index applieslastIndex- the last index successfully handled- Returns:
- a future that completes when the position is stored
-
resetPosition
Description copied from interface:PositionStoreResets the position of the consumer for all segments to the given index.- Specified by:
resetPositionin interfacePositionStore- Parameters:
consumer- the consumer namelastIndex- the new index to assign for all segments- Returns:
- a future that completes when the reset is applied
-
position
Description copied from interface:PositionStoreRetrieves the full multi-segment position for the given consumer.- Specified by:
positionin interfacePositionStore- Parameters:
consumer- the consumer name- Returns:
- the current
Positionof that consumer
-
close
public void close()Description copied from interface:PositionStoreCloses any underlying resources held by the store.- Specified by:
closein interfacePositionStore
-