From 4db1c9b971d073933dc53f4f1d814d49f5ba0773 Mon Sep 17 00:00:00 2001 From: abc863377 Date: Mon, 23 Nov 2020 22:16:16 +0800 Subject: [PATCH] MINOR: --- .../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 cadb4c4a8a23d..0bd76300dca5e 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 @@ protected void recordActiveTopic(String topic) { * @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 @@ protected void recordCommitSuccess(long duration) { * @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 @@ void close() { 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 {