adoroszlai opened a new pull request, #8119:
URL: https://github.com/apache/ozone/pull/8119

   ## What changes were proposed in this pull request?
   
   Refactor calculation of `minFreeSpace` for datanode volume.
   
   Currently it is done by `MinFreeSpaceCalculator`, which exists only to avoid 
repeated lookup of the config setting needed for the calculation.  Of its 3 
different usages, `AvailableSpaceFilter` and `StorageLocationReport` both 
create a new instance for each calculation, which defeats the purpose of 
storing config values.  Sharing the same instance of `MinFreeSpaceCalculator` 
from `HddsDispatcher` would require extensive changes.
   
   This PR moves the definition of config properties, as well as validation and 
calculation, to `DatanodeConfiguration`, which I think is a better fit than 
`MinFreeSpaceCalculator`.  Config objects are for storing configs, they have 
methods for validation, and this specific type is already used by `HddsVolume` 
and related code.
   
   In follow-up patch we can go further, and pass `DatanodeConfiguration` to 
the volumes via the builder.
   
   https://issues.apache.org/jira/browse/HDDS-12622
   
   ## How was this patch tested?
   
   CI:
   https://github.com/adoroszlai/ozone/actions/runs/13965703068


-- 
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

Reply via email to