Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ public void aggregate()
}
}

@Override
public void reset()
{
mutableBitmap.clear();
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ public void aggregate()
{
}

@Override
public void reset()
{
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public TimestampAggregator(
this.comparator = comparator;
this.initValue = initValue;

reset();
most = this.initValue;
}

@Override
Expand All @@ -72,12 +72,6 @@ public void aggregate()
}
}

@Override
public void reset()
{
most = initValue;
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,13 @@ public void testAggregator()
{
TimestampAggregator aggregator = (TimestampAggregator) aggregatorFactory.factorize(selectorFactory);

for (Timestamp value: values) {
Assert.assertEquals(initValue, aggregator.get());

for (Timestamp value : values) {
aggregate(selector, aggregator);
}

Assert.assertEquals(expected, new Timestamp(aggregator.getLong()));

aggregator.reset();

Assert.assertEquals(initValue, aggregator.get());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ public long getLong()
throw new UnsupportedOperationException("Not implemented");
}

@Override
public synchronized void reset()
{
sketch = UpdateDoublesSketch.builder().setK(size).build();
}

@Override
public synchronized void close()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ public long getLong()
throw new UnsupportedOperationException("Not implemented");
}

@Override
public synchronized void reset()
{
union.reset();
}

@Override
public synchronized void close()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ public void aggregate()
{
}

@Override
public void reset()
{
}

@Override
public void close()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,6 @@ public void aggregate()
updateUnion(union, update);
}

@Override
public void reset()
{
if (union != null) {
union.reset();
}
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ public void aggregate()
histogram.offer(selector.getFloat());
}

@Override
public void reset()
{
this.histogram = new ApproximateHistogram(resolution, lowerLimit, upperLimit);
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ public void aggregate()
}
}

@Override
public void reset()
{
this.histogram = new ApproximateHistogram(resolution, lowerLimit, upperLimit);
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ public VarianceAggregator()
{
}

@Override
public void reset()
{
holder.reset();
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ public void testDoubleVarianceAggregator()
assertValues((VarianceAggregatorCollector) agg.get(), 3, 7.3d, 2.9866d);
aggregate(selector, agg);
assertValues((VarianceAggregatorCollector) agg.get(), 4, 8.6d, 3.95d);

agg.reset();
assertValues((VarianceAggregatorCollector) agg.get(), 0, 0d, 0d);
}

private void assertValues(VarianceAggregatorCollector holder, long count, double sum, double nvariance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@
public interface Aggregator extends Closeable
{
void aggregate();
/** @deprecated unused, to be removed in Druid 0.12 (or hopefully the whole Aggregator class is removed) */
@Deprecated
@SuppressWarnings("unused")
void reset();

@Nullable
Object get();
float getFloat();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ public void aggregate()
++count;
}

@Override
public void reset()
{
count = 0;
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ static double combineValues(Object lhs, Object rhs)
public DoubleMaxAggregator(BaseDoubleColumnValueSelector selector)
{
this.selector = selector;

reset();
this.max = Double.NEGATIVE_INFINITY;
}

@Override
Expand All @@ -47,12 +46,6 @@ public void aggregate()
max = Math.max(max, selector.getDouble());
}

@Override
public void reset()
{
max = Double.NEGATIVE_INFINITY;
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ static double combineValues(Object lhs, Object rhs)
public DoubleMinAggregator(BaseDoubleColumnValueSelector selector)
{
this.selector = selector;

reset();
this.min = Double.POSITIVE_INFINITY;
}

@Override
Expand All @@ -47,12 +46,6 @@ public void aggregate()
min = Math.min(min, selector.getDouble());
}

@Override
public void reset()
{
min = Double.POSITIVE_INFINITY;
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ public void aggregate()
sum += selector.getDouble();
}

@Override
public void reset()
{
sum = 0;
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ public void aggregate()
}
}

@Override
public void reset()
{
delegate.reset();
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ static double combineValues(Object lhs, Object rhs)
public FloatMaxAggregator(BaseFloatColumnValueSelector selector)
{
this.selector = selector;

reset();
this.max = Float.NEGATIVE_INFINITY;
}

@Override
Expand All @@ -47,12 +46,6 @@ public void aggregate()
max = Math.max(max, selector.getFloat());
}

@Override
public void reset()
{
max = Float.NEGATIVE_INFINITY;
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ static double combineValues(Object lhs, Object rhs)
public FloatMinAggregator(BaseFloatColumnValueSelector selector)
{
this.selector = selector;

reset();
this.min = Float.POSITIVE_INFINITY;
}

@Override
Expand All @@ -47,12 +46,6 @@ public void aggregate()
min = Math.min(min, selector.getFloat());
}

@Override
public void reset()
{
min = Float.POSITIVE_INFINITY;
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,6 @@ public void aggregate()
sum += selector.getFloat();
}

@Override
public void reset()
{
sum = 0;
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ public void aggregate()
histogram.offer(selector.getFloat());
}

@Override
public void reset()
{
this.histogram = new Histogram(histogram.breaks);
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ public void aggregate()
current = script.aggregate(current, selectorList);
}

@Override
public void reset()
{
current = script.reset();
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ static long combineValues(Object lhs, Object rhs)
public LongMaxAggregator(BaseLongColumnValueSelector selector)
{
this.selector = selector;

reset();
this.max = Long.MIN_VALUE;
}

@Override
Expand All @@ -51,12 +50,6 @@ public void aggregate()
max = Math.max(max, selector.getLong());
}

@Override
public void reset()
{
max = Long.MIN_VALUE;
}

@Override
public Object get()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ static long combineValues(Object lhs, Object rhs)
public LongMinAggregator(BaseLongColumnValueSelector selector)
{
this.selector = selector;

reset();
this.min = Long.MAX_VALUE;
}

@Override
Expand All @@ -51,12 +50,6 @@ public void aggregate()
min = Math.min(min, selector.getLong());
}

@Override
public void reset()
{
min = Long.MAX_VALUE;
}

@Override
public Object get()
{
Expand Down
Loading