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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org