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:
us...@infra.apache.org


Reply via email to