kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mj...@apache.org
Subject [kafka] 01/01: Findbugs
Date Thu, 19 Jul 2018 18:43:43 GMT
This is an automated email from the ASF dual-hosted git repository.

mjsax pushed a commit to branch minor-internal-config
in repository https://gitbox.apache.org/repos/asf/kafka.git

commit 923f6fb5678e8dcb67ab83c648e055f2aaf41f20
Author: Matthias J. Sax <matthias@confluent.io>
AuthorDate: Thu Jul 19 11:43:13 2018 -0700

    Findbugs
---
 .../processor/internals/InternalTopicManager.java  |  2 +-
 .../internals/StreamsPartitionAssignor.java        | 22 +++++++++-------------
 2 files changed, 10 insertions(+), 14 deletions(-)

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 36fbda6..6159ee2 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
@@ -43,7 +43,7 @@ public class InternalTopicManager {
     private final static String INTERRUPTED_ERROR_MESSAGE = "Thread got interrupted. This
indicates a bug. " +
         "Please report at https://issues.apache.org/jira/projects/KAFKA or dev-mailing list
(https://kafka.apache.org/contact).";
 
-    private final class InternalAdminClientConfig extends AdminClientConfig {
+    private static final class InternalAdminClientConfig extends AdminClientConfig {
         private InternalAdminClientConfig(final Map<?, ?> props) {
             super(props, false);
         }
diff --git a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java
b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java
index 519ff67..afe6fbd 100644
--- a/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java
+++ b/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java
@@ -64,7 +64,6 @@ public class StreamsPartitionAssignor implements PartitionAssignor, Configurable
     private final static int VERSION_TWO = 2;
     private final static int VERSION_THREE = 3;
     private final static int EARLIEST_PROBEABLE_VERSION = VERSION_THREE;
-    private int minReceivedMetadataVersion = UNKNOWN;
     protected Set<Integer> supportedVersions = new HashSet<>();
 
     private Logger log;
@@ -166,23 +165,19 @@ public class StreamsPartitionAssignor implements PartitionAssignor,
Configurable
         }
     }
 
-    private final class InternalStreamsConfig extends StreamsConfig {
+    private static final class InternalStreamsConfig extends StreamsConfig {
         private InternalStreamsConfig(final Map<?, ?> props) {
             super(props, false);
         }
     }
 
-    protected static final Comparator<TopicPartition> PARTITION_COMPARATOR = new Comparator<TopicPartition>()
{
-        @Override
-        public int compare(final TopicPartition p1,
-                           final TopicPartition p2) {
-            final int result = p1.topic().compareTo(p2.topic());
+    protected static final Comparator<TopicPartition> PARTITION_COMPARATOR = (p1, p2)
-> {
+        final int result = p1.topic().compareTo(p2.topic());
 
-            if (result != 0) {
-                return result;
-            } else {
-                return Integer.compare(p1.partition(), p2.partition());
-            }
+        if (result != 0) {
+            return result;
+        } else {
+            return Integer.compare(p1.partition(), p2.partition());
         }
     };
 
@@ -352,7 +347,8 @@ public class StreamsPartitionAssignor implements PartitionAssignor, Configurable
         final Map<UUID, ClientMetadata> clientsMetadata = new HashMap<>();
         final Set<String> futureConsumers = new HashSet<>();
 
-        minReceivedMetadataVersion = SubscriptionInfo.LATEST_SUPPORTED_VERSION;
+        int minReceivedMetadataVersion = SubscriptionInfo.LATEST_SUPPORTED_VERSION;
+
         supportedVersions.clear();
         int futureMetadataVersion = UNKNOWN;
         for (final Map.Entry<String, Subscription> entry : subscriptions.entrySet())
{


Mime
View raw message