fix casing and add comment

This commit is contained in:
nishantmonu51 2014-04-08 17:26:51 +05:30
parent 22c3296aa3
commit ecfa6bd1b1
2 changed files with 3 additions and 2 deletions

View File

@ -94,6 +94,7 @@ public class TopNBinaryFn implements BinaryFn<Result<TopNResultValue>, Result<To
DimensionAndMetricValueExtractor arg1Val = retVals.get(dimensionValue); DimensionAndMetricValueExtractor arg1Val = retVals.get(dimensionValue);
if (arg1Val != null) { if (arg1Val != null) {
// size of map = aggregattor + topNDim + postAgg (If sorting is done on post agg field)
Map<String, Object> retVal = new LinkedHashMap<String, Object>(aggregations.size() + 2); Map<String, Object> retVal = new LinkedHashMap<String, Object>(aggregations.size() + 2);
retVal.put(dimension, dimensionValue); retVal.put(dimension, dimensionValue);
@ -102,7 +103,7 @@ public class TopNBinaryFn implements BinaryFn<Result<TopNResultValue>, Result<To
retVal.put(metricName, factory.combine(arg1Val.getMetric(metricName), arg2Val.getMetric(metricName))); retVal.put(metricName, factory.combine(arg1Val.getMetric(metricName), arg2Val.getMetric(metricName)));
} }
for (PostAggregator postAgg : postAggregations) { for (PostAggregator postAgg : postAggregations) {
if (postAgg.getName().equals(topNMetricName)) { if (postAgg.getName().equalsIgnoreCase(topNMetricName)) {
retVal.put(postAgg.getName(), postAgg.compute(retVal)); retVal.put(postAgg.getName(), postAgg.compute(retVal));
} }
} }

View File

@ -76,7 +76,7 @@ public class TopNNumericResultBuilder implements TopNResultBuilder
} }
for (PostAggregator postAgg : postAggs) { for (PostAggregator postAgg : postAggs) {
if (postAgg.getName().equals(metricName)) { if (postAgg.getName().equalsIgnoreCase(metricName)) {
metricValues.put(postAgg.getName(), postAgg.compute(metricValues)); metricValues.put(postAgg.getName(), postAgg.compute(metricValues));
break; break;
} }