You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/01/18 20:34:27 UTC

[GitHub] [ozone] amaliujia opened a new pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

amaliujia opened a new pull request #1819:
URL: https://github.com/apache/ozone/pull/1819


   ## What changes were proposed in this pull request?
   
   Allow Default Space Quota Unit as Bytes.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-4721
   
   ## How was this patch tested?
   
   UT


----------------------------------------------------------------
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:
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] ayushtkn commented on pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on pull request #1819:
URL: https://github.com/apache/ozone/pull/1819#issuecomment-764400342


   Thanx @amaliujia for the contribution and @captainzmc for the 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.

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] captainzmc commented on pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

Posted by GitBox <gi...@apache.org>.
captainzmc commented on pull request #1819:
URL: https://github.com/apache/ozone/pull/1819#issuecomment-763290461


   Thanks for @amaliujia‘s PR.  LGTM overall. 
   Can you also add test case in TestOzoneRpcClientAbstract.testSetAndClrQuota() for test Java API?
   


----------------------------------------------------------------
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:
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] ayushtkn commented on pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on pull request #1819:
URL: https://github.com/apache/ozone/pull/1819#issuecomment-764400342


   Thanx @amaliujia for the contribution and @captainzmc for the 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.

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] ayushtkn merged pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

Posted by GitBox <gi...@apache.org>.
ayushtkn merged pull request #1819:
URL: https://github.com/apache/ozone/pull/1819


   


----------------------------------------------------------------
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:
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] amaliujia closed pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

Posted by GitBox <gi...@apache.org>.
amaliujia closed pull request #1819:
URL: https://github.com/apache/ozone/pull/1819


   


----------------------------------------------------------------
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:
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] ayushtkn merged pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

Posted by GitBox <gi...@apache.org>.
ayushtkn merged pull request #1819:
URL: https://github.com/apache/ozone/pull/1819


   


----------------------------------------------------------------
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:
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] amaliujia commented on pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #1819:
URL: https://github.com/apache/ozone/pull/1819#issuecomment-762459637


   R: @captainzmc 


----------------------------------------------------------------
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:
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] amaliujia commented on a change in pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #1819:
URL: https://github.com/apache/ozone/pull/1819#discussion_r560383263



##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java
##########
@@ -704,6 +704,16 @@ public void testShQuota() throws Exception {
     assertEquals(100, objectStore.getVolume("vol4")
         .getBucket("buck4").getQuotaInNamespace());
 
+    // test whether supports default quota unit as bytes.
+    String[] bucketArgs5 = new String[]{"bucket", "setquota", "vol4/buck4",
+        "--space-quota", "500"};
+    execute(ozoneShell, bucketArgs5);
+    out.reset();
+    assertEquals(500, objectStore.getVolume("vol4")
+        .getBucket("buck4").getQuotaInBytes());
+    assertEquals(100, objectStore.getVolume("vol4")
+        .getBucket("buck4").getQuotaInNamespace());
+

Review comment:
       O yes. That's more like a extra check to see the namespace quota remains the same. But removing it won't hurt anything.




----------------------------------------------------------------
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:
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] amaliujia commented on pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

Posted by GitBox <gi...@apache.org>.
amaliujia commented on pull request #1819:
URL: https://github.com/apache/ozone/pull/1819#issuecomment-763362593


   @captainzmc done!


----------------------------------------------------------------
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:
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] amaliujia commented on a change in pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #1819:
URL: https://github.com/apache/ozone/pull/1819#discussion_r561241498



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java
##########
@@ -193,6 +193,11 @@ public static OzoneQuota parseSpaceQuota(String quotaInBytes) {
           break;
         }
       }
+      // there might be no unit specified.
+      if (size.equals("")) {
+        size = uppercase;
+        currUnit = Units.B;

Review comment:
       Done!

##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java
##########
@@ -193,6 +193,11 @@ public static OzoneQuota parseSpaceQuota(String quotaInBytes) {
           break;
         }
       }
+      // there might be no unit specified.
+      if (size.equals("")) {
+        size = uppercase;
+        currUnit = Units.B;

Review comment:
       Good catch Done!




----------------------------------------------------------------
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:
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] ayushtkn commented on a change in pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on a change in pull request #1819:
URL: https://github.com/apache/ozone/pull/1819#discussion_r560130214



##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java
##########
@@ -704,6 +704,16 @@ public void testShQuota() throws Exception {
     assertEquals(100, objectStore.getVolume("vol4")
         .getBucket("buck4").getQuotaInNamespace());
 
+    // test whether supports default quota unit as bytes.
+    String[] bucketArgs5 = new String[]{"bucket", "setquota", "vol4/buck4",
+        "--space-quota", "500"};
+    execute(ozoneShell, bucketArgs5);
+    out.reset();
+    assertEquals(500, objectStore.getVolume("vol4")
+        .getBucket("buck4").getQuotaInBytes());
+    assertEquals(100, objectStore.getVolume("vol4")
+        .getBucket("buck4").getQuotaInNamespace());
+

Review comment:
       Isn't this same as L704? If so, I don't think we changed anything on the namespace quota side, so no need of this?




----------------------------------------------------------------
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:
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] ayushtkn commented on a change in pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

Posted by GitBox <gi...@apache.org>.
ayushtkn commented on a change in pull request #1819:
URL: https://github.com/apache/ozone/pull/1819#discussion_r561098330



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java
##########
@@ -193,6 +193,11 @@ public static OzoneQuota parseSpaceQuota(String quotaInBytes) {
           break;
         }
       }
+      // there might be no unit specified.
+      if (size.equals("")) {
+        size = uppercase;
+        currUnit = Units.B;

Review comment:
       if size is empty, currUnit will be Units.B already, do we need to re assign it here




----------------------------------------------------------------
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:
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] amaliujia commented on a change in pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #1819:
URL: https://github.com/apache/ozone/pull/1819#discussion_r561241498



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java
##########
@@ -193,6 +193,11 @@ public static OzoneQuota parseSpaceQuota(String quotaInBytes) {
           break;
         }
       }
+      // there might be no unit specified.
+      if (size.equals("")) {
+        size = uppercase;
+        currUnit = Units.B;

Review comment:
       Done!

##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/OzoneQuota.java
##########
@@ -193,6 +193,11 @@ public static OzoneQuota parseSpaceQuota(String quotaInBytes) {
           break;
         }
       }
+      // there might be no unit specified.
+      if (size.equals("")) {
+        size = uppercase;
+        currUnit = Units.B;

Review comment:
       Good catch Done!




----------------------------------------------------------------
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:
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] amaliujia commented on a change in pull request #1819: HDDS-4721. Allow Default Space Quota Unit as Bytes

Posted by GitBox <gi...@apache.org>.
amaliujia commented on a change in pull request #1819:
URL: https://github.com/apache/ozone/pull/1819#discussion_r560401837



##########
File path: hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/shell/TestOzoneShellHA.java
##########
@@ -704,6 +704,16 @@ public void testShQuota() throws Exception {
     assertEquals(100, objectStore.getVolume("vol4")
         .getBucket("buck4").getQuotaInNamespace());
 
+    // test whether supports default quota unit as bytes.
+    String[] bucketArgs5 = new String[]{"bucket", "setquota", "vol4/buck4",
+        "--space-quota", "500"};
+    execute(ozoneShell, bucketArgs5);
+    out.reset();
+    assertEquals(500, objectStore.getVolume("vol4")
+        .getBucket("buck4").getQuotaInBytes());
+    assertEquals(100, objectStore.getVolume("vol4")
+        .getBucket("buck4").getQuotaInNamespace());
+

Review comment:
       Removed the namespace check as it is not relevant 




----------------------------------------------------------------
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:
users@infra.apache.org



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