ChenSammi commented on a change in pull request #1781:
URL: https://github.com/apache/ozone/pull/1781#discussion_r556301738



##########
File path: 
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
##########
@@ -588,6 +598,20 @@ 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 created before version 1.1.0, usedNamespace " +
+          "may be inaccurate and it is not recommended to enable quota.",
+          bucketName);
+    }
+    if (omBucketInfo.getUsedBytes() == OLD_QUOTA_DEFAULT) {
+      LOG.warn("Bucket {} is created before version 1.1.0, usedBytes " +
+          "may be inaccurate and it is not recommended to enable quota.",
+          bucketName);
+    }

Review comment:
       @captainzmc , we can see this output on console because LOG is enabled. 
When LOG is disabled on client side, we cannot see any message.  My suggestion 
is we return this message as the command response, and then output to console. 




----------------------------------------------------------------
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]

Reply via email to