You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ce...@apache.org on 2023/07/18 20:42:26 UTC

[kafka] branch 3.4 updated: KAFKA-15091: Fix misleading Javadoc for SourceTask::commit (#13948)

This is an automated email from the ASF dual-hosted git repository.

cegerton pushed a commit to branch 3.4
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/3.4 by this push:
     new 278c4cde7bd KAFKA-15091: Fix misleading Javadoc for SourceTask::commit (#13948)
278c4cde7bd is described below

commit 278c4cde7bd7b91d930127e6c9fe1dd8d1359de9
Author: Yash Mayya <ya...@gmail.com>
AuthorDate: Tue Jul 18 21:38:30 2023 +0100

    KAFKA-15091: Fix misleading Javadoc for SourceTask::commit (#13948)
    
    Reviewers: Chris Egerton <ch...@aiven.io>
---
 .../src/main/java/org/apache/kafka/connect/source/SourceTask.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/connect/api/src/main/java/org/apache/kafka/connect/source/SourceTask.java b/connect/api/src/main/java/org/apache/kafka/connect/source/SourceTask.java
index 559f02340ca..2b1770e3ea6 100644
--- a/connect/api/src/main/java/org/apache/kafka/connect/source/SourceTask.java
+++ b/connect/api/src/main/java/org/apache/kafka/connect/source/SourceTask.java
@@ -105,9 +105,10 @@ public abstract class SourceTask implements Task {
     public abstract List<SourceRecord> poll() throws InterruptedException;
 
     /**
-     * <p>
-     * Commit the offsets, up to the offsets that have been returned by {@link #poll()}. This
-     * method should block until the commit is complete.
+     * This method is invoked periodically when offsets are committed for this source task. Note that the offsets
+     * being committed won't necessarily correspond to the latest offsets returned by this source task via
+     * {@link #poll()}. Also see {@link #commitRecord(SourceRecord, RecordMetadata)} which allows for a more
+     * fine-grained tracking of records that have been successfully delivered.
      * <p>
      * SourceTasks are not required to implement this functionality; Kafka Connect will record offsets
      * automatically. This hook is provided for systems that also need to store offsets internally