szetszwo commented on code in PR #9505:
URL: https://github.com/apache/ozone/pull/9505#discussion_r2628482131
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/policy/DiskBalancerVolumeChoosingPolicy.java:
##########
@@ -30,11 +30,11 @@ public interface DiskBalancerVolumeChoosingPolicy {
* Choose a pair of volumes for balancing.
*
* @param volumeSet - volumes to choose from.
- * @param threshold - the threshold to choose source and dest volumes.
+ * @param thresholdPercentage the threshold percentage in range [0, 100] to
choose the source volume.
Review Comment:
For double, the end values are unimportant except for spacial reasons such
as division-by-zeros. For example, why 0.001 and 99.999 are allowed but not 0
and 100?
BTW, 0 and 100 should be allowed in this case
- 0: balance any volumes > average.
- 100: disable it in this method.
If we want to disallow them, we should validate the conf and throw
exceptions instead of relying on the javadoc.
In the javadoc here, I just want to emphasize that the threshold here is a
percentage [0,100] but not a ratio [0,1]. The previous code use the word
"threshold" interchangeably for both percentage and ratio. (Currently, some
other code may still do that.)
Actually, it is better to change the conf to understand percentage -- i.e.
users can use both "0.1" and "10%" for the same value. After parsing the conf,
the code always treat threshold as a ratio [0,1].
--
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]