kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject kafka git commit: MINOR: Fixed 3 inner classes without instance reference to be static
Date Mon, 20 Feb 2017 00:43:55 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk d24d932ef -> 3db3d73de


MINOR: Fixed 3 inner classes without instance reference to be static

* Turned 3 inner classes that weren't static but could be into `static` ones.
* Turned one `public` inner class that wasn't used publicly into a `private`.

Trivial but imo worthwhile to explicitly keep visibility and "staticness" correct in syntax
(if only to be nice to the GC) :)

Author: Armin Braun <me@obrown.io>

Reviewers: Matthias J. Sax <matthias@confluent.io>, Jason Gustafson <jason@confluent.io>

Closes #2574 from original-brownbear/cleanup-inner-nonstatic


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

Branch: refs/heads/trunk
Commit: 3db3d73de6bc1fbb846d0943a8fe73dcca96b78a
Parents: d24d932
Author: Armin Braun <me@obrown.io>
Authored: Sun Feb 19 16:39:36 2017 -0800
Committer: Jason Gustafson <jason@confluent.io>
Committed: Sun Feb 19 16:39:36 2017 -0800

----------------------------------------------------------------------
 .../kafka/streams/kstream/internals/KStreamPassThrough.java      | 4 ++--
 .../kafka/streams/kstream/internals/KTableKTableJoinMerger.java  | 3 ++-
 .../apache/kafka/streams/processor/internals/ProcessorNode.java  | 4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/3db3d73d/streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamPassThrough.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamPassThrough.java
b/streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamPassThrough.java
index 59a815b..adf8e38 100644
--- a/streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamPassThrough.java
+++ b/streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamPassThrough.java
@@ -25,10 +25,10 @@ class KStreamPassThrough<K, V> implements ProcessorSupplier<K,
V> {
 
     @Override
     public Processor<K, V> get() {
-        return new KStreamPassThroughProcessor<K, V>();
+        return new KStreamPassThroughProcessor<>();
     }
 
-    public class KStreamPassThroughProcessor<K, V> extends AbstractProcessor<K,
V> {
+    private static final class KStreamPassThroughProcessor<K, V> extends AbstractProcessor<K,
V> {
         @Override
         public void process(K key, V value) {
             context().forward(key, value);

http://git-wip-us.apache.org/repos/asf/kafka/blob/3db3d73d/streams/src/main/java/org/apache/kafka/streams/kstream/internals/KTableKTableJoinMerger.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/kstream/internals/KTableKTableJoinMerger.java
b/streams/src/main/java/org/apache/kafka/streams/kstream/internals/KTableKTableJoinMerger.java
index f52e618..558f492 100644
--- a/streams/src/main/java/org/apache/kafka/streams/kstream/internals/KTableKTableJoinMerger.java
+++ b/streams/src/main/java/org/apache/kafka/streams/kstream/internals/KTableKTableJoinMerger.java
@@ -46,7 +46,8 @@ class KTableKTableJoinMerger<K, V> implements KTableProcessorSupplier<K,
V, V> {
         parent2.enableSendingOldValues();
     }
 
-    private class KTableKTableJoinMergeProcessor<K, V> extends AbstractProcessor<K,
Change<V>> {
+    private static final class KTableKTableJoinMergeProcessor<K, V>
+        extends AbstractProcessor<K, Change<V>> {
         @Override
         public void process(K key, Change<V> value) {
             context().forward(key, value);

http://git-wip-us.apache.org/repos/asf/kafka/blob/3db3d73d/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorNode.java
----------------------------------------------------------------------
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorNode.java
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorNode.java
index fa4cc2b..41c5f7b 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorNode.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/ProcessorNode.java
@@ -110,7 +110,7 @@ public class ProcessorNode<K, V> {
     public void init(ProcessorContext context) {
         this.context = context;
         try {
-            nodeMetrics = new NodeMetrics(context.metrics(), name,  "task." + context.taskId());
+            nodeMetrics = new NodeMetrics(context.metrics(), name, "task." + context.taskId());
             nodeMetrics.metrics.measureLatencyNs(time, initDelegate, nodeMetrics.nodeCreationSensor);
         } catch (Exception e) {
             throw new StreamsException(String.format("failed to initialize processor %s",
name), e);
@@ -164,7 +164,7 @@ public class ProcessorNode<K, V> {
         return sb.toString();
     }
 
-    protected class NodeMetrics  {
+    protected static final class NodeMetrics  {
         final StreamsMetricsImpl metrics;
         final String metricGrpName;
         final Map<String, String> metricTags;


Mime
View raw message