kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From damian...@apache.org
Subject kafka git commit: MINOR: Code cleanup, subject: log statements.
Date Mon, 18 Sep 2017 11:05:00 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk d83252eba -> be6252d8e


MINOR: Code cleanup, subject: log statements.

I'm doing this in my spare time, so don't let reviewing this PR take away actual work time.
This is just me going over the code with the Intellij analyzer and implementing the most easily
implementable fixes.

This PR is focused only on seemingly erronous log statements.

1: A log statement that has 4 arguments supplied but only 3 `{}` statements

2: A log statement that checks is debug is enabled, but then logs on `info` level.

Author: coscale_kdegroot <koen.degroote@coscale.com>

Reviewers: Damian Guy <damian.guy@gmail.com>

Closes #3886 from KoenDG/loggingErrors


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/be6252d8
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/be6252d8
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/be6252d8

Branch: refs/heads/trunk
Commit: be6252d8ebdf9cf2d151028a7ba20eb1591b5961
Parents: d83252e
Author: coscale_kdegroot <koen.degroote@coscale.com>
Authored: Mon Sep 18 12:04:56 2017 +0100
Committer: Damian Guy <damian.guy@gmail.com>
Committed: Mon Sep 18 12:04:56 2017 +0100

----------------------------------------------------------------------
 .../kafka/streams/processor/internals/StreamPartitionAssignor.java | 2 +-
 .../org/apache/kafka/streams/processor/internals/StreamThread.java | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/be6252d8/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamPartitionAssignor.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamPartitionAssignor.java
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamPartitionAssignor.java
index 34e9e8a..621eb15 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamPartitionAssignor.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamPartitionAssignor.java
@@ -502,7 +502,7 @@ public class StreamPartitionAssignor implements PartitionAssignor, Configurable,
             states.put(entry.getKey(), entry.getValue().state);
         }
 
-        log.debug("Assigning tasks {} to clients {} with number of replicas {}",
+        log.debug("{} Assigning tasks {} to clients {} with number of replicas {}",
                 logPrefix, partitionsForTask.keySet(), states, numStandbyReplicas);
 
         final StickyTaskAssignor<UUID> taskAssignor = new StickyTaskAssignor<>(states,
partitionsForTask.keySet());

http://git-wip-us.apache.org/repos/asf/kafka/blob/be6252d8/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
index b753cf9..867359b 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamThread.java
@@ -963,7 +963,7 @@ public class StreamThread extends Thread implements ThreadDataProvider
{
                 streamsMetrics.commitTimeSensor.record(computeLatency() / (double) committed,
timerStartedMs);
             }
             if (log.isDebugEnabled()) {
-                log.info("Committed all active tasks {} and standby tasks {} in {}ms",
+                log.debug("Committed all active tasks {} and standby tasks {} in {}ms",
                         taskManager.activeTaskIds(), taskManager.standbyTaskIds(), timerStartedMs
- now);
             }
 


Mime
View raw message