You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ch...@apache.org on 2020/11/24 07:03:58 UTC

[kafka] branch trunk updated: MINOR: Remove redundant argument from TaskMetricsGroup#recordCommit (#9642)

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

chia7712 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 047ad65  MINOR: Remove redundant argument from TaskMetricsGroup#recordCommit (#9642)
047ad65 is described below

commit 047ad654da7903f3903760b0e6a6a58648ca7715
Author: abc863377 <ab...@yahoo.com.tw>
AuthorDate: Tue Nov 24 15:02:56 2020 +0800

    MINOR: Remove redundant argument from TaskMetricsGroup#recordCommit (#9642)
    
    Reviewers: Chia-Ping Tsai <ch...@gmail.com>
---
 .../main/java/org/apache/kafka/connect/runtime/WorkerTask.java    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.java b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.java
index cadb4c4..0bd7630 100644
--- a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.java
+++ b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerTask.java
@@ -298,7 +298,7 @@ abstract class WorkerTask implements Runnable {
      * @param duration the length of time in milliseconds for the commit attempt to complete
      */
     protected void recordCommitSuccess(long duration) {
-        taskMetricsGroup.recordCommit(duration, true, null);
+        taskMetricsGroup.recordCommit(duration, null);
     }
 
     /**
@@ -308,7 +308,7 @@ abstract class WorkerTask implements Runnable {
      * @param error the unexpected error that occurred; may be null in the case of timeouts or interruptions
      */
     protected void recordCommitFailure(long duration, Throwable error) {
-        taskMetricsGroup.recordCommit(duration, false, error);
+        taskMetricsGroup.recordCommit(duration, error);
     }
 
     /**
@@ -385,8 +385,8 @@ abstract class WorkerTask implements Runnable {
             metricGroup.close();
         }
 
-        void recordCommit(long duration, boolean success, Throwable error) {
-            if (success) {
+        void recordCommit(long duration, Throwable error) {
+            if (error == null) {
                 commitTime.record(duration);
                 commitAttempts.record(1.0d);
             } else {