adoroszlai commented on code in PR #8573:
URL: https://github.com/apache/ozone/pull/8573#discussion_r2140438113
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java:
##########
@@ -346,6 +349,33 @@ public VolumeCheckResult checkDbHealth(File dbFile) throws
InterruptedException
return VolumeCheckResult.HEALTHY;
}
+ @VisibleForTesting
+ public void checkVolumeUsages() {
+ boolean isEnoughSpaceAvailable = true;
+ SpaceUsageSource currentUsage = getCurrentUsage();
+ long getFreeSpaceToSpare = getFreeSpaceToSpare(currentUsage.getCapacity());
+ if (currentUsage.getAvailable() < getFreeSpaceToSpare) {
+ LOG.warn("Volume {} has insufficient space for write operation.
Available: {}, Free space to spare: {}",
+ getStorageDir(), currentUsage.getAvailable(), getFreeSpaceToSpare);
+ isEnoughSpaceAvailable = false;
Review Comment:
@sumitagrawl Please consider using `StorageLocationReport` to capture all
volume information in one step, and use it for both calculation and logging for
consistency.
--
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]