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 2020/09/24 04:28:47 UTC

[GitHub] [hadoop-ozone] amaliujia opened a new pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

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


   ## What changes were proposed in this pull request?
   
   Volume namespace: add usedNamespace and update it when create and delete bucket
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-4272
   
   ## How was this patch tested?
   
   Unit Test
   


----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] amaliujia commented on a change in pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

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



##########
File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmVolumeArgs.java
##########
@@ -68,15 +69,16 @@
       "builder."})
   private OmVolumeArgs(String adminName, String ownerName, String volume,
       long quotaInBytes, long quotaInCounts, Map<String, String> metadata,
-      long usedBytes, OmOzoneAclMap aclMap, long creationTime,
-      long modificationTime, long objectID, long updateID) {
+      long usedBytes, long usedNamespace, OmOzoneAclMap aclMap,
+      long creationTime, long modificationTime, long objectID, long updateID) {

Review comment:
       I see. `@param usedNamespace` and updated both description of `@param usedNamespace ` and `@param usedBytes`




----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] cxorm commented on a change in pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

Posted by GitBox <gi...@apache.org>.
cxorm commented on a change in pull request #1445:
URL: https://github.com/apache/hadoop-ozone/pull/1445#discussion_r494095636



##########
File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmVolumeArgs.java
##########
@@ -68,15 +69,16 @@
       "builder."})
   private OmVolumeArgs(String adminName, String ownerName, String volume,
       long quotaInBytes, long quotaInCounts, Map<String, String> metadata,
-      long usedBytes, OmOzoneAclMap aclMap, long creationTime,
-      long modificationTime, long objectID, long updateID) {
+      long usedBytes, long usedNamespace, OmOzoneAclMap aclMap,
+      long creationTime, long modificationTime, long objectID, long updateID) {

Review comment:
       How about we update the comment of this constructor by add `@param usedNamespace - volume quota usage in counts`
   
   The description of the parameter is IMHO, feel free to correct it if you have an idea. 
    

##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java
##########
@@ -270,6 +270,7 @@ private OzoneConsts() {
   public static final String SRC_KEY = "srcKey";
   public static final String DST_KEY = "dstKey";
   public static final String USED_BYTES = "usedBytes";
+  public static final String USED_NAMESPACE = "usedNamespace";

Review comment:
       Seems we don't use this variable, 
   Could you be so kind as to let me know its usage if I miss something.

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketDeleteRequest.java
##########
@@ -134,6 +135,12 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
       omResponse.setDeleteBucketResponse(
           DeleteBucketResponse.newBuilder().build());
 
+      // update used namespace for volumn

Review comment:
       ```suggestion
         // update used namespace for volume
   ```

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java
##########
@@ -209,7 +211,7 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
       omResponse.setCreateBucketResponse(
           CreateBucketResponse.newBuilder().build());
       omClientResponse = new OMBucketCreateResponse(omResponse.build(),
-          omBucketInfo);
+              omBucketInfo, omVolumeArgs);

Review comment:
       ```suggestion
         omClientResponse = new OMBucketCreateResponse(omResponse.build(),
             omBucketInfo, omVolumeArgs);
   ```
   It's my nit : could we use less indent here to keep consistent with this file

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java
##########
@@ -201,6 +201,8 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
       // Add default acls from volume.
       addDefaultAcls(omBucketInfo, omVolumeArgs);
 
+      // quotaAdd used namespace

Review comment:
       How about we update it this to `add quota of used namespace` or the same as `update used namespace for volume` in `OMBucketDeleteRequest`  ?

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/bucket/OMBucketCreateResponse.java
##########
@@ -66,6 +77,12 @@ public void addToDBBatch(OMMetadataManager omMetadataManager,
             omBucketInfo.getBucketName());
     omMetadataManager.getBucketTable().putWithBatch(batchOperation,
         dbBucketKey, omBucketInfo);
+    // update volume usedNamespace
+    if (omVolumeArgs != null) {
+      omMetadataManager.getVolumeTable().putWithBatch(batchOperation,
+              omMetadataManager.getVolumeKey(omVolumeArgs.getVolume()),
+              omVolumeArgs);

Review comment:
       ```suggestion
             omMetadataManager.getVolumeKey(omVolumeArgs.getVolume()),
             omVolumeArgs);
   ```
   Just nits.




----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] amaliujia commented on pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

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


   @cxorm can you take another look please? Thanks!


----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] captainzmc commented on a change in pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

Posted by GitBox <gi...@apache.org>.
captainzmc commented on a change in pull request #1445:
URL: https://github.com/apache/hadoop-ozone/pull/1445#discussion_r494297018



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/bucket/OMBucketDeleteResponse.java
##########
@@ -64,6 +76,12 @@ public void addToDBBatch(OMMetadataManager omMetadataManager,
         omMetadataManager.getBucketKey(volumeName, bucketName);
     omMetadataManager.getBucketTable().deleteWithBatch(batchOperation,
         dbBucketKey);
+    // update volume usedNamespace
+    if (omVolumeArgs != null) {
+      omMetadataManager.getVolumeTable().putWithBatch(batchOperation,
+              omMetadataManager.getVolumeKey(omVolumeArgs.getVolume()),
+              omVolumeArgs);

Review comment:
       indent




----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] amaliujia edited a comment on pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

Posted by GitBox <gi...@apache.org>.
amaliujia edited a comment on pull request #1445:
URL: https://github.com/apache/hadoop-ozone/pull/1445#issuecomment-708945714


   @ChenSammi  thanks for your pointer. I find the way to create linked bucket from there: just construct a bucket args by setting source volume name and bucket name (see here: https://github.com/apache/hadoop-ozone/pull/1104/files#diff-bcaba1a52a6776044c68527cd7a442d394ad80c69db269c9873343d09a4b2290R60)
   
   Have added to the UT about linked bucket. 


----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] ChenSammi commented on pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

Posted by GitBox <gi...@apache.org>.
ChenSammi commented on pull request #1445:
URL: https://github.com/apache/hadoop-ozone/pull/1445#issuecomment-707100115


   @amaliujia , could you add a new UT for bucket link case?  Linked bucket should not be counted in the namespace quota. 


----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] amaliujia commented on pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

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


   Thanks @cxorm and @captainzmc 
   
   comments are addressed. 
   
   Also created https://issues.apache.org/jira/browse/HDDS-4273 to track the work that make `usedNamespace` work with `ozone sh vol info`


----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] cxorm commented on pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

Posted by GitBox <gi...@apache.org>.
cxorm commented on pull request #1445:
URL: https://github.com/apache/hadoop-ozone/pull/1445#issuecomment-709002336


   Thank you @amaliujia for the fixes addressed comments.
   The work is great to me, but I think we would commit it after HDDS-4308.


----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] amaliujia commented on pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

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


   @ChenSammi 
   
   Thanks for the point that linked bucket case. Is there an example to show now linked bucket is tested (e.g. as a unit test)? I am trying to find a way to create a linked bucket and verify whether quota is impacted.


----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] captainzmc commented on a change in pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

Posted by GitBox <gi...@apache.org>.
captainzmc commented on a change in pull request #1445:
URL: https://github.com/apache/hadoop-ozone/pull/1445#discussion_r494297018



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/bucket/OMBucketDeleteResponse.java
##########
@@ -64,6 +76,12 @@ public void addToDBBatch(OMMetadataManager omMetadataManager,
         omMetadataManager.getBucketKey(volumeName, bucketName);
     omMetadataManager.getBucketTable().deleteWithBatch(batchOperation,
         dbBucketKey);
+    // update volume usedNamespace
+    if (omVolumeArgs != null) {
+      omMetadataManager.getVolumeTable().putWithBatch(batchOperation,
+              omMetadataManager.getVolumeKey(omVolumeArgs.getVolume()),
+              omVolumeArgs);

Review comment:
       indent




----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] ChenSammi commented on pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

Posted by GitBox <gi...@apache.org>.
ChenSammi commented on pull request #1445:
URL: https://github.com/apache/hadoop-ozone/pull/1445#issuecomment-708879034


   It seems there is no example UT so far. You can refer to links.robot for CLI examples, and HDDS-3612. 


----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] amaliujia commented on pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

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






----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] amaliujia edited a comment on pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

Posted by GitBox <gi...@apache.org>.
amaliujia edited a comment on pull request #1445:
URL: https://github.com/apache/hadoop-ozone/pull/1445#issuecomment-708945714


   @ChenSammi  thanks for your pointer. I find the way to create linked bucket from there: just construct a bucket args by setting source volume name and bucket name.
   
   Have added to the UT about linked bucket. 


----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] amaliujia commented on a change in pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

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



##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java
##########
@@ -270,6 +270,7 @@ private OzoneConsts() {
   public static final String SRC_KEY = "srcKey";
   public static final String DST_KEY = "dstKey";
   public static final String USED_BYTES = "usedBytes";
+  public static final String USED_NAMESPACE = "usedNamespace";

Review comment:
       Indeed it is not used. Removed this constant and we can add it in the future when there is a need.

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java
##########
@@ -209,7 +211,7 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
       omResponse.setCreateBucketResponse(
           CreateBucketResponse.newBuilder().build());
       omClientResponse = new OMBucketCreateResponse(omResponse.build(),
-          omBucketInfo);
+              omBucketInfo, omVolumeArgs);

Review comment:
       +1




----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] amaliujia commented on a change in pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

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



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java
##########
@@ -201,6 +201,8 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
       // Add default acls from volume.
       addDefaultAcls(omBucketInfo, omVolumeArgs);
 
+      // quotaAdd used namespace

Review comment:
       used `update used namespace for volume` for both now.

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/bucket/OMBucketCreateResponse.java
##########
@@ -66,6 +77,12 @@ public void addToDBBatch(OMMetadataManager omMetadataManager,
             omBucketInfo.getBucketName());
     omMetadataManager.getBucketTable().putWithBatch(batchOperation,
         dbBucketKey, omBucketInfo);
+    // update volume usedNamespace
+    if (omVolumeArgs != null) {
+      omMetadataManager.getVolumeTable().putWithBatch(batchOperation,
+              omMetadataManager.getVolumeKey(omVolumeArgs.getVolume()),
+              omVolumeArgs);

Review comment:
       makes sense 👍 




----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] amaliujia commented on a change in pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

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



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java
##########
@@ -201,6 +201,8 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
       // Add default acls from volume.
       addDefaultAcls(omBucketInfo, omVolumeArgs);
 
+      // quotaAdd used namespace

Review comment:
       used `update used namespace for volume` for both now.

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/bucket/OMBucketCreateResponse.java
##########
@@ -66,6 +77,12 @@ public void addToDBBatch(OMMetadataManager omMetadataManager,
             omBucketInfo.getBucketName());
     omMetadataManager.getBucketTable().putWithBatch(batchOperation,
         dbBucketKey, omBucketInfo);
+    // update volume usedNamespace
+    if (omVolumeArgs != null) {
+      omMetadataManager.getVolumeTable().putWithBatch(batchOperation,
+              omMetadataManager.getVolumeKey(omVolumeArgs.getVolume()),
+              omVolumeArgs);

Review comment:
       makes sense 👍 

##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java
##########
@@ -270,6 +270,7 @@ private OzoneConsts() {
   public static final String SRC_KEY = "srcKey";
   public static final String DST_KEY = "dstKey";
   public static final String USED_BYTES = "usedBytes";
+  public static final String USED_NAMESPACE = "usedNamespace";

Review comment:
       Indeed it is not used. Removed this constant and we can add it in the future when there is a need.

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java
##########
@@ -209,7 +211,7 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
       omResponse.setCreateBucketResponse(
           CreateBucketResponse.newBuilder().build());
       omClientResponse = new OMBucketCreateResponse(omResponse.build(),
-          omBucketInfo);
+              omBucketInfo, omVolumeArgs);

Review comment:
       +1

##########
File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmVolumeArgs.java
##########
@@ -68,15 +69,16 @@
       "builder."})
   private OmVolumeArgs(String adminName, String ownerName, String volume,
       long quotaInBytes, long quotaInCounts, Map<String, String> metadata,
-      long usedBytes, OmOzoneAclMap aclMap, long creationTime,
-      long modificationTime, long objectID, long updateID) {
+      long usedBytes, long usedNamespace, OmOzoneAclMap aclMap,
+      long creationTime, long modificationTime, long objectID, long updateID) {

Review comment:
       I see. `@param usedNamespace` and updated both description of `@param usedNamespace ` and `@param usedBytes`




----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] amaliujia commented on pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

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


   R: @cxorm @ChenSammi @captainzmc 
   
   Can you take a look please?


----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] amaliujia commented on pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

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


   @ChenSammi  thanks for your pointer. I find the way to create linked bucket there: just construct a bucket args by setting source volume name and bucket name.
   
   Have added to the UT about linked bucket. 


----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] cxorm commented on a change in pull request #1445: HDDS-4272. Volume namespace: add usedNamespace and update it when create and delete bucket

Posted by GitBox <gi...@apache.org>.
cxorm commented on a change in pull request #1445:
URL: https://github.com/apache/hadoop-ozone/pull/1445#discussion_r494095636



##########
File path: hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/OmVolumeArgs.java
##########
@@ -68,15 +69,16 @@
       "builder."})
   private OmVolumeArgs(String adminName, String ownerName, String volume,
       long quotaInBytes, long quotaInCounts, Map<String, String> metadata,
-      long usedBytes, OmOzoneAclMap aclMap, long creationTime,
-      long modificationTime, long objectID, long updateID) {
+      long usedBytes, long usedNamespace, OmOzoneAclMap aclMap,
+      long creationTime, long modificationTime, long objectID, long updateID) {

Review comment:
       How about we update the comment of this constructor by add `@param usedNamespace - volume quota usage in counts`
   
   The description of the parameter is IMHO, feel free to correct it if you have an idea. 
    

##########
File path: hadoop-hdds/common/src/main/java/org/apache/hadoop/ozone/OzoneConsts.java
##########
@@ -270,6 +270,7 @@ private OzoneConsts() {
   public static final String SRC_KEY = "srcKey";
   public static final String DST_KEY = "dstKey";
   public static final String USED_BYTES = "usedBytes";
+  public static final String USED_NAMESPACE = "usedNamespace";

Review comment:
       Seems we don't use this variable, 
   Could you be so kind as to let me know its usage if I miss something.

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketDeleteRequest.java
##########
@@ -134,6 +135,12 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
       omResponse.setDeleteBucketResponse(
           DeleteBucketResponse.newBuilder().build());
 
+      // update used namespace for volumn

Review comment:
       ```suggestion
         // update used namespace for volume
   ```

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java
##########
@@ -209,7 +211,7 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
       omResponse.setCreateBucketResponse(
           CreateBucketResponse.newBuilder().build());
       omClientResponse = new OMBucketCreateResponse(omResponse.build(),
-          omBucketInfo);
+              omBucketInfo, omVolumeArgs);

Review comment:
       ```suggestion
         omClientResponse = new OMBucketCreateResponse(omResponse.build(),
             omBucketInfo, omVolumeArgs);
   ```
   It's my nit : could we use less indent here to keep consistent with this file

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/bucket/OMBucketCreateRequest.java
##########
@@ -201,6 +201,8 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
       // Add default acls from volume.
       addDefaultAcls(omBucketInfo, omVolumeArgs);
 
+      // quotaAdd used namespace

Review comment:
       How about we update it this to `add quota of used namespace` or the same as `update used namespace for volume` in `OMBucketDeleteRequest`  ?

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/response/bucket/OMBucketCreateResponse.java
##########
@@ -66,6 +77,12 @@ public void addToDBBatch(OMMetadataManager omMetadataManager,
             omBucketInfo.getBucketName());
     omMetadataManager.getBucketTable().putWithBatch(batchOperation,
         dbBucketKey, omBucketInfo);
+    // update volume usedNamespace
+    if (omVolumeArgs != null) {
+      omMetadataManager.getVolumeTable().putWithBatch(batchOperation,
+              omMetadataManager.getVolumeKey(omVolumeArgs.getVolume()),
+              omVolumeArgs);

Review comment:
       ```suggestion
             omMetadataManager.getVolumeKey(omVolumeArgs.getVolume()),
             omVolumeArgs);
   ```
   Just nits.




----------------------------------------------------------------
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: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org