diff --git a/extensions-contrib/time-min-max/src/main/java/org/apache/druid/query/aggregation/TimestampAggregator.java b/extensions-contrib/time-min-max/src/main/java/org/apache/druid/query/aggregation/TimestampAggregator.java index d24741ca40d..c11b50dcece 100644 --- a/extensions-contrib/time-min-max/src/main/java/org/apache/druid/query/aggregation/TimestampAggregator.java +++ b/extensions-contrib/time-min-max/src/main/java/org/apache/druid/query/aggregation/TimestampAggregator.java @@ -101,10 +101,4 @@ public class TimestampAggregator implements Aggregator { // no resource to cleanup } - - @Override - public Aggregator clone() - { - return new TimestampAggregator(name, selector, timestampSpec, comparator, initValue); - } } diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/CountAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/CountAggregator.java index da8cddad4d4..3b24ac524e9 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/CountAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/CountAggregator.java @@ -68,12 +68,6 @@ public class CountAggregator implements Aggregator return (double) count; } - @Override - public Aggregator clone() - { - return new CountAggregator(); - } - @Override public void close() { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/DoubleMaxAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/DoubleMaxAggregator.java index 5d9b88a46a4..139c99d3be6 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/DoubleMaxAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/DoubleMaxAggregator.java @@ -70,12 +70,6 @@ public class DoubleMaxAggregator implements Aggregator return max; } - @Override - public Aggregator clone() - { - return new DoubleMaxAggregator(selector); - } - @Override public void close() { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/DoubleMinAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/DoubleMinAggregator.java index 7956d99c2ac..755eb1fc548 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/DoubleMinAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/DoubleMinAggregator.java @@ -70,12 +70,6 @@ public class DoubleMinAggregator implements Aggregator return min; } - @Override - public Aggregator clone() - { - return new DoubleMinAggregator(selector); - } - @Override public void close() { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/DoubleSumAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/DoubleSumAggregator.java index 67c72b1bb6a..3d74b4e10f4 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/DoubleSumAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/DoubleSumAggregator.java @@ -78,12 +78,6 @@ public class DoubleSumAggregator implements Aggregator return (long) sum; } - @Override - public Aggregator clone() - { - return new DoubleSumAggregator(selector); - } - @Override public void close() { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/FloatMaxAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/FloatMaxAggregator.java index feba3b452e9..9443f7c5e1a 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/FloatMaxAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/FloatMaxAggregator.java @@ -70,12 +70,6 @@ public class FloatMaxAggregator implements Aggregator return (double) max; } - @Override - public Aggregator clone() - { - return new FloatMaxAggregator(selector); - } - @Override public void close() { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/FloatMinAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/FloatMinAggregator.java index 044d3a79143..c9dd20f4d8f 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/FloatMinAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/FloatMinAggregator.java @@ -70,12 +70,6 @@ public class FloatMinAggregator implements Aggregator return (double) min; } - @Override - public Aggregator clone() - { - return new FloatMinAggregator(selector); - } - @Override public void close() { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/FloatSumAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/FloatSumAggregator.java index 3bf4b8123a3..90a2fd4fa76 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/FloatSumAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/FloatSumAggregator.java @@ -83,12 +83,6 @@ public class FloatSumAggregator implements Aggregator return (double) sum; } - @Override - public Aggregator clone() - { - return new FloatSumAggregator(selector); - } - @Override public void close() { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/LongMaxAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/LongMaxAggregator.java index 82c08d1f42b..2c0e74fc5d0 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/LongMaxAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/LongMaxAggregator.java @@ -70,12 +70,6 @@ public class LongMaxAggregator implements Aggregator return (double) max; } - @Override - public Aggregator clone() - { - return new LongMaxAggregator(selector); - } - @Override public void close() { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/LongMinAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/LongMinAggregator.java index 91525efaa33..75d1ea64ae2 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/LongMinAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/LongMinAggregator.java @@ -70,12 +70,6 @@ public class LongMinAggregator implements Aggregator return (double) min; } - @Override - public Aggregator clone() - { - return new LongMinAggregator(selector); - } - @Override public void close() { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/LongSumAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/LongSumAggregator.java index d794708a39a..42ba9dd0aea 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/LongSumAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/LongSumAggregator.java @@ -83,12 +83,6 @@ public class LongSumAggregator implements Aggregator return (double) sum; } - @Override - public Aggregator clone() - { - return new LongSumAggregator(selector); - } - @Override public void close() { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregator.java index c3a31471226..04fff6e29cd 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregator.java @@ -32,10 +32,6 @@ import java.util.List; public class CardinalityAggregator implements Aggregator { - private final String name; - private final ColumnSelectorPlus[] selectorPluses; - private final boolean byRow; - public static final HashFunction hashFn = Hashing.murmur3_128(); static void hashRow( @@ -65,26 +61,22 @@ public class CardinalityAggregator implements Aggregator } } + private final ColumnSelectorPlus[] selectorPluses; + private final boolean byRow; private HyperLogLogCollector collector; @VisibleForTesting @SuppressWarnings("unchecked") CardinalityAggregator( - String name, List> selectorPlusList, boolean byRow ) { - this(name, selectorPlusList.toArray(new ColumnSelectorPlus[0]), byRow); + this(selectorPlusList.toArray(new ColumnSelectorPlus[0]), byRow); } - CardinalityAggregator( - String name, - ColumnSelectorPlus[] selectorPluses, - boolean byRow - ) + CardinalityAggregator(ColumnSelectorPlus[] selectorPluses, boolean byRow) { - this.name = name; this.selectorPluses = selectorPluses; this.collector = HyperLogLogCollector.makeLatestCollector(); this.byRow = byRow; @@ -126,12 +118,6 @@ public class CardinalityAggregator implements Aggregator throw new UnsupportedOperationException("CardinalityAggregator does not support getDouble()"); } - @Override - public Aggregator clone() - { - return new CardinalityAggregator(name, selectorPluses, byRow); - } - @Override public void close() { diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorFactory.java b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorFactory.java index a96b7cde0db..fc9afe6d54e 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorFactory.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorFactory.java @@ -142,7 +142,7 @@ public class CardinalityAggregatorFactory extends AggregatorFactory if (selectorPluses.length == 0) { return NoopAggregator.instance(); } - return new CardinalityAggregator(name, selectorPluses, byRow); + return new CardinalityAggregator(selectorPluses, byRow); } diff --git a/processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesAggregator.java b/processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesAggregator.java index 6524e058488..d4fba9dff87 100644 --- a/processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesAggregator.java +++ b/processing/src/main/java/org/apache/druid/query/aggregation/hyperloglog/HyperUniquesAggregator.java @@ -81,12 +81,6 @@ public class HyperUniquesAggregator implements Aggregator throw new UnsupportedOperationException("HyperUniquesAggregator does not support getDouble()"); } - @Override - public Aggregator clone() - { - return new HyperUniquesAggregator(selector); - } - @Override public void close() { diff --git a/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorTest.java b/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorTest.java index 01703dfb49d..1a563c72ac0 100644 --- a/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorTest.java +++ b/processing/src/test/java/org/apache/druid/query/aggregation/cardinality/CardinalityAggregatorTest.java @@ -400,7 +400,6 @@ public class CardinalityAggregatorTest public void testAggregateRows() { CardinalityAggregator agg = new CardinalityAggregator( - "billy", dimInfoList, true ); @@ -417,7 +416,6 @@ public class CardinalityAggregatorTest public void testAggregateValues() { CardinalityAggregator agg = new CardinalityAggregator( - "billy", dimInfoList, false ); @@ -493,8 +491,8 @@ public class CardinalityAggregatorTest ) ); - CardinalityAggregator agg1 = new CardinalityAggregator("billy", dimInfo1, true); - CardinalityAggregator agg2 = new CardinalityAggregator("billy", dimInfo2, true); + CardinalityAggregator agg1 = new CardinalityAggregator(dimInfo1, true); + CardinalityAggregator agg2 = new CardinalityAggregator(dimInfo2, true); for (int i = 0; i < values1.size(); ++i) { aggregate(selector1, agg1); @@ -539,8 +537,8 @@ public class CardinalityAggregatorTest ) ); - CardinalityAggregator agg1 = new CardinalityAggregator("billy", dimInfo1, false); - CardinalityAggregator agg2 = new CardinalityAggregator("billy", dimInfo2, false); + CardinalityAggregator agg1 = new CardinalityAggregator(dimInfo1, false); + CardinalityAggregator agg2 = new CardinalityAggregator(dimInfo2, false); for (int i = 0; i < values1.size(); ++i) { aggregate(selector1, agg1); @@ -568,7 +566,6 @@ public class CardinalityAggregatorTest public void testAggregateRowsWithExtraction() { CardinalityAggregator agg = new CardinalityAggregator( - "billy", dimInfoListWithExtraction, true ); @@ -578,7 +575,6 @@ public class CardinalityAggregatorTest Assert.assertEquals(9.0, (Double) rowAggregatorFactory.finalizeComputation(agg.get()), 0.05); CardinalityAggregator agg2 = new CardinalityAggregator( - "billy", dimInfoListConstantVal, true ); @@ -592,7 +588,6 @@ public class CardinalityAggregatorTest public void testAggregateValuesWithExtraction() { CardinalityAggregator agg = new CardinalityAggregator( - "billy", dimInfoListWithExtraction, false ); @@ -602,7 +597,6 @@ public class CardinalityAggregatorTest Assert.assertEquals(7.0, (Double) valueAggregatorFactory.finalizeComputation(agg.get()), 0.05); CardinalityAggregator agg2 = new CardinalityAggregator( - "billy", dimInfoListConstantVal, false );