From 6cabeb19fd35fbf72c0616d7e4a1dc0bcbf22611 Mon Sep 17 00:00:00 2001 From: Yash Mayya Date: Tue, 18 Jul 2023 21:38:30 +0100 Subject: [PATCH] KAFKA-15091: Fix misleading Javadoc for SourceTask::commit (#13948) Reviewers: Chris Egerton (cherry picked from commit 35d4e9ec6e2c64aa61909becccd0a0369a89c15f) --- .../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 559f02340ca1..2b1770e3ea6a 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 void initialize(SourceTaskContext context) { public abstract List poll() throws InterruptedException; /** - *

- * 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. *

* 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