chia7712 commented on code in PR #19068:
URL: https://github.com/apache/kafka/pull/19068#discussion_r2033623742


##########
clients/src/main/java/org/apache/kafka/common/internals/Plugin.java:
##########
@@ -44,6 +44,12 @@ public static <T> Plugin<T> wrapInstance(T instance, Metrics 
metrics, String key
         return wrapInstance(instance, metrics, () -> tags(key, instance));
     }
 
+    public static <T> Plugin<T> wrapInstance(T instance, Metrics metrics, 
String key, Map<String, String> extraTags) {
+        Map<String, String> tags = tags(key, instance);
+        tags.putAll(extraTags);
+        return wrapInstance(instance, metrics, () -> tags);

Review Comment:
   It seems the method `wrapInstance` expect to address lazy creation, right?
   ```java
           return wrapInstance(instance, metrics, () -> {
               Map<String, String> tags = tags(key, instance);
               tags.putAll(extraTags);
               return tags;
           });
   ```



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

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

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

Reply via email to