Class OffsetCommitPolicy.PeriodicCommitOffsetPolicy

java.lang.Object
io.debezium.engine.spi.OffsetCommitPolicy.PeriodicCommitOffsetPolicy
All Implemented Interfaces:
OffsetCommitPolicy
Enclosing interface:
OffsetCommitPolicy

public static class OffsetCommitPolicy.PeriodicCommitOffsetPolicy extends Object implements OffsetCommitPolicy
An OffsetCommitPolicy that will commit offsets no more than the specified time period. If the specified time is less than 0 then the policy will behave as OffsetCommitPolicy.AlwaysCommitOffsetPolicy.
See Also:
  • Field Details

    • minimumTime

      private final Duration minimumTime
  • Constructor Details

    • PeriodicCommitOffsetPolicy

      public PeriodicCommitOffsetPolicy(Properties config)
  • Method Details

    • performCommit

      public boolean performCommit(long numberOfMessagesSinceLastCommit, Duration timeSinceLastCommit)
      Description copied from interface: OffsetCommitPolicy
      Determine if a commit of the offsets should be performed.
      Specified by:
      performCommit in interface OffsetCommitPolicy
      Parameters:
      numberOfMessagesSinceLastCommit - the number of messages that have been received from the connector since last the offsets were last committed; never negative
      timeSinceLastCommit - the time that has elapsed since the offsets were last committed; never negative
      Returns:
      true if the offsets should be committed, or false otherwise