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.
@Incubating @FunctionalInterface public interface OffsetCommitPolicy
The policy that defines when the offsets should be committed to offset storage.- Author:
- Randall Hauch
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classOffsetCommitPolicy.AlwaysCommitOffsetPolicyAnOffsetCommitPolicythat will commit offsets as frequently as possible.static classOffsetCommitPolicy.PeriodicCommitOffsetPolicyAnOffsetCommitPolicythat will commit offsets no more than the specified time period.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static 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 Detail
-
always
static OffsetCommitPolicy always()
-
periodic
static OffsetCommitPolicy periodic(Properties config)
-
performCommit
boolean performCommit(long numberOfMessagesSinceLastCommit, Duration timeSinceLastCommit)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
default OffsetCommitPolicy or(OffsetCommitPolicy other)
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
default OffsetCommitPolicy and(OffsetCommitPolicy other)
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
-
-