kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ewe...@apache.org
Subject [kafka] branch 1.0 updated: KAFKA-7353: Connect logs 'this' for anonymous inner classes
Date Thu, 06 Sep 2018 03:16:19 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/1.0 by this push:
     new 4866c33  KAFKA-7353: Connect logs 'this' for anonymous inner classes
4866c33 is described below

commit 4866c33ac309ba5cc098a02948253f55a83666a3
Author: Kevin Lafferty <kevin.lafferty@gmail.com>
AuthorDate: Wed Sep 5 20:15:25 2018 -0700

    KAFKA-7353: Connect logs 'this' for anonymous inner classes
    
    Replace 'this' reference in anonymous inner class logs to out class's 'this'
    
    Author: Kevin Lafferty <kevin.lafferty@gmail.com>
    
    Reviewers: Randall Hauch <rhauch@gmail.com>, Arjun Satish <arjun@confluent.io>,
Ewen Cheslack-Postava <ewen@confluent.io>
    
    Closes #5583 from kevin-laff/connect_logging
    
    (cherry picked from commit 847780e5a5f376fa2ce8705f483bfd33b319b83d)
    Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>
---
 .../java/org/apache/kafka/connect/runtime/WorkerConnector.java |  2 +-
 .../java/org/apache/kafka/connect/runtime/WorkerSinkTask.java  |  2 +-
 .../org/apache/kafka/connect/runtime/WorkerSourceTask.java     | 10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConnector.java
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConnector.java
index 9b934f3..86d313e 100644
--- a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConnector.java
+++ b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConnector.java
@@ -86,7 +86,7 @@ public class WorkerConnector {
 
                 @Override
                 public void raiseError(Exception e) {
-                    log.error("{} Connector raised an error", this, e);
+                    log.error("{} Connector raised an error", WorkerConnector.this, e);
                     onFailure(e);
                     ctx.raiseError(e);
                 }
diff --git a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSinkTask.java
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSinkTask.java
index de75cba..a06dca6 100644
--- a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSinkTask.java
+++ b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSinkTask.java
@@ -592,7 +592,7 @@ class WorkerSinkTask extends WorkerTask {
                 long pos = consumer.position(tp);
                 lastCommittedOffsets.put(tp, new OffsetAndMetadata(pos));
                 currentOffsets.put(tp, new OffsetAndMetadata(pos));
-                log.debug("{} Assigned topic partition {} with offset {}", this, tp, pos);
+                log.debug("{} Assigned topic partition {} with offset {}", WorkerSinkTask.this,
tp, pos);
             }
             sinkTaskMetricsGroup.assignedOffsets(currentOffsets);
 
diff --git a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java
index 59071b7..27dd388 100644
--- a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java
+++ b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerSourceTask.java
@@ -274,11 +274,11 @@ class WorkerSourceTask extends WorkerTask {
                                     // timeouts, callbacks with exceptions should never be
invoked in practice. If the
                                     // user overrode these settings, the best we can do is
notify them of the failure via
                                     // logging.
-                                    log.error("{} failed to send record to {}: {}", this,
topic, e);
-                                    log.debug("{} Failed record: {}", this, preTransformRecord);
+                                    log.error("{} failed to send record to {}: {}", WorkerSourceTask.this,
topic, e);
+                                    log.debug("{} Failed record: {}", WorkerSourceTask.this,
preTransformRecord);
                                 } else {
                                     log.trace("{} Wrote record successfully: topic {} partition
{} offset {}",
-                                            this,
+                                            WorkerSourceTask.this,
                                             recordMetadata.topic(), recordMetadata.partition(),
                                             recordMetadata.offset());
                                     commitTaskRecord(preTransformRecord);
@@ -388,9 +388,9 @@ class WorkerSourceTask extends WorkerTask {
             @Override
             public void onCompletion(Throwable error, Void result) {
                 if (error != null) {
-                    log.error("{} Failed to flush offsets to storage: ", this, error);
+                    log.error("{} Failed to flush offsets to storage: ", WorkerSourceTask.this,
error);
                 } else {
-                    log.trace("{} Finished flushing offsets to storage", this);
+                    log.trace("{} Finished flushing offsets to storage", WorkerSourceTask.this);
                 }
             }
         });


Mime
View raw message