public interface EventTrackerStatus
Segment
of a TrackingEventProcessor
.Modifier and Type | Method and Description |
---|---|
OptionalLong |
getCurrentPosition()
Return the estimated relative current token position this Segment represents.
|
Throwable |
getError()
Returns the exception that caused processing to fail, if present.
|
OptionalLong |
getResetPosition()
Return the relative position at which a reset was triggered for this Segment.
|
Segment |
getSegment()
The segment for which this status is valid.
|
TrackingToken |
getTrackingToken()
The tracking token of the last event that has been seen by this Segment.
|
boolean |
isCaughtUp()
Whether the Segment of this status has caught up with the head of the event stream.
|
default boolean |
isDifferent(EventTrackerStatus that)
|
default boolean |
isDifferent(EventTrackerStatus that,
boolean validatePositions)
|
boolean |
isErrorState()
Indicates whether this status represents an error.
|
boolean |
isMerging()
Indicates whether this Segment is still merging two (or more) Segments.
|
boolean |
isReplaying()
Indicates whether this Segment is still replaying previously processed Events.
|
default boolean |
matchPositions(EventTrackerStatus that)
Match the position fields of
this and that . |
default boolean |
matchStates(EventTrackerStatus that)
Match the boolean state fields of
this and that . |
OptionalLong |
mergeCompletedPosition()
Return the estimated relative token position this Segment will have after a merge operation is complete.
|
default boolean |
trackerAdded()
Returns a
boolean describing whether this EventTrackerStatus is starting it's progress for the
first time. |
default boolean |
trackerRemoved()
Returns a
boolean describing whether this EventTrackerStatus has just stopped it's progress. |
Segment getSegment()
boolean isCaughtUp()
boolean isReplaying()
Note that this method will only recognize a replay if the tokens have been reset using TrackingEventProcessor.resetTokens()
. Removing tokens directly from the underlying TokenStore
will not
be recognized as a replay.
true
if this segment is replaying historic events after a reset
, otherwise false
boolean isMerging()
true
if this segment is merging Segments, otherwise false
OptionalLong mergeCompletedPosition()
isMerging()
} returns true. In case no estimation
can be given or no merge in progress, an OptionalLong.empty()
will be returned.TrackingToken getTrackingToken()
The returned tracking token represents the position of this segment in the event stream. In case of a recent merge of segments, the token represents the lowest position of the two merged segments.
boolean isErrorState()
true
, the getError()
will return the exception that caused the failure.true
if an error was reported, otherwise false
Throwable getError()
null
.null
when processing normallyOptionalLong getCurrentPosition()
OptionalLong.empty()
will be returned.OptionalLong getResetPosition()
OptionalLong.empty()
will be returned.default boolean trackerAdded()
boolean
describing whether this EventTrackerStatus
is starting it's progress for the
first time. Particularly useful if the EventTrackerStatusChangeListener
should react to added status'.true
if this EventTrackerStatus
just started, false
otherwisedefault boolean trackerRemoved()
boolean
describing whether this EventTrackerStatus
has just stopped it's progress.
Particularly useful if the EventTrackerStatusChangeListener
should react to removed status'.true
if this EventTrackerStatus
was just removed, false
otherwisedefault boolean isDifferent(EventTrackerStatus that)
that
- the other EventTrackerStatus
to validate the difference withtrue
if both EventTrackerStatus
's are different, false
otherwisedefault boolean isDifferent(EventTrackerStatus that, boolean validatePositions)
that
- the other EventTrackerStatus
to validate the difference withvalidatePositions
- flag dictating whether matchPositions(EventTrackerStatus)
should be taken into
account when matchingtrue
if both EventTrackerStatus
's are different, false
otherwisedefault boolean matchStates(EventTrackerStatus that)
this
and that
. This means isCaughtUp()
, isReplaying()
, isMerging()
and isErrorState()
are taken into account.that
- the other EventTrackerStatus
to match withtrue
if the boolean fields of this
and that
match, otherwise false
default boolean matchPositions(EventTrackerStatus that)
this
and that
. This means getCurrentPosition()
, getResetPosition()
and mergeCompletedPosition()
()} are taken into account.that
- the other EventTrackerStatus
to match withtrue
if the positions fields of this
and that
match, otherwise false
Copyright © 2010–2024. All rights reserved.