Package io.debezium.engine.spi
Interface OffsetCommitPolicy
- All Known Implementing Classes:
OffsetCommitPolicy.AlwaysCommitOffsetPolicy,OffsetCommitPolicy.PeriodicCommitOffsetPolicy
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
The policy that defines when the offsets should be committed to offset storage.
- Author:
- Randall Hauch
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classAnOffsetCommitPolicythat will commit offsets as frequently as possible.static classAnOffsetCommitPolicythat will commit offsets no more than the specified time period. -
Method Summary
Modifier and TypeMethodDescriptionstatic OffsetCommitPolicyalways()default OffsetCommitPolicyand(OffsetCommitPolicy other) Obtain a newOffsetCommitPolicythat will commit offsets if both this policy AND the other requests it.default OffsetCommitPolicyor(OffsetCommitPolicy other) Obtain a newOffsetCommitPolicythat will commit offsets if this policy OR the other requests it.booleanperformCommit(long numberOfMessagesSinceLastCommit, Duration timeSinceLastCommit) Determine if a commit of the offsets should be performed.static OffsetCommitPolicyperiodic(Properties config)
-
Method Details
-
always
-
periodic
-
performCommit
Determine if a commit of the offsets should be performed.- Parameters:
numberOfMessagesSinceLastCommit- the number of messages that have been received from the connector since last the offsets were last committed; never negativetimeSinceLastCommit- the time that has elapsed since the offsets were last committed; never negative- Returns:
trueif the offsets should be committed, orfalseotherwise
-
or
Obtain a newOffsetCommitPolicythat will commit offsets if this policy OR the other requests it.- Parameters:
other- the other commit policy; if null, then this policy instance is returned as is- Returns:
- the resulting policy; never null
-
and
Obtain a newOffsetCommitPolicythat will commit offsets if both this policy AND the other requests it.- Parameters:
other- the other commit policy; if null, then this policy instance is returned as is- Returns:
- the resulting policy; never null
-