ChenSammi commented on code in PR #8167:
URL: https://github.com/apache/ozone/pull/8167#discussion_r2015600965
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/common/volume/AvailableSpaceFilter.java:
##########
@@ -39,14 +39,11 @@ public class AvailableSpaceFilter implements
Predicate<HddsVolume> {
@Override
public boolean test(HddsVolume vol) {
- SpaceUsageSource usage = vol.getCurrentUsage();
- long volumeCapacity = usage.getCapacity();
- long free = usage.getAvailable();
+ StorageLocationReport report = vol.getReport();
+ long free = report.getRemaining();
long committed = vol.getCommittedBytes();
long available = free - committed;
- long volumeFreeSpaceToSpare = vol.getFreeSpaceToSpare(volumeCapacity);
- boolean hasEnoughSpace = VolumeUsage.hasVolumeEnoughSpace(free, committed,
- requiredSpace, volumeFreeSpaceToSpare);
+ boolean hasEnoughSpace = VolumeUsage.hasVolumeEnoughSpace(report,
requiredSpace);
mostAvailableSpace = Math.max(available, mostAvailableSpace);
Review Comment:
Shall mostAvailableSpace consider to deduct volumeFreeSpaceToSpare too?
--
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]