adoroszlai commented on a change in pull request #2513:
URL: https://github.com/apache/ozone/pull/2513#discussion_r685850425



##########
File path: 
hadoop-hdds/config/src/main/java/org/apache/hadoop/hdds/conf/TimeDurationUtil.java
##########
@@ -50,6 +50,9 @@ public static long getTimeDurationHelper(String name, String 
vStr,
     if (null == vUnit) {
       LOG.warn("No unit for " + name + "(" + vStr + ") assuming " + unit);
       vUnit = ParsedTimeDuration.unitFor(unit);
+      if(null == vUnit){
+        throw new NullPointerException("Unexpected unit" + unit);

Review comment:
       I think `IllegalArgumentException` more closely matches the problem than 
`NullPointerException`.
   
   ```suggestion
           throw new IllegalArgumentException("Unexpected unit: " + unit);
   ```

##########
File path: 
hadoop-hdds/config/src/main/java/org/apache/hadoop/hdds/conf/TimeDurationUtil.java
##########
@@ -50,6 +50,9 @@ public static long getTimeDurationHelper(String name, String 
vStr,
     if (null == vUnit) {
       LOG.warn("No unit for " + name + "(" + vStr + ") assuming " + unit);
       vUnit = ParsedTimeDuration.unitFor(unit);
+      if(null == vUnit){

Review comment:
       Nit:
   
   ```suggestion
         if (null == vUnit) {
   ```




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to