slfan1989 commented on code in PR #10333:
URL: https://github.com/apache/ozone/pull/10333#discussion_r3294132857
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java:
##########
@@ -492,6 +491,30 @@ private boolean shouldDelay() {
return false;
}
+ private void reserveDeltaSize(HddsVolume sourceVolume, long bytes) {
+ // deltaSizes can be updated by multiple DiskBalancer tasks for the same
+ // source volume. Use compute to avoid lost updates from a non-atomic
+ // get/put sequence.
+ deltaSizes.compute(sourceVolume, (volume, current) -> {
Review Comment:
Thanks @smengcl for the suggestion. Added Javadocs for reserveDeltaSize and
releaseDeltaSize to document the atomic update semantics and zero-delta cleanup
behavior.
--
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]