Class GlobalIndexConsistencyMarker
java.lang.Object
org.axonframework.eventsourcing.eventstore.AbstractConsistencyMarker<GlobalIndexConsistencyMarker>
org.axonframework.eventsourcing.eventstore.GlobalIndexConsistencyMarker
- All Implemented Interfaces:
ConsistencyMarker
public class GlobalIndexConsistencyMarker
extends AbstractConsistencyMarker<GlobalIndexConsistencyMarker>
ConsistencyMarker implementation that uses a single `long` to represent a position in an event stream.- Since:
- 5.0.0
- Author:
- Allard Buijze
-
Field Summary
Fields inherited from interface org.axonframework.eventsourcing.eventstore.ConsistencyMarker
INFINITY, ORIGIN, RESOURCE_KEY -
Constructor Summary
ConstructorsConstructorDescriptionGlobalIndexConsistencyMarker(long position) Creates a marker for the givenposition. -
Method Summary
Modifier and TypeMethodDescriptionprotected ConsistencyMarkerCalculate the lower bound ofthismarker and givenothermarker.protected ConsistencyMarkerCalculate the upper bound ofthismarker and givenothermarker.booleaninthashCode()position()Reduces this consistency marker to a single position if possible.static longposition(ConsistencyMarker consistencyMarker) Utility function to resolve the position from givenconsistencyMarker.toString()Methods inherited from class org.axonframework.eventsourcing.eventstore.AbstractConsistencyMarker
lowerBound, upperBound
-
Constructor Details
-
GlobalIndexConsistencyMarker
public GlobalIndexConsistencyMarker(long position) Creates a marker for the givenposition.- Parameters:
position- The position in the event stream this marker represents.
-
-
Method Details
-
position
Utility function to resolve the position from givenconsistencyMarker. This implementation takes into account that the givenconsistencyMarkermay be eitherConsistencyMarker.ORIGINorConsistencyMarker.INFINITY.- Parameters:
consistencyMarker- The marker to retrieve the position from.- Returns:
- a long representation of the position described by the consistency marker.
-
doLowerBound
Description copied from class:AbstractConsistencyMarkerCalculate the lower bound ofthismarker and givenothermarker. The result must represent the lowest of the given markers. This may either be on ofthisor theothermarker, or any other that represents their lower bound.- Specified by:
doLowerBoundin classAbstractConsistencyMarker<GlobalIndexConsistencyMarker>- Parameters:
other- The other marker.- Returns:
- A marker representing the lower bound of this and the other marker.
-
doUpperBound
Description copied from class:AbstractConsistencyMarkerCalculate the upper bound ofthismarker and givenothermarker. The result must represent the highest of the given markers. This may either be on ofthisor theothermarker, or any other that represents their upper bound.- Specified by:
doUpperBoundin classAbstractConsistencyMarker<GlobalIndexConsistencyMarker>- Parameters:
other- The other marker.- Returns:
- A marker representing the upper bound of this and the other marker.
-
position
Description copied from interface:ConsistencyMarkerReduces this consistency marker to a single position if possible.- Returns:
- a
Position, nevernull
-
equals
-
hashCode
public int hashCode() -
toString
-