kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [kafka] branch trunk updated: KAFKA-6456; JavaDoc clarification for Connect SourceTask#poll() (#4432)
Date Thu, 18 Jan 2018 17:56:26 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/trunk by this push:
     new 8cd563d  KAFKA-6456; JavaDoc clarification for Connect SourceTask#poll() (#4432)
8cd563d is described below

commit 8cd563d4785f719c4876d9d4626713994c3a3a6f
Author: Gunnar Morling <gunnar.morling@googlemail.com>
AuthorDate: Thu Jan 18 18:56:22 2018 +0100

    KAFKA-6456; JavaDoc clarification for Connect SourceTask#poll() (#4432)
    
    Making clear that implementations of poll() shouldn't block indefinitely in order to allow
the task instance to transition to PAUSED state.
    
    Reviewers:  Randall Hauch <rhauch@gmail.com>, Jason Gustafson <jason@confluent.io>
---
 .../java/org/apache/kafka/connect/source/SourceTask.java     | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 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 f3e636b..5507f56 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
@@ -43,8 +43,16 @@ public abstract class SourceTask implements Task {
     public abstract void start(Map<String, String> props);
 
     /**
-     * Poll this SourceTask for new records. This method should block if no data is currently
-     * available.
+     * <p>
+     * Poll this source task for new records. If no data is currently available, this method
+     * should block but return control to the caller regularly (by returning {@code null})
in
+     * order for the task to transition to the {@code PAUSED} state if requested to do so.
+     * </p>
+     * <p>
+     * The task will be {@link #stop() stopped} on a separate thread, and when that happens
+     * this method is expected to unblock, quickly finish up any remaining processing, and
+     * return.
+     * </p>
      *
      * @return a list of source records
      */

-- 
To stop receiving notification emails like this one, please contact
['"commits@kafka.apache.org" <commits@kafka.apache.org>'].

Mime
View raw message