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 2020/09/14 13:26:21 UTC

[GitHub] [kafka] rajinisivaram commented on a change in pull request #9272: KAFKA-10458; Updating controller quota does not work since Token Bucket

rajinisivaram commented on a change in pull request #9272:
URL: https://github.com/apache/kafka/pull/9272#discussion_r487909815



##########
File path: clients/src/main/java/org/apache/kafka/common/metrics/Sensor.java
##########
@@ -53,12 +54,20 @@
     private final Object metricLock;
 
     private static class StatAndConfig {
-        public final Stat stat;
-        public final MetricConfig config;
+        private final Stat stat;
+        private final Supplier<MetricConfig> configSupplier;
 
-        StatAndConfig(Stat stat, MetricConfig config) {
+        StatAndConfig(Stat stat, Supplier<MetricConfig> configSupplier) {
             this.stat = stat;
-            this.config = config;
+            this.configSupplier = configSupplier;
+        }
+
+        public Stat stat() {
+            return this.stat;
+        }
+
+        public MetricConfig config() {
+            return this.configSupplier.get();

Review comment:
       I guess if you are removing `this.` above, you could remove it here as well for consistency.

##########
File path: clients/src/main/java/org/apache/kafka/common/metrics/Sensor.java
##########
@@ -53,12 +54,20 @@
     private final Object metricLock;
 
     private static class StatAndConfig {
-        public final Stat stat;
-        public final MetricConfig config;
+        private final Stat stat;
+        private final Supplier<MetricConfig> configSupplier;
 
-        StatAndConfig(Stat stat, MetricConfig config) {
+        StatAndConfig(Stat stat, Supplier<MetricConfig> configSupplier) {
             this.stat = stat;
-            this.config = config;
+            this.configSupplier = configSupplier;
+        }
+
+        public Stat stat() {
+            return this.stat;
+        }
+
+        public MetricConfig config() {
+            return this.configSupplier.get();

Review comment:
       I guess if you are removing `this.` above, you could remove it here as well for consistency.




----------------------------------------------------------------
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