rdingankar commented on code in PR #5486: URL: https://github.com/apache/hadoop/pull/5486#discussion_r1140658864
########## hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/metrics2/util/InverseQuantiles.java: ########## @@ -0,0 +1,44 @@ +package org.apache.hadoop.metrics2.util; + +import org.apache.hadoop.util.Preconditions; +import java.util.ListIterator; + +public class InverseQuantiles extends SampleQuantiles{ + + public InverseQuantiles(Quantile[] quantiles) { + super(quantiles); + } + + + /** + * Get the estimated value at the inverse of the specified quantile. + * Eg: return the value at (1 - 0.99)*count position for quantile 0.99. + * When count is 100, quantile 0.99 is desired to return the value at the 1st position + * + * @param quantile Queried quantile, e.g. 0.50 or 0.99. + * @return Estimated value at the inverse position of that quantile. + */ + long query(double quantile) { Review Comment: Updated to reverse the traversal order. Overriding `query()` method instead of creating a new method and moved out the common validation step outside. -- 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: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org