mirror of https://github.com/apache/druid.git
making AggregatorFactory abstract class
This commit is contained in:
parent
164b0aad7a
commit
77fc86c015
|
@ -39,7 +39,7 @@ import java.util.Comparator;
|
|||
import java.util.List;
|
||||
|
||||
@JsonTypeName("approxHistogram")
|
||||
public class ApproximateHistogramAggregatorFactory implements AggregatorFactory
|
||||
public class ApproximateHistogramAggregatorFactory extends AggregatorFactory
|
||||
{
|
||||
private static final byte CACHE_TYPE_ID = 0x8;
|
||||
|
||||
|
|
|
@ -34,13 +34,13 @@ import java.util.List;
|
|||
* provided to the Aggregator through the MetricSelector object, so whatever creates that object gets to choose how
|
||||
* the data is actually stored and accessed.
|
||||
*/
|
||||
public interface AggregatorFactory
|
||||
public abstract class AggregatorFactory
|
||||
{
|
||||
public Aggregator factorize(ColumnSelectorFactory metricFactory);
|
||||
public abstract Aggregator factorize(ColumnSelectorFactory metricFactory);
|
||||
|
||||
public BufferAggregator factorizeBuffered(ColumnSelectorFactory metricFactory);
|
||||
public abstract BufferAggregator factorizeBuffered(ColumnSelectorFactory metricFactory);
|
||||
|
||||
public Comparator getComparator();
|
||||
public abstract Comparator getComparator();
|
||||
|
||||
/**
|
||||
* A method that knows how to combine the outputs of the getIntermediate() method from the Aggregators
|
||||
|
@ -53,7 +53,7 @@ public interface AggregatorFactory
|
|||
*
|
||||
* @return an object representing the combination of lhs and rhs, this can be a new object or a mutation of the inputs
|
||||
*/
|
||||
public Object combine(Object lhs, Object rhs);
|
||||
public abstract Object combine(Object lhs, Object rhs);
|
||||
|
||||
/**
|
||||
* Returns an AggregatorFactory that can be used to combine the output of aggregators from this factory. This
|
||||
|
@ -62,14 +62,14 @@ public interface AggregatorFactory
|
|||
*
|
||||
* @return a new Factory that can be used for operations on top of data output from the current factory.
|
||||
*/
|
||||
public AggregatorFactory getCombiningFactory();
|
||||
public abstract AggregatorFactory getCombiningFactory();
|
||||
|
||||
/**
|
||||
* Gets a list of all columns that this AggregatorFactory will scan
|
||||
*
|
||||
* @return AggregatorFactories for the columns to scan of the parent AggregatorFactory
|
||||
*/
|
||||
public List<AggregatorFactory> getRequiredColumns();
|
||||
public abstract List<AggregatorFactory> getRequiredColumns();
|
||||
|
||||
/**
|
||||
* A method that knows how to "deserialize" the object from whatever form it might have been put into
|
||||
|
@ -79,7 +79,7 @@ public interface AggregatorFactory
|
|||
*
|
||||
* @return the deserialized object
|
||||
*/
|
||||
public Object deserialize(Object object);
|
||||
public abstract Object deserialize(Object object);
|
||||
|
||||
/**
|
||||
* "Finalizes" the computation of an object. Primarily useful for complex types that have a different mergeable
|
||||
|
@ -89,27 +89,27 @@ public interface AggregatorFactory
|
|||
*
|
||||
* @return the finalized value that should be returned for the initial query
|
||||
*/
|
||||
public Object finalizeComputation(Object object);
|
||||
public abstract Object finalizeComputation(Object object);
|
||||
|
||||
public String getName();
|
||||
public abstract String getName();
|
||||
|
||||
public List<String> requiredFields();
|
||||
public abstract List<String> requiredFields();
|
||||
|
||||
public byte[] getCacheKey();
|
||||
public abstract byte[] getCacheKey();
|
||||
|
||||
public String getTypeName();
|
||||
public abstract String getTypeName();
|
||||
|
||||
/**
|
||||
* Returns the maximum size that this aggregator will require in bytes for intermediate storage of results.
|
||||
*
|
||||
* @return the maximum number of bytes that an aggregator of this type will require for intermediate result storage.
|
||||
*/
|
||||
public int getMaxIntermediateSize();
|
||||
public abstract int getMaxIntermediateSize();
|
||||
|
||||
/**
|
||||
* Returns the starting value for a corresponding aggregator. For example, 0 for sums, - Infinity for max, an empty mogrifier
|
||||
*
|
||||
* @return the starting value for a corresponding aggregator.
|
||||
*/
|
||||
public Object getAggregatorStartValue();
|
||||
public abstract Object getAggregatorStartValue();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
*/
|
||||
public class CountAggregatorFactory implements AggregatorFactory
|
||||
public class CountAggregatorFactory extends AggregatorFactory
|
||||
{
|
||||
private static final byte[] CACHE_KEY = new byte[]{0x0};
|
||||
private final String name;
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
*/
|
||||
public class DoubleMaxAggregatorFactory implements AggregatorFactory
|
||||
public class DoubleMaxAggregatorFactory extends AggregatorFactory
|
||||
{
|
||||
private static final byte CACHE_TYPE_ID = 0x3;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
*/
|
||||
public class DoubleMinAggregatorFactory implements AggregatorFactory
|
||||
public class DoubleMinAggregatorFactory extends AggregatorFactory
|
||||
{
|
||||
private static final byte CACHE_TYPE_ID = 0x4;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
*/
|
||||
public class DoubleSumAggregatorFactory implements AggregatorFactory
|
||||
public class DoubleSumAggregatorFactory extends AggregatorFactory
|
||||
{
|
||||
private static final byte CACHE_TYPE_ID = 0x2;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.nio.ByteBuffer;
|
|||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
public class FilteredAggregatorFactory implements AggregatorFactory
|
||||
public class FilteredAggregatorFactory extends AggregatorFactory
|
||||
{
|
||||
private static final byte CACHE_TYPE_ID = 0x9;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ import java.util.Arrays;
|
|||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
public class HistogramAggregatorFactory implements AggregatorFactory
|
||||
public class HistogramAggregatorFactory extends AggregatorFactory
|
||||
{
|
||||
private static final byte CACHE_TYPE_ID = 0x7;
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ import java.security.NoSuchAlgorithmException;
|
|||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
public class JavaScriptAggregatorFactory implements AggregatorFactory
|
||||
public class JavaScriptAggregatorFactory extends AggregatorFactory
|
||||
{
|
||||
private static final byte CACHE_TYPE_ID = 0x6;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
*/
|
||||
public class LongMaxAggregatorFactory implements AggregatorFactory
|
||||
public class LongMaxAggregatorFactory extends AggregatorFactory
|
||||
{
|
||||
private static final byte CACHE_TYPE_ID = 0xA;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
*/
|
||||
public class LongMinAggregatorFactory implements AggregatorFactory
|
||||
public class LongMinAggregatorFactory extends AggregatorFactory
|
||||
{
|
||||
private static final byte CACHE_TYPE_ID = 0xB;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
*/
|
||||
public class LongSumAggregatorFactory implements AggregatorFactory
|
||||
public class LongSumAggregatorFactory extends AggregatorFactory
|
||||
{
|
||||
private static final byte CACHE_TYPE_ID = 0x1;
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ import java.nio.ByteBuffer;
|
|||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
public class CardinalityAggregatorFactory implements AggregatorFactory
|
||||
public class CardinalityAggregatorFactory extends AggregatorFactory
|
||||
{
|
||||
public static Object estimateCardinality(Object object)
|
||||
{
|
||||
|
|
|
@ -38,7 +38,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
*/
|
||||
public class HyperUniquesAggregatorFactory implements AggregatorFactory
|
||||
public class HyperUniquesAggregatorFactory extends AggregatorFactory
|
||||
{
|
||||
public static Object estimateCardinality(Object object)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue