Interface OffsetCommitPolicy

    • Method Detail

      • 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 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
      • or

        default OffsetCommitPolicy or​(OffsetCommitPolicy other)
        Obtain a new OffsetCommitPolicy that 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 new OffsetCommitPolicy that 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