kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject [kafka] branch trunk updated: KAFKA-9404: Use ArrayList instead of LinkedList in Sensor (#7936)
Date Wed, 18 Mar 2020 13:39:15 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/trunk by this push:
     new da7d134  KAFKA-9404: Use ArrayList instead of LinkedList in Sensor (#7936)
da7d134 is described below

commit da7d1346407a84293755d996fad70bc82adae4a1
Author: belugabehr <12578579+belugabehr@users.noreply.github.com>
AuthorDate: Wed Mar 18 09:38:36 2020 -0400

    KAFKA-9404: Use ArrayList instead of LinkedList in Sensor (#7936)
    
    The former is generally a better option than the latter.
    
    Reviewers: Ron Dagostino <rdagostino@confluent.io>, Ismael Juma <ismael@juma.me.uk>
---
 clients/src/main/java/org/apache/kafka/common/metrics/Sensor.java | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/clients/src/main/java/org/apache/kafka/common/metrics/Sensor.java b/clients/src/main/java/org/apache/kafka/common/metrics/Sensor.java
index ccf8cb4..1402d06 100644
--- a/clients/src/main/java/org/apache/kafka/common/metrics/Sensor.java
+++ b/clients/src/main/java/org/apache/kafka/common/metrics/Sensor.java
@@ -23,7 +23,6 @@ import org.apache.kafka.common.utils.Time;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -306,7 +305,7 @@ public final class Sensor {
     }
 
     synchronized List<KafkaMetric> metrics() {
-        return unmodifiableList(new LinkedList<>(this.metrics.values()));
+        return unmodifiableList(new ArrayList<>(this.metrics.values()));
     }
 
     /**


Mime
View raw message