ayushtkn commented on code in PR #5519:
URL: https://github.com/apache/ozone/pull/5519#discussion_r1400439465
##########
hadoop-hdds/config/src/main/java/org/apache/hadoop/hdds/conf/StorageSize.java:
##########
@@ -91,6 +91,19 @@ public static StorageSize parse(String value) {
}
+ public static StorageSize parse(String value, StorageUnit defaultUnit) {
+ try {
+ return parse(value);
+ } catch (IllegalArgumentException e) {
+ try {
+ return parse(value + defaultUnit.getShortName());
Review Comment:
Shouldn't this be
```
return new StorageSize(defaultUnit, Double.parseDouble(value));
```
else there is redundant parsing for this unit inside the parse(..) &
moreover I belive with this approach, 25K, 50M will also work because we suffix
B in the end & it will become 25KB & 50MB
--
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]