Class Position
java.lang.Object
io.fluxcapacitor.common.api.tracking.Position
Represents the tracking state of a consumer, i.e. the last known indexes of consumed messages per segment.
Flux Capacitor segments the message log to support parallel consumption. A Position
stores
the most recent message index processed for each segment. This allows precise resumption of message
consumption on restarts or rebalances.
A Position
is an immutable structure and may be merged or queried to support multi-segment tracking.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetIndex
(int segment) boolean
isNew
(int[] segment) boolean
isNewIndex
(int segment, Long messageIndex) boolean
isNewMessage
(SerializedMessage message) lowestIndexForSegment
(int[] segment) Merges twoPosition
objects by taking the highest known index per segment.static Position
Creates an empty position.Splits the position map into contiguous segment ranges that share the same index.
-
Field Details
-
MAX_SEGMENT
public static int MAX_SEGMENT -
FULL_SEGMENT
public static int[] FULL_SEGMENT
-
-
Constructor Details
-
Position
public Position(long index) -
Position
public Position(int[] segment, long index)
-
-
Method Details
-
newPosition
Creates an empty position. -
getIndex
-
isNew
public boolean isNew(int[] segment) -
lowestIndexForSegment
-
merge
Merges twoPosition
objects by taking the highest known index per segment. -
splitInSegments
Splits the position map into contiguous segment ranges that share the same index. -
isNewMessage
-
isNewIndex
-