siddhantsangwan commented on code in PR #8590: URL: https://github.com/apache/ozone/pull/8590#discussion_r2144684018
########## hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/HddsVolume.java: ########## @@ -194,6 +195,12 @@ public VolumeInfoMetrics getVolumeInfoStats() { return volumeInfoMetrics; } + public boolean isVolumeFull() { + SpaceUsageSource currentUsage = getCurrentUsage(); + // if the volume is failed, this method will implicitly return true because available space will be 0 + return currentUsage.getAvailable() - getFreeSpaceToSpare(currentUsage.getCapacity()) <= 0; + } Review Comment: > Thanks @siddhantsangwan for sharing the rationale, makes sense. I agree about the need to avoid unnecessary object creation (StorageLocationReport). I think trying to avoid a simple method call (to VolumeUsage) is unnecessary, but is OK for now. I can continue refactoring later and ask you to review. :) Sounds good! > Since there is a merge conflict anyway, I'd like to ask you to make another small change by swapping the order of || here: Ah, that's a good suggestion, will push it along with the conflict resolution. -- 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-unsubscr...@ozone.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org For additional commands, e-mail: issues-h...@ozone.apache.org