priyeshkaratha commented on code in PR #9742:
URL: https://github.com/apache/ozone/pull/9742#discussion_r2853059041


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/api/types/GlobalStorageReport.java:
##########
@@ -29,33 +29,125 @@
  */
 public class GlobalStorageReport {
 
-  @JsonProperty("totalUsedSpace")
-  private long totalUsedSpace;
+  @JsonProperty("totalFileSystemCapacity")
+  private long totalFileSystemCapacity;

Review Comment:
   From the `StorageVolume` implementation, the values originate from 
`reportBuilder()`:
   
   ```java
   SpaceUsageSource.Fixed fsUsage = volumeUsage.realUsage();
   SpaceUsageSource usage = volumeUsage.getCurrentUsage(fsUsage);
   
   builder.setCapacity(usage.getCapacity())
          .setRemaining(usage.getAvailable())
          .setScmUsed(usage.getUsedSpace())
          .setReserved(volumeUsage.getReservedInBytes())
          .setFsCapacity(fsUsage.getCapacity())
          .setFsAvailable(fsUsage.getAvailable());
   ```
   
   And in `getCurrentUsage()`:
   
   ```java
   return reservedInBytes == 0
       ? real
       : new SpaceUsageSource.Fixed(
           Math.max(real.getCapacity() - reservedInBytes, 0),
           Math.max(real.getAvailable() - getRemainingReserved(real), 0),
           real.getUsedSpace());
   ```
   
   Based on above code ozoneCapacity is calculated as:
   
   fsCapacity - reserved
   
   So effectively:
   
   fsCapacity = ozoneCapacity + reserved
   
   Since both reserved and ozoneCapacity are derived directly from the same 
fsCapacity value, adding them back should always give the original filesystem 
capacity. So this is not an approximation. I will be always give same result.



-- 
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: [email protected]

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