From 53e6b5cb9ba5bae89dc4b812f7dff99326eacd7c Mon Sep 17 00:00:00 2001 From: Goh Wei Xiang Date: Wed, 12 Jul 2017 03:24:07 -0700 Subject: [PATCH] Removal of TopNResultMerger because it is vestigial. (#4520) --- .../io/druid/query/topn/TopNBinaryFn.java | 7 +--- .../query/topn/TopNQueryQueryToolChest.java | 1 - .../io/druid/query/topn/TopNResultMerger.java | 40 ------------------- .../query/topn/TopNBinaryFnBenchmark.java | 1 - .../io/druid/query/topn/TopNBinaryFnTest.java | 6 --- 5 files changed, 2 insertions(+), 53 deletions(-) delete mode 100644 processing/src/main/java/io/druid/query/topn/TopNResultMerger.java diff --git a/processing/src/main/java/io/druid/query/topn/TopNBinaryFn.java b/processing/src/main/java/io/druid/query/topn/TopNBinaryFn.java index 8848aa5f748..95a56d8ecdb 100644 --- a/processing/src/main/java/io/druid/query/topn/TopNBinaryFn.java +++ b/processing/src/main/java/io/druid/query/topn/TopNBinaryFn.java @@ -38,7 +38,6 @@ import java.util.Map; */ public class TopNBinaryFn implements BinaryFn, Result, Result> { - private final TopNResultMerger merger; private final DimensionSpec dimSpec; private final Granularity gran; private final String dimension; @@ -49,7 +48,6 @@ public class TopNBinaryFn implements BinaryFn, Result, Result postAggregatorSpecs ) { - this.merger = merger; this.dimSpec = dimSpec; this.gran = granularity; this.topNMetricSpec = topNMetricSpec; @@ -78,10 +75,10 @@ public class TopNBinaryFn implements BinaryFn, Result apply(Result arg1, Result arg2) { if (arg1 == null) { - return merger.getResult(arg2, comparator); + return arg2; } if (arg2 == null) { - return merger.getResult(arg1, comparator); + return arg1; } Map retVals = new LinkedHashMap<>(); diff --git a/processing/src/main/java/io/druid/query/topn/TopNQueryQueryToolChest.java b/processing/src/main/java/io/druid/query/topn/TopNQueryQueryToolChest.java index 5b76ba2b4c1..f18e5806c16 100644 --- a/processing/src/main/java/io/druid/query/topn/TopNQueryQueryToolChest.java +++ b/processing/src/main/java/io/druid/query/topn/TopNQueryQueryToolChest.java @@ -139,7 +139,6 @@ public class TopNQueryQueryToolChest extends QueryToolChest getResult(Result result, Comparator comparator) - { - return result; - } - }; - - public Result getResult(Result result, Comparator comparator); -} diff --git a/processing/src/test/java/io/druid/query/topn/TopNBinaryFnBenchmark.java b/processing/src/test/java/io/druid/query/topn/TopNBinaryFnBenchmark.java index 498aac23705..edaa2cf6e8a 100644 --- a/processing/src/test/java/io/druid/query/topn/TopNBinaryFnBenchmark.java +++ b/processing/src/test/java/io/druid/query/topn/TopNBinaryFnBenchmark.java @@ -115,7 +115,6 @@ public class TopNBinaryFnBenchmark extends SimpleBenchmark new TopNResultValue(list2) ); fn = new TopNBinaryFn( - TopNResultMerger.identity, Granularities.ALL, new DefaultDimensionSpec("testdim", null), new NumericTopNMetricSpec("index"), diff --git a/processing/src/test/java/io/druid/query/topn/TopNBinaryFnTest.java b/processing/src/test/java/io/druid/query/topn/TopNBinaryFnTest.java index 241eba6fbb2..c45d2f62739 100644 --- a/processing/src/test/java/io/druid/query/topn/TopNBinaryFnTest.java +++ b/processing/src/test/java/io/druid/query/topn/TopNBinaryFnTest.java @@ -144,7 +144,6 @@ public class TopNBinaryFnTest ); Result actual = new TopNBinaryFn( - TopNResultMerger.identity, Granularities.ALL, new DefaultDimensionSpec("testdim", null), new NumericTopNMetricSpec("index"), @@ -226,7 +225,6 @@ public class TopNBinaryFnTest ); Result actual = new TopNBinaryFn( - TopNResultMerger.identity, Granularities.DAY, new DefaultDimensionSpec("testdim", null), new NumericTopNMetricSpec("index"), @@ -271,7 +269,6 @@ public class TopNBinaryFnTest Result expected = result1; Result actual = new TopNBinaryFn( - TopNResultMerger.identity, Granularities.ALL, new DefaultDimensionSpec("testdim", null), new NumericTopNMetricSpec("index"), @@ -367,7 +364,6 @@ public class TopNBinaryFnTest ); Result actual = new TopNBinaryFn( - TopNResultMerger.identity, Granularities.ALL, new DefaultDimensionSpec("testdim", null), new NumericTopNMetricSpec("addrowsindexconstant"), @@ -449,7 +445,6 @@ public class TopNBinaryFnTest ); Result actual = new TopNBinaryFn( - TopNResultMerger.identity, Granularities.ALL, new DefaultDimensionSpec("testdim", null), new NumericTopNMetricSpec("index"), @@ -507,7 +502,6 @@ public class TopNBinaryFnTest ); Result actual = new TopNBinaryFn( - TopNResultMerger.identity, Granularities.ALL, new DefaultDimensionSpec("INVALID_DIM_NAME", null), new DimensionTopNMetricSpec(null, StringComparators.LEXICOGRAPHIC),