amaliujia commented on a change in pull request #1781:
URL: https://github.com/apache/ozone/pull/1781#discussion_r555582037
##########
File path:
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
##########
@@ -588,8 +597,19 @@ public void setBucketQuota(String volumeName, String
bucketName,
.setBucketName(bucketName)
.setQuotaInBytes(quotaInBytes)
.setQuotaInNamespace(quotaInNamespace);
+ // If the bucket is old, we need to remind the user on the client side
+ // that it is not recommended to enable quota.
+ OmBucketInfo omBucketInfo = ozoneManagerClient.getBucketInfo(
+ volumeName, bucketName);
+ if (omBucketInfo.getQuotaInNamespace() == OLD_QUOTA_DEFAULT) {
+ LOG.warn("Bucket: {} is a old bucket, usedNamespace may be " +
+ "inaccurate and it is not recommended to enable quota.", bucketName);
+ }
+ if (omBucketInfo.getUsedBytes() == OLD_QUOTA_DEFAULT) {
+ LOG.warn("Bucket: {} is a old bucket, usedBytes may be " +
+ "inaccurate and it is not recommended to enable quota.", bucketName);
+ }
ozoneManagerClient.setBucketProperty(builder.build());
-
Review comment:
nit: better to undo this line of change.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]