kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rha...@apache.org
Subject [kafka] 02/02: KAFKA-10111: Make SinkTaskContext.errantRecordReporter() a default method (#8814)
Date Fri, 05 Jun 2020 20:55:04 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 2eeac88c578a7a053369a5e751824bb6729b6f58
Author: Randall Hauch <rhauch@gmail.com>
AuthorDate: Fri Jun 5 15:20:24 2020 -0500

    KAFKA-10111: Make SinkTaskContext.errantRecordReporter() a default method (#8814)
    
    Connector projects may have their own mock or testing implementations of the `SinkTaskContext`,
and this newly-added method should be a default method to prevent breaking those projects.
Changing this to a default method that returns null also makes sense w/r/t the method semantics,
since the method is already defined to return null if the reporter has not been configured.
    
    Author: Randall Hauch <rhauch@gmail.com>
    Reviewer: Konstantine Karantasis <konstantine@confluent.io>
---
 .../src/main/java/org/apache/kafka/connect/sink/SinkTaskContext.java  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/connect/api/src/main/java/org/apache/kafka/connect/sink/SinkTaskContext.java
b/connect/api/src/main/java/org/apache/kafka/connect/sink/SinkTaskContext.java
index a431dbe..33c82cb 100644
--- a/connect/api/src/main/java/org/apache/kafka/connect/sink/SinkTaskContext.java
+++ b/connect/api/src/main/java/org/apache/kafka/connect/sink/SinkTaskContext.java
@@ -119,6 +119,8 @@ public interface SinkTaskContext {
      * @return the reporter; null if no error reporter has been configured for the connector
      * @since 2.6
      */
-    ErrantRecordReporter errantRecordReporter();
+    default ErrantRecordReporter errantRecordReporter() {
+        return null;
+    }
 
 }


Mime
View raw message