jiajunwang commented on a change in pull request #514: The WAGED rebalancer returns the previously calculated assignment on calculation failure URL: https://github.com/apache/helix/pull/514#discussion_r336605499
########## File path: helix-core/src/main/java/org/apache/helix/monitoring/metrics/model/CountMetric.java ########## @@ -19,23 +19,46 @@ * under the License. */ +import org.apache.helix.monitoring.mbeans.dynamicMBeans.DynamicMetric; import org.apache.helix.monitoring.mbeans.dynamicMBeans.SimpleDynamicMetric; /** * Represents a count metric and defines methods to help with calculation. A count metric gives a * gauge value of a certain property. */ -public abstract class CountMetric<V> extends SimpleDynamicMetric<V> implements Metric { - protected V _count; +public abstract class CountMetric extends SimpleDynamicMetric<Long> implements Metric { /** - * Instantiates a new Simple dynamic metric. + * Instantiates a new count metric. + * * @param metricName the metric name - * @param metricObject the metric object + * @param initCount the initial count */ - public CountMetric(String metricName, V metricObject) { - super(metricName, metricObject); + public CountMetric(String metricName, long initCount) { + super(metricName, initCount); } - public abstract void setCount(Object count); + /** + * Increment the metric by the input count. + * + * @param count + */ + public abstract void increaseCount(long count); + + public String getMetricName() { Review comment: Will add. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org For additional commands, e-mail: reviews-h...@helix.apache.org