You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "jyotirmoy-gh (via GitHub)" <gi...@apache.org> on 2023/09/14 08:56:30 UTC

[GitHub] [ozone] jyotirmoy-gh opened a new pull request, #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

jyotirmoy-gh opened a new pull request, #5294:
URL: https://github.com/apache/ozone/pull/5294

   ## What changes were proposed in this pull request?
   
   Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota
   
   Issue observed -
   ```
   [root@vc0101 ~]# ozone sh bucket create vol1/buck5 --namespace-quota test
   For input string: "test"
   [root@vc0101 ~]# ozone sh volume create vol2 --namespace-quota test
   For input string: "test"
   [root@vc0101 ~]# ozone sh bucket setquota vol1/buck1 --namespace-quota test
   For input string: "test"
   [root@vc0101 ~]# ozone sh volume setquota vol1 --namespace-quota test
   For input string: "test" 
   [root@vc0101 ~]# ozone sh bucket create vol1/buck6 --namespace-quota 1.5
   For input string: "1.5" 
   ```
   Solution provided -
   ```
   bash-4.2$ ozone sh volume create vol1 --namespace-quota test
   Invalid values for quota, to ensure that the Quota format is legal(supported values are positive long values).
   bash-4.2$ ozone sh volume create vol1 --namespace-quota 1.5
   Invalid values for quota, to ensure that the Quota format is legal(supported values are positive long values).
   bash-4.2$ ozone sh volume create vol1
   bash-4.2$ ozone sh volume setquota vol1 --namespace-quota test
   Invalid values for quota, to ensure that the Quota format is legal(supported values are positive long values).
   bash-4.2$ ozone sh volume setquota vol1 --namespace-quota 1.5
   Invalid values for quota, to ensure that the Quota format is legal(supported values are positive long values).
   bash-4.2$ ozone sh bucket create vol1/buck1 --namespace-quota test
   Invalid values for quota, to ensure that the Quota format is legal(supported values are positive long values).
   bash-4.2$ ozone sh bucket create vol1/buck1 --namespace-quota 1.5
   Invalid values for quota, to ensure that the Quota format is legal(supported values are positive long values).
   bash-4.2$ ozone sh bucket create vol1/buck1
   bash-4.2$ ozone sh bucket setquota vol1/buck1 --namespace-quota test
   Invalid values for quota, to ensure that the Quota format is legal(supported values are positive long values).
   bash-4.2$ ozone sh bucket setquota vol1/buck1 --namespace-quota 1.5
   Invalid values for quota, to ensure that the Quota format is legal(supported values are positive long values).
   ```
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-9278
   
   ## How was this patch tested?
   
   Tested manually on docker environment
   


-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] jyotirmoy-gh commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "jyotirmoy-gh (via GitHub)" <gi...@apache.org>.
jyotirmoy-gh commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1329936543


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +216,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid value for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException(quotaInNamespace + " is invalid. " +
+          "The quota value should be a positive integer between 1 and Long.MAX_VALUE");

Review Comment:
   The actual value of Long.MAX_VALUE is actually very large, it might not be very acceptable for a regular user. We can maybe just make the error message as "positive integer". For more details on limits the user can refer to [documentation](https://github.com/apache/ozone/blob/ea9930591b4dd44b88d55241aecff22ef202b17c/hadoop-hdds/docs/content/feature/Quota.md?plain=1#L143) where the proper definitions are mentioned.



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] jyotirmoy-gh commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "jyotirmoy-gh (via GitHub)" <gi...@apache.org>.
jyotirmoy-gh commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1326776659


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid value for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException(quotaInNamespace + " is invalid. " +
+          "The quota value should be a positive integer.");

Review Comment:
   Changed to "positive long"



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] ashishkumar50 commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "ashishkumar50 (via GitHub)" <gi...@apache.org>.
ashishkumar50 commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1326770616


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid value for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException(quotaInNamespace + " is invalid. " +
+          "The quota value should be a positive integer.");

Review Comment:
   I think this should be "positive long" instead of "positive integer".



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] jyotirmoy-gh commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "jyotirmoy-gh (via GitHub)" <gi...@apache.org>.
jyotirmoy-gh commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1329936543


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +216,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid value for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException(quotaInNamespace + " is invalid. " +
+          "The quota value should be a positive integer between 1 and Long.MAX_VALUE");

Review Comment:
   The actual value of Long.MAX_VALUE is actually very large, it might not be very acceptable for a regular user. We can maybe just make the error message as "positive integer". For more details on limits the user can refer to [documentation](https://github.com/apache/ozone/blob/ea9930591b4dd44b88d55241aecff22ef202b17c/hadoop-hdds/docs/content/feature/Quota.md?plain=1#L143) where the proper definitions are mentioned.
   
   If required we can specify the number limit in the documentation.



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sodonnel commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1325826633


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid values for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException("Invalid values for quota, to ensure" +

Review Comment:
   This error message is a bit long. What about:
   
   > <value> is invalid. The quota value should be a positive integer.



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] jyotirmoy-gh commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "jyotirmoy-gh (via GitHub)" <gi...@apache.org>.
jyotirmoy-gh commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1325906549


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid values for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException("Invalid values for quota, to ensure" +

Review Comment:
   Shortened the error message



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] jyotirmoy-gh commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "jyotirmoy-gh (via GitHub)" <gi...@apache.org>.
jyotirmoy-gh commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1327047021


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid value for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException(quotaInNamespace + " is invalid. " +
+          "The quota value should be a positive integer.");

Review Comment:
   Maybe we can term it to integer, specifying the limits in brackets just as space-quota error [message](https://github.com/apache/ozone/blob/43cdb74fc455430d5f3fd72026b617cbb1a2bd47/hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java#L197).



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sodonnel commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1329943145


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +216,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid value for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException(quotaInNamespace + " is invalid. " +
+          "The quota value should be a positive integer between 1 and Long.MAX_VALUE");

Review Comment:
   Lets switch it back to positive integer and then I think we are good.



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sodonnel commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1329925968


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +216,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid value for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException(quotaInNamespace + " is invalid. " +
+          "The quota value should be a positive integer between 1 and Long.MAX_VALUE");

Review Comment:
   I was going to suggest we should put the actual value of Long.MAX_VALUE in, rather than the string, but the max value is apparently 9223372036854775807, which isn't all that user friendly either. But it doesn't feel right that the error should say "between 1 and Long.MAX_VALUE". So I think that either we should put the very long number in, or just have it as "The quota value should be a positive integer number of bytes" or something like that.
   
   Sorry we keep iterating on this - its probably not even all that important, but as its a user facing error its good to make it explain the problem as much as possible.



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sodonnel commented on pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel commented on PR #5294:
URL: https://github.com/apache/ozone/pull/5294#issuecomment-1719801607

   There appears to be some related test failures here. Please have a look and see if you can figure out how this change is breaking them.


-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sodonnel merged pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel merged PR #5294:
URL: https://github.com/apache/ozone/pull/5294


-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] jyotirmoy-gh commented on pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "jyotirmoy-gh (via GitHub)" <gi...@apache.org>.
jyotirmoy-gh commented on PR #5294:
URL: https://github.com/apache/ozone/pull/5294#issuecomment-1720004410

   Fixed the affected failing tests -
   ```
   [INFO] -------------------------------------------------------
   [INFO]  T E S T S
   [INFO] -------------------------------------------------------
   [INFO] Running org.apache.hadoop.ozone.shell.TestOzoneShellHA
   [INFO] Tests run: 22, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 587.71 s - in org.apache.hadoop.ozone.shell.TestOzoneShellHA
   [INFO]
   [INFO] Results:
   [INFO]
   [INFO] Tests run: 22, Failures: 0, Errors: 0, Skipped: 0
   ```
   ```
   [INFO] -------------------------------------------------------
   [INFO]  T E S T S
   [INFO] -------------------------------------------------------
   [INFO] Running org.apache.hadoop.ozone.client.rpc.TestOzoneRpcClient
   [WARNING] Tests run: 121, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 327.426 s - in org.apache.hadoop.ozone.client.rpc.TestOzoneRpcClient
   [INFO] Running org.apache.hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis
   [WARNING] Tests run: 124, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 906.149 s - in org.apache.hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis
   [INFO] Running org.apache.hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
   [WARNING] Tests run: 124, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 58.53 s - in org.apache.hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
   [INFO]
   [INFO] Results:
   [INFO]
   [WARNING] Tests run: 369, Failures: 0, Errors: 0, Skipped: 4
   ```


-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sodonnel commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1325826633


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid values for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException("Invalid values for quota, to ensure" +

Review Comment:
   This error message is a bit long. What about:
   
   > "passed value" is invalid. The quota value should be a positive integer.
   
   Put in the actual passed value in place of "passed value"



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] ashishkumar50 commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "ashishkumar50 (via GitHub)" <gi...@apache.org>.
ashishkumar50 commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1327094991


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid value for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException(quotaInNamespace + " is invalid. " +
+          "The quota value should be a positive integer.");

Review Comment:
   I think we can update `namespace-quota` and `space-quota` which is handled in this PR. Also please update in PR description with the new error message.



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sodonnel commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1325823523


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid values for namespace quota: " + nameSpaceQuota);

Review Comment:
   Typo: values -> value



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sodonnel commented on pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel commented on PR #5294:
URL: https://github.com/apache/ozone/pull/5294#issuecomment-1720907147

   There is a conflict that needs resolved on the latest commit.


-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sodonnel commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1327400390


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid value for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException(quotaInNamespace + " is invalid. " +
+          "The quota value should be a positive integer.");

Review Comment:
   Maybe:
   
   ```
   <quota-value> is invalid. The quota value should be a positive integer between 1 and Long.MAX_VALUE
   ```
   Is slightly better.



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] jyotirmoy-gh commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "jyotirmoy-gh (via GitHub)" <gi...@apache.org>.
jyotirmoy-gh commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1325905986


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid values for namespace quota: " + nameSpaceQuota);

Review Comment:
   Corrected the typo



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sodonnel commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1326996193


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid value for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException(quotaInNamespace + " is invalid. " +
+          "The quota value should be a positive integer.");

Review Comment:
   I don't know. What is a "long" to someone who is not a programmer? Most people know what an "integer" is, but a long is a programmer term and not well understood, hence my suggestion to change it to integer for the purposes of an error message. "Number" would have been better, but that does not run out decimal points etc.



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] ashishkumar50 commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "ashishkumar50 (via GitHub)" <gi...@apache.org>.
ashishkumar50 commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1327035021


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid value for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException(quotaInNamespace + " is invalid. " +
+          "The quota value should be a positive integer.");

Review Comment:
   I think we should change in other places also like one in PR description to make it consistent.
   
   `bash-4.2$ ozone sh volume create vol1 --namespace-quota test
   Invalid values for quota, to ensure that the Quota format is legal(supported values are positive long values).
   `



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] jyotirmoy-gh commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "jyotirmoy-gh (via GitHub)" <gi...@apache.org>.
jyotirmoy-gh commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1327112256


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid value for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException(quotaInNamespace + " is invalid. " +
+          "The quota value should be a positive integer.");

Review Comment:
   Suggested error message :
   -  space-quota 
   `<quota-value> is invalid. The quota value should be a positive integer(Long.MAX_VALUE) with byte numeration(B, KB, MB, GB and TB)`
   - namespace-quota
   `<quota-value> is invalid. The quota value should be a positive integer(Long.MAX_VALUE)`
   
   We can make this as the error messages for respective quotas.



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] jyotirmoy-gh commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "jyotirmoy-gh (via GitHub)" <gi...@apache.org>.
jyotirmoy-gh commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1329809995


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid value for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException(quotaInNamespace + " is invalid. " +
+          "The quota value should be a positive integer.");

Review Comment:
   Implemented the latest discussed message and related tests. Please review



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] jyotirmoy-gh commented on pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "jyotirmoy-gh (via GitHub)" <gi...@apache.org>.
jyotirmoy-gh commented on PR #5294:
URL: https://github.com/apache/ozone/pull/5294#issuecomment-1719068305

   @sumitagrawl @sadanand48 @smengcl @nilotpalnandi - Please review


-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] jyotirmoy-gh commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "jyotirmoy-gh (via GitHub)" <gi...@apache.org>.
jyotirmoy-gh commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1325906549


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid values for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException("Invalid values for quota, to ensure" +

Review Comment:
   Shortened the error message
   New output -
   ```
   bash-4.2$ ozone sh volume create vol1 --namespace-quota test
   test is invalid. The quota value should be a positive integer.
   bash-4.2$ ozone sh volume create vol1 --namespace-quota 1.5
   1.5 is invalid. The quota value should be a positive integer.
   ```



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org


[GitHub] [ozone] sodonnel commented on a diff in pull request #5294: HDDS-9278. Return proper error message thrown when text/decimal is supplied as a parameter for namespace-quota

Posted by "sodonnel (via GitHub)" <gi...@apache.org>.
sodonnel commented on code in PR #5294:
URL: https://github.com/apache/ozone/pull/5294#discussion_r1327079957


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java:
##########
@@ -218,12 +218,17 @@ public static OzoneQuota parseNameSpaceQuota(String quotaInNamespace) {
       throw new IllegalArgumentException(
           "Quota string cannot be null or empty.");
     }
-    long nameSpaceQuota = Long.parseLong(quotaInNamespace);
-    if (nameSpaceQuota <= 0) {
-      throw new IllegalArgumentException(
-          "Invalid values for namespace quota: " + nameSpaceQuota);
+    try {
+      long nameSpaceQuota = Long.parseLong(quotaInNamespace);
+      if (nameSpaceQuota <= 0) {
+        throw new IllegalArgumentException(
+            "Invalid value for namespace quota: " + nameSpaceQuota);
+      }
+      return new OzoneQuota(nameSpaceQuota, new RawQuotaInBytes(Units.B, -1));
+    } catch (NumberFormatException e) {
+      throw new IllegalArgumentException(quotaInNamespace + " is invalid. " +
+          "The quota value should be a positive integer.");

Review Comment:
   Integer with limits makes sense. 
   
   If this same problem exists in other commands, it would be good to clean it all up in one go here if we can, and make it all consistent?



-- 
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: issues-unsubscribe@ozone.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org