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
  • Constructor Details

    • GlobalIndexConsistencyMarker

      public GlobalIndexConsistencyMarker(long position)
      Creates a marker for the given position.
      Parameters:
      position - The position in the event stream this marker represents.
  • Method Details

    • position

      public static long position(ConsistencyMarker consistencyMarker)
      Utility function to resolve the position from given consistencyMarker. This implementation takes into account that the given consistencyMarker may be either ConsistencyMarker.ORIGIN or ConsistencyMarker.INFINITY.
      Parameters:
      consistencyMarker - The marker to retrieve the position from.
      Returns:
      a long representation of the position described by the consistency marker.
    • doLowerBound

      protected ConsistencyMarker doLowerBound(GlobalIndexConsistencyMarker other)
      Description copied from class: AbstractConsistencyMarker
      Calculate the lower bound of this marker and given other marker. The result must represent the lowest of the given markers. This may either be on of this or the other marker, or any other that represents their lower bound.
      Specified by:
      doLowerBound in class AbstractConsistencyMarker<GlobalIndexConsistencyMarker>
      Parameters:
      other - The other marker.
      Returns:
      A marker representing the lower bound of this and the other marker.
    • doUpperBound

      protected ConsistencyMarker doUpperBound(GlobalIndexConsistencyMarker other)
      Description copied from class: AbstractConsistencyMarker
      Calculate the upper bound of this marker and given other marker. The result must represent the highest of the given markers. This may either be on of this or the other marker, or any other that represents their upper bound.
      Specified by:
      doUpperBound in class AbstractConsistencyMarker<GlobalIndexConsistencyMarker>
      Parameters:
      other - The other marker.
      Returns:
      A marker representing the upper bound of this and the other marker.
    • position

      public Position position()
      Description copied from interface: ConsistencyMarker
      Reduces this consistency marker to a single position if possible. Note that this must always succeed if the marker was created based on a single sourcing. The position returned is guaranteed to be suitable to resume an earlier sourcing from the exact position it ended at.
      Returns:
      a Position, never null
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object