Class StartPosition
java.lang.Object
io.github.flink.gcp.connector.base.source.StartPosition
- All Implemented Interfaces:
Serializable
Where a change-stream source starts reading when no checkpointed state is restored.
A configured position applies only to a fresh start. On restore, the source resumes from its checkpointed per-partition positions instead. A source resolves this value once, when its split enumerator starts, and validates it against the stream's retained history.
latest() starts at the resolution instant and is the default used by change-stream
source builders. earliest() starts at the oldest safely readable instant reported by the
source. at(Instant) names an absolute instant, and ago(Duration) names an
instant relative to resolution time.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic StartPositionReturns a position the given duration before the source enumerator starts.static StartPositionReturns a position at an absolute instant.static StartPositionearliest()Returns a position at the oldest instant the change stream can safely serve.booleaninthashCode()static StartPositionlatest()Returns a position at the instant the source enumerator starts.toString()
-
Method Details
-
earliest
Returns a position at the oldest instant the change stream can safely serve. -
latest
Returns a position at the instant the source enumerator starts. -
at
Returns a position at an absolute instant.- Parameters:
instant- the instant to start reading at- Returns:
- the start position
-
ago
Returns a position the given duration before the source enumerator starts.- Parameters:
duration- how far before startup to begin; must be positive- Returns:
- the start position
-
equals
-
hashCode
public int hashCode() -
toString
-