You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/03/11 14:59:30 UTC

[GitHub] [druid] FrankChen021 commented on a change in pull request #12316: Adding k8s support for human readable parsing

FrankChen021 commented on a change in pull request #12316:
URL: https://github.com/apache/druid/pull/12316#discussion_r824794808



##########
File path: core/src/main/java/org/apache/druid/java/util/common/HumanReadableBytes.java
##########
@@ -159,10 +159,18 @@ private static long parseInner(String rawNumber)
         throw new IAE("Invalid format of number: %s", rawNumber);
       }
 
+      unit = number.charAt(lastDigitIndex--);
+      isBinaryByte = true;
+    } else if (unit == 'i') {
+      //unit ends with 'i' must be format of Ki/Mi/Gi/Ti/Pi, so at least 2 extra characters are required
+      if (lastDigitIndex < 1) {
+        throw new IAE("Invalid format of number: %s", rawNumber);
+      }
       unit = number.charAt(lastDigitIndex--);
       isBinaryByte = true;
     }
 
+

Review comment:
       accidental change?




-- 
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: commits-unsubscribe@druid.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org