davidradl commented on code in PR #27642:
URL: https://github.com/apache/flink/pull/27642#discussion_r2839862725


##########
flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java:
##########
@@ -31,72 +38,108 @@ public String getString(String key, String defaultValue) {
     }
 
     /**
-     * Searches for the property with the specified key in this property list. 
If the key is not
-     * found in this property list, the default property list, and its 
defaults, recursively, are
-     * then checked. The method returns the default value argument if the 
property is not found.
+     * Returns the value associated with the given key as an {@code int}.
+     *
+     * <p>If the value is a {@link Number}, its {@code intValue()} is returned 
directly. Otherwise,
+     * the value's string representation is parsed via {@link 
Integer#parseInt(String)}.
      *
      * @param key the hashtable key.
      * @param defaultValue a default value.
-     * @return the value in this property list with the specified key value 
parsed as an int.
+     * @return the value in this property list with the specified key value as 
an int.
      */
     public int getInteger(String key, int defaultValue) {
-        String argument = getProperty(key, null);
-        return argument == null ? defaultValue : Integer.parseInt(argument);
+        final Object value = get(key);

Review Comment:
   I am looking at the the flip this looks like the last subtask to to in it. 
   
   But all the callers to MetricConfig will still call getString. It looks like 
we re missing another task to change the callers to call the appropriate native 
getter. Or better still add in the callers to this PR



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to