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: Fixed way how logging methods are used for having a consistent one
Date Fri, 23 Jun 2017 13:14:23 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 701e318ee -> 9ada0f816


MINOR: Fixed way how logging methods are used for having a consistent one

In the stream library there are few cases where we don't leverage on logging methods features
(i.e. using {} placeholder instead of string concatenation or passing the exception variable)

Author: ppatierno <ppatierno@live.com>

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

Closes #3419 from ppatierno/streams-consistent-logging


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

Branch: refs/heads/trunk
Commit: 9ada0f81695d99587b18bffe939de651065076ab
Parents: 701e318
Author: ppatierno <ppatierno@live.com>
Authored: Fri Jun 23 14:14:18 2017 +0100
Committer: Damian Guy <damian.guy@gmail.com>
Committed: Fri Jun 23 14:14:18 2017 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/kafka/streams/StreamsConfig.java  | 4 ++--
 .../apache/kafka/streams/processor/internals/AbstractTask.java | 2 +-
 .../streams/processor/internals/GlobalStateManagerImpl.java    | 6 +++---
 .../streams/processor/internals/InternalTopicManager.java      | 4 ++--
 .../apache/kafka/streams/processor/internals/StandbyTask.java  | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/9ada0f81/streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java b/streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java
index 74db9a4..02bebbc 100644
--- a/streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java
+++ b/streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java
@@ -574,8 +574,8 @@ public class StreamsConfig extends AbstractConfig {
 
         final boolean eosEnabled = EXACTLY_ONCE.equals(parsedValues.get(PROCESSING_GUARANTEE_CONFIG));
         if (eosEnabled && !originals().containsKey(COMMIT_INTERVAL_MS_CONFIG)) {
-            log.debug("Using " + COMMIT_INTERVAL_MS_CONFIG + " default value of "
-                + EOS_DEFAULT_COMMIT_INTERVAL_MS + " as exactly once is enabled.");
+            log.debug("Using {} default value of {} as exactly once is enabled.",
+                    COMMIT_INTERVAL_MS_CONFIG, EOS_DEFAULT_COMMIT_INTERVAL_MS);
             configUpdates.put(COMMIT_INTERVAL_MS_CONFIG, EOS_DEFAULT_COMMIT_INTERVAL_MS);
         }
 

http://git-wip-us.apache.org/repos/asf/kafka/blob/9ada0f81/streams/src/main/java/org/apache/kafka/streams/processor/internals/AbstractTask.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/AbstractTask.java
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/AbstractTask.java
index d97f8f9..f54ced3 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/AbstractTask.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/AbstractTask.java
@@ -168,7 +168,7 @@ public abstract class AbstractTask {
     }
 
     protected void updateOffsetLimits() {
-        log.debug("{} Updating store offset limits {}", logPrefix);
+        log.debug("{} Updating store offset limits", logPrefix);
         for (final TopicPartition partition : partitions) {
             try {
                 final OffsetAndMetadata metadata = consumer.committed(partition); // TODO:
batch API?

http://git-wip-us.apache.org/repos/asf/kafka/blob/9ada0f81/streams/src/main/java/org/apache/kafka/streams/processor/internals/GlobalStateManagerImpl.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/GlobalStateManagerImpl.java
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/GlobalStateManagerImpl.java
index 6bd699f..1b3e036 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/GlobalStateManagerImpl.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/GlobalStateManagerImpl.java
@@ -86,7 +86,7 @@ public class GlobalStateManagerImpl implements GlobalStateManager {
             try {
                 stateDirectory.unlockGlobalState();
             } catch (IOException e1) {
-                log.error("failed to unlock the global state directory", e);
+                log.error("Failed to unlock the global state directory", e);
             }
             throw new StreamsException("Failed to read checkpoints for global state stores",
e);
         }
@@ -129,7 +129,7 @@ public class GlobalStateManagerImpl implements GlobalStateManager {
             throw new IllegalArgumentException(String.format("The stateRestoreCallback provided
for store %s was null", store.name()));
         }
 
-        log.info("restoring state for global store {}", store.name());
+        log.info("Restoring state for global store {}", store.name());
         final List<TopicPartition> topicPartitions = topicPartitionsForStore(store);
         final Map<TopicPartition, Long> highWatermarks = consumer.endOffsets(topicPartitions);
         try {
@@ -234,7 +234,7 @@ public class GlobalStateManagerImpl implements GlobalStateManager {
             try {
                 checkpoint.write(checkpointableOffsets);
             } catch (IOException e) {
-                log.warn("failed to write offsets checkpoint for global stores", e);
+                log.warn("Failed to write offsets checkpoint for global stores", e);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/kafka/blob/9ada0f81/streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopicManager.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopicManager.java
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopicManager.java
index 7dab99d..fd602cc 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopicManager.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/InternalTopicManager.java
@@ -72,7 +72,7 @@ public class InternalTopicManager {
                 streamsKafkaClient.createTopics(topicsToBeCreated, replicationFactor, windowChangeLogAdditionalRetention,
metadata);
                 return;
             } catch (StreamsException ex) {
-                log.warn("Could not create internal topics: " + ex.getMessage() + " Retry
#" + i);
+                log.warn("Could not create internal topics: {} Retry #{}", ex.getMessage(),
i);
             }
             // backoff
             time.sleep(100L);
@@ -92,7 +92,7 @@ public class InternalTopicManager {
 
                 return existingTopicPartitions;
             } catch (StreamsException ex) {
-                log.warn("Could not get number of partitions: " + ex.getMessage() + " Retry
#" + i);
+                log.warn("Could not get number of partitions: {} Retry #{}", ex.getMessage(),
i);
             }
             // backoff
             time.sleep(100L);

http://git-wip-us.apache.org/repos/asf/kafka/blob/9ada0f81/streams/src/main/java/org/apache/kafka/streams/processor/internals/StandbyTask.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StandbyTask.java
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StandbyTask.java
index 5998c2b..0d7e9a2 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StandbyTask.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StandbyTask.java
@@ -77,7 +77,7 @@ public class StandbyTask extends AbstractTask {
      */
     @Override
     public void resume() {
-        log.debug("{} " + "Resuming", logPrefix);
+        log.debug("{} Resuming", logPrefix);
         updateOffsetLimits();
     }
 


Mime
View raw message