ChenSammi commented on code in PR #4583:
URL: https://github.com/apache/ozone/pull/4583#discussion_r1194819222
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/impl/HddsDispatcher.java:
##########
@@ -566,6 +568,21 @@ private boolean isContainerFull(Container container) {
}
}
+ private boolean isVolumeFull(Container container) {
+ boolean isOpen = Optional.ofNullable(container)
+ .map(cont -> cont.getContainerState() == ContainerDataProto.State.OPEN)
+ .orElse(Boolean.FALSE);
+ if (isOpen) {
+ HddsVolume volume = container.getContainerData().getVolume();
+ long volumeCapacity = volume.getCapacity();
+ long volumeFreeSpaceToSpare =
+ VolumeUsage.getMinVolumeFreeSpace(conf, volumeCapacity);
+ long volumeAvailable = volume.getAvailable();
+ return (volumeAvailable <= volumeFreeSpaceToSpare);
Review Comment:
@sadanand48 , "- vol.getCommittedBytes()" is missing here.
--
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]