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 @@ -67,7 +67,7 @@ public Aggregator factorize(ColumnSelectorFactory columnFactory)
{
DimensionSelector selector = makeDimensionSelector(columnFactory);
if (selector == null) {
return new EmptyDistinctCountAggregator();
return new NoopDistinctCountAggregator();
} else {
return new DistinctCountAggregator(
selector,
Expand All @@ -81,7 +81,7 @@ public BufferAggregator factorizeBuffered(ColumnSelectorFactory columnFactory)
{
DimensionSelector selector = makeDimensionSelector(columnFactory);
if (selector == null) {
return EmptyDistinctCountBufferAggregator.instance();
return NoopDistinctCountBufferAggregator.instance();
} else {
return new DistinctCountBufferAggregator(makeDimensionSelector(columnFactory));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@

import org.apache.druid.query.aggregation.Aggregator;

public class EmptyDistinctCountAggregator implements Aggregator
public class NoopDistinctCountAggregator implements Aggregator
{

public EmptyDistinctCountAggregator()
public NoopDistinctCountAggregator()
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@

/**
* The difference from {@link org.apache.druid.query.aggregation.NoopBufferAggregator} is that
* EmptyDistinctCountBufferAggregator returns 0 instead of null from {@link #get(ByteBuffer, int)}.
* NoopDistinctCountBufferAggregator returns 0 instead of null from {@link #get(ByteBuffer, int)}.
*/
public final class EmptyDistinctCountBufferAggregator implements BufferAggregator
public final class NoopDistinctCountBufferAggregator implements BufferAggregator
{
private static final EmptyDistinctCountBufferAggregator INSTANCE = new EmptyDistinctCountBufferAggregator();
private static final NoopDistinctCountBufferAggregator INSTANCE = new NoopDistinctCountBufferAggregator();

static EmptyDistinctCountBufferAggregator instance()
static NoopDistinctCountBufferAggregator instance()
{
return INSTANCE;
}

private EmptyDistinctCountBufferAggregator()
private NoopDistinctCountBufferAggregator()
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ public Aggregator factorize(final ColumnSelectorFactory metricFactory)
&& ValueType.isNumeric(metricFactory.getColumnCapabilities(fieldName).getType())) {
final ColumnValueSelector<Double> selector = metricFactory.makeColumnValueSelector(fieldName);
if (selector instanceof NilColumnValueSelector) {
return new DoublesSketchNoOpAggregator();
return new NoopDoublesSketchAggregator();
}
return new DoublesSketchBuildAggregator(selector, k);
}
final ColumnValueSelector<DoublesSketch> selector = metricFactory.makeColumnValueSelector(fieldName);
if (selector instanceof NilColumnValueSelector) {
return new DoublesSketchNoOpAggregator();
return new NoopDoublesSketchAggregator();
}
return new DoublesSketchMergeAggregator(selector, k);
}
Expand All @@ -108,13 +108,13 @@ public BufferAggregator factorizeBuffered(final ColumnSelectorFactory metricFact
&& ValueType.isNumeric(metricFactory.getColumnCapabilities(fieldName).getType())) {
final ColumnValueSelector<Double> selector = metricFactory.makeColumnValueSelector(fieldName);
if (selector instanceof NilColumnValueSelector) {
return new DoublesSketchNoOpBufferAggregator();
return new NoopDoublesSketchBufferAggregator();
}
return new DoublesSketchBuildBufferAggregator(selector, k, getMaxIntermediateSizeWithNulls());
}
final ColumnValueSelector<DoublesSketch> selector = metricFactory.makeColumnValueSelector(fieldName);
if (selector instanceof NilColumnValueSelector) {
return new DoublesSketchNoOpBufferAggregator();
return new NoopDoublesSketchBufferAggregator();
}
return new DoublesSketchMergeBufferAggregator(selector, k, getMaxIntermediateSizeWithNulls());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public Aggregator factorize(final ColumnSelectorFactory metricFactory)
{
final ColumnValueSelector<DoublesSketch> selector = metricFactory.makeColumnValueSelector(getFieldName());
if (selector instanceof NilColumnValueSelector) {
return new DoublesSketchNoOpAggregator();
return new NoopDoublesSketchAggregator();
}
return new DoublesSketchMergeAggregator(selector, getK());
}
Expand All @@ -55,7 +55,7 @@ public BufferAggregator factorizeBuffered(final ColumnSelectorFactory metricFact
{
final ColumnValueSelector<DoublesSketch> selector = metricFactory.makeColumnValueSelector(getFieldName());
if (selector instanceof NilColumnValueSelector) {
return new DoublesSketchNoOpBufferAggregator();
return new NoopDoublesSketchBufferAggregator();
}
return new DoublesSketchMergeBufferAggregator(selector, getK(), getMaxIntermediateSizeWithNulls());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@

import org.apache.druid.query.aggregation.Aggregator;

public class DoublesSketchNoOpAggregator implements Aggregator
public class NoopDoublesSketchAggregator implements Aggregator
{

@Override
public Object get()
{
Expand Down Expand Up @@ -51,5 +50,4 @@ public long getLong()
{
throw new UnsupportedOperationException("Not implemented");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@

import java.nio.ByteBuffer;

public class DoublesSketchNoOpBufferAggregator implements BufferAggregator
public class NoopDoublesSketchBufferAggregator implements BufferAggregator
{

@Override
public void init(final ByteBuffer buf, final int position)
{
Expand Down Expand Up @@ -64,5 +63,4 @@ public void close()
public void inspectRuntimeShape(final RuntimeShapeInspector inspector)
{
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ public Aggregator factorize(final ColumnSelectorFactory metricFactory)
final BaseObjectColumnValueSelector<ArrayOfDoublesSketch> selector = metricFactory
.makeColumnValueSelector(fieldName);
if (selector instanceof NilColumnValueSelector) {
return new ArrayOfDoublesSketchNoOpAggregator(numberOfValues);
return new NoopArrayOfDoublesSketchAggregator(numberOfValues);
}
return new ArrayOfDoublesSketchMergeAggregator(selector, nominalEntries, numberOfValues);
}
// input is raw data (key and array of values), use build aggregator
final DimensionSelector keySelector = metricFactory
.makeDimensionSelector(new DefaultDimensionSpec(fieldName, fieldName));
if (DimensionSelector.isNilSelector(keySelector)) {
return new ArrayOfDoublesSketchNoOpAggregator(numberOfValues);
return new NoopArrayOfDoublesSketchAggregator(numberOfValues);
}
final List<BaseDoubleColumnValueSelector> valueSelectors = new ArrayList<>();
for (final String column : metricColumns) {
Expand All @@ -118,7 +118,7 @@ public BufferAggregator factorizeBuffered(final ColumnSelectorFactory metricFact
final BaseObjectColumnValueSelector<ArrayOfDoublesSketch> selector = metricFactory
.makeColumnValueSelector(fieldName);
if (selector instanceof NilColumnValueSelector) {
return new ArrayOfDoublesSketchNoOpBufferAggregator(numberOfValues);
return new NoopArrayOfDoublesSketchBufferAggregator(numberOfValues);
}
return new ArrayOfDoublesSketchMergeBufferAggregator(
selector,
Expand All @@ -131,7 +131,7 @@ public BufferAggregator factorizeBuffered(final ColumnSelectorFactory metricFact
final DimensionSelector keySelector = metricFactory
.makeDimensionSelector(new DefaultDimensionSpec(fieldName, fieldName));
if (DimensionSelector.isNilSelector(keySelector)) {
return new ArrayOfDoublesSketchNoOpBufferAggregator(numberOfValues);
return new NoopArrayOfDoublesSketchBufferAggregator(numberOfValues);
}
final List<BaseDoubleColumnValueSelector> valueSelectors = new ArrayList<>();
for (final String column : metricColumns) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
import com.yahoo.sketches.tuple.ArrayOfDoublesUpdatableSketchBuilder;
import org.apache.druid.query.aggregation.Aggregator;

public class ArrayOfDoublesSketchNoOpAggregator implements Aggregator
public class NoopArrayOfDoublesSketchAggregator implements Aggregator
{

private final ArrayOfDoublesSketch emptySketch;

public ArrayOfDoublesSketchNoOpAggregator(final int numberOfValues)
public NoopArrayOfDoublesSketchAggregator(final int numberOfValues)
{
emptySketch = new ArrayOfDoublesUpdatableSketchBuilder().setNumberOfValues(numberOfValues).build().compact();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@

import java.nio.ByteBuffer;

public class ArrayOfDoublesSketchNoOpBufferAggregator implements BufferAggregator
public class NoopArrayOfDoublesSketchBufferAggregator implements BufferAggregator
{

private final ArrayOfDoublesSketch emptySketch;

public ArrayOfDoublesSketchNoOpBufferAggregator(final int numberOfValues)
public NoopArrayOfDoublesSketchBufferAggregator(final int numberOfValues)
{
emptySketch = new ArrayOfDoublesUpdatableSketchBuilder().setNumberOfValues(numberOfValues).build().compact();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public Aggregator factorize(ColumnSelectorFactory columnFactory)
BaseNullableColumnValueSelector selector = columnFactory.makeColumnValueSelector(field.getDimension());
if (selector instanceof NilColumnValueSelector) {
// BloomKFilter must be the same size so we cannot use a constant for the empty agg
return new EmptyBloomFilterAggregator(filter);
return new NoopBloomFilterAggregator(filter);
}
throw new IAE(
"Cannot create bloom filter buffer aggregator for column selector type [%s]",
Expand Down Expand Up @@ -124,7 +124,7 @@ public BufferAggregator factorizeBuffered(ColumnSelectorFactory columnFactory)
if (capabilities == null) {
BaseNullableColumnValueSelector selector = columnFactory.makeColumnValueSelector(field.getDimension());
if (selector instanceof NilColumnValueSelector) {
return new EmptyBloomFilterBufferAggregator(maxNumEntries);
return new NoopBloomFilterBufferAggregator(maxNumEntries);
}
throw new IAE(
"Cannot create bloom filter buffer aggregator for column selector type [%s]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import org.apache.druid.query.filter.BloomKFilter;
import org.apache.druid.segment.NilColumnValueSelector;

public final class EmptyBloomFilterAggregator extends BaseBloomFilterAggregator<NilColumnValueSelector>
public final class NoopBloomFilterAggregator extends BaseBloomFilterAggregator<NilColumnValueSelector>
{
EmptyBloomFilterAggregator(BloomKFilter collector)
NoopBloomFilterAggregator(BloomKFilter collector)
{
super(NilColumnValueSelector.instance(), collector);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@

import java.nio.ByteBuffer;

public final class EmptyBloomFilterBufferAggregator extends BaseBloomFilterBufferAggregator<NilColumnValueSelector>
public final class NoopBloomFilterBufferAggregator extends BaseBloomFilterBufferAggregator<NilColumnValueSelector>
{
EmptyBloomFilterBufferAggregator(int maxNumEntries)
NoopBloomFilterBufferAggregator(int maxNumEntries)
{
super(NilColumnValueSelector.instance(), maxNumEntries);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ public float getFloat()
}

@Override
public double getDouble()
public long getLong()
{
return 0;
}

@Override
public void close()
public double getDouble()
{
return 0;
}

@Override
public long getLong()
public void close()
{
return 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public float getFloat(ByteBuffer buf, int position)
return 0;
}


@Override
public long getLong(ByteBuffer buf, int position)
{
Expand Down