You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "sadanand48 (via GitHub)" <gi...@apache.org> on 2023/02/01 17:28:46 UTC

[GitHub] [ozone] sadanand48 commented on a diff in pull request #4226: HDDS-7858. implement getStatus

sadanand48 commented on code in PR #4226:
URL: https://github.com/apache/ozone/pull/4226#discussion_r1093529231


##########
hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneFileSystem.java:
##########
@@ -1010,6 +1013,24 @@ listingPageSize, uri, workingDir, getUsername())
     return statusList;
   }
 
+  @Override
+  public FsStatus getStatus(Path p) throws IOException {
+    BasicOzoneClientAdapterImpl adapterImpl =
+        (BasicOzoneClientAdapterImpl) adapter;
+    OzoneBucket bucket = adapterImpl.getBucket();
+    long usedBytes = bucket.getUsedBytes();
+    long quota = Long.MAX_VALUE;
+    if (bucket.getQuotaInBytes() > -1) {
+      quota = bucket.getQuotaInBytes();
+    } else {
+      OzoneVolume volume = adapterImpl.getVolume();
+      if (volume.getQuotaInBytes() > -1) {
+        quota = volume.getQuotaInBytes();

Review Comment:
   Suppose a volume vol1 has 2 buckets buck1 and buck2, if vol1 quota is 1GB and buck1 quota is 1GB,  if I am not wrong user won't be able to write to buck2 as buck1 has reserved all of vol1's space. In that case Total size for buck2= 0 and not 1GB I guess.
   cc @sumitagrawl 



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

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

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