ChenSammi commented on code in PR #8086:
URL: https://github.com/apache/ozone/pull/8086#discussion_r2000175990
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/VolumeUsage.java:
##########
@@ -185,7 +185,7 @@ public static boolean hasVolumeEnoughSpace(long
volumeAvailableSpace,
long requiredSpace,
long volumeFreeSpaceToSpare) {
return (volumeAvailableSpace - volumeCommittedBytesCount) >
- Math.max(requiredSpace, volumeFreeSpaceToSpare);
Review Comment:
@peterxcli , thanks for working on this. I would prefer following statement
which is more straight forward.
return (volumeAvailableSpace - volumeCommittedBytesCount -
volumeFreeSpaceToSpare) > requiredSpace;
Besides, could you help to refactor the HddsDispatcher#isVolumeFull in this
patch too, make isVolumeFull call hasVolumeEnoughSpace, so that we will have
single central place to control how the disk full is detected.
--
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]