Class CommitToOffsetManager

    • Constructor Detail

      • CommitToOffsetManager

        public CommitToOffsetManager​(org.apache.kafka.clients.consumer.Consumer<?,​?> consumer,
                                     KafkaConsumer kafkaConsumer,
                                     String threadId,
                                     String printableTopic)
    • Method Detail

      • commit

        public void commit​(org.apache.kafka.common.TopicPartition partition)
        Description copied from interface: CommitManager
        Commits the offsets of the given partition
        Parameters:
        partition - the partition to commit the offsets
      • forceCommit

        public void forceCommit​(org.apache.kafka.common.TopicPartition partition,
                                long partitionLastOffset)
        Description copied from interface: CommitManager
        Forcefully commits the offset of the given partition
        Specified by:
        forceCommit in interface CommitManager
        Overrides:
        forceCommit in class AbstractCommitManager
        Parameters:
        partition - the partition to commit the offsets
        partitionLastOffset - the last offset to commit
      • commit

        public void commit()
        Description copied from interface: CommitManager
        Commits everything that has been cached
      • recordOffset

        public void recordOffset​(org.apache.kafka.common.TopicPartition partition,
                                 long partitionLastOffset)
        Description copied from interface: CommitManager
        Record the last processed offset for future commit
        Parameters:
        partition - the partition to commit the offsets
        partitionLastOffset - the last offset to commit