You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/06/09 16:11:05 UTC

[GitHub] [kafka] jlprat commented on a change in pull request #10856: MINOR: Small optimizations and removal of unused code in Streams

jlprat commented on a change in pull request #10856:
URL: https://github.com/apache/kafka/pull/10856#discussion_r648463106



##########
File path: streams/src/main/java/org/apache/kafka/streams/kstream/internals/graph/BaseJoinProcessorNode.java
##########
@@ -63,10 +63,6 @@
         return joinMergeProcessorParameters;
     }
 
-    ValueJoinerWithKey<? super K, ? super V1, ? super V2, ? extends VR> valueJoiner() {

Review comment:
       As it is an internal class and this method is not use in the code base, I assume is safe to delete.

##########
File path: streams/src/main/java/org/apache/kafka/streams/kstream/internals/foreignkeyjoin/CombinedKey.java
##########
@@ -39,9 +39,6 @@ public KP getPrimaryKey() {
     }
 
     public boolean equals(final KF foreignKey, final KP primaryKey) {
-        if (this.primaryKey == null) {

Review comment:
       This is removed because `primaryKey` is guaranteed in constructor to never be null.

##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/metrics/StreamsMetricsImpl.java
##########
@@ -294,14 +293,6 @@ public final void removeAllThreadLevelSensors(final String threadId) {
         return tagMap;
     }
 
-    public Map<String, String> bufferLevelTagMap(final String threadId,

Review comment:
       This public function on an internal class is never used in our code base, so I assume it is safe to delete.

##########
File path: streams/src/test/java/org/apache/kafka/streams/integration/TableTableJoinIntegrationTest.java
##########
@@ -59,11 +59,11 @@ public void prepareTopology() throws InterruptedException {
         rightTable = builder.table(INPUT_TOPIC_RIGHT, Materialized.<Long, String, KeyValueStore<Bytes, byte[]>>as("right").withLoggingDisabled());
     }
 
-    final private TestRecord<Long, String> expectedFinalJoinResult = new TestRecord<>(ANY_UNIQUE_KEY, "D-d", null, 15L);
-    final private TestRecord<Long, String> expectedFinalMultiJoinResult = new TestRecord<>(ANY_UNIQUE_KEY, "D-d-d", null,  15L);
-    final private String storeName = appID + "-store";
+    private final TestRecord<Long, String> expectedFinalJoinResult = new TestRecord<>(ANY_UNIQUE_KEY, "D-d", null, 15L);

Review comment:
       Just using the `private final` order consistently

##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/metrics/StreamsMetricsImpl.java
##########
@@ -562,10 +553,6 @@ private String externalChildSensorName(final String threadId, final String opera
             + SENSOR_NAME_DELIMITER + operationName;
     }
 
-    private String externalParentSensorName(final String threadId, final String operationName) {

Review comment:
       This private function was never used

##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/metrics/StreamsMetricsImpl.java
##########
@@ -246,15 +245,15 @@ public final void removeAllClientLevelSensorsAndMetrics() {
         removeAllClientLevelMetrics();
     }
 
-    private final void removeAllClientLevelMetrics() {

Review comment:
       `private` and `final` together doesn't really make sense




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org