zhuzhurk commented on a change in pull request #9686: [FLINK-14069] [core] 
Enable TimeUtils for all time units labels supported by scala Duration
URL: https://github.com/apache/flink/pull/9686#discussion_r324956726
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/util/TimeUtils.java
 ##########
 @@ -29,9 +33,23 @@
  */
 public class TimeUtils {
 
+       private static final Map<String, ChronoUnit> LABEL_TO_UNIT_MAP = 
Collections.unmodifiableMap(initMap());
+
        /**
         * Parse the given string to a java {@link Duration}.
-        * The string is like "123ms", "321s", "12min" and such.
+        * The string is in format "{length value}{time unit label}", e.g. 
"123ms", "321 s".
+        * If no time unit label is specified, it will be considered as 
milliseconds.
 
 Review comment:
   TimeUtils was already supporting non-labeled duration parsed as millisecond 
duration.
   I think we should keep it to not break anything which is already using it.

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


With regards,
Apache Git Services

Reply via email to