Class AvgValueAggregator
- java.lang.Object
-
- org.apache.pinot.segment.local.aggregator.AvgValueAggregator
-
- All Implemented Interfaces:
ValueAggregator<Object,AvgPair>
public class AvgValueAggregator extends Object implements ValueAggregator<Object,AvgPair>
-
-
Field Summary
Fields Modifier and Type Field Description static FieldSpec.DataTypeAGGREGATED_VALUE_TYPE
-
Constructor Summary
Constructors Constructor Description AvgValueAggregator()
-
Method Summary
Modifier and Type Method Description AvgPairapplyAggregatedValue(AvgPair value, AvgPair aggregatedValue)Applies an aggregated value to the current aggregated value.AvgPairapplyRawValue(AvgPair value, Object rawValue)Applies a raw value to the current aggregated value.AvgPaircloneAggregatedValue(AvgPair value)Clones an aggregated value.AvgPairdeserializeAggregatedValue(byte[] bytes)De-serializes an aggregated value from a byte array.FieldSpec.DataTypegetAggregatedValueType()Returns the data type of the aggregated value.AggregationFunctionTypegetAggregationType()Returns the type of the aggregation.AvgPairgetInitialAggregatedValue(Object rawValue)Returns the initial aggregated value.intgetMaxAggregatedValueByteSize()Returns the maximum size in bytes of the aggregated values seen so far.byte[]serializeAggregatedValue(AvgPair value)Serializes an aggregated value into a byte array.
-
-
-
Field Detail
-
AGGREGATED_VALUE_TYPE
public static final FieldSpec.DataType AGGREGATED_VALUE_TYPE
-
-
Method Detail
-
getAggregationType
public AggregationFunctionType getAggregationType()
Description copied from interface:ValueAggregatorReturns the type of the aggregation.- Specified by:
getAggregationTypein interfaceValueAggregator<Object,AvgPair>
-
getAggregatedValueType
public FieldSpec.DataType getAggregatedValueType()
Description copied from interface:ValueAggregatorReturns the data type of the aggregated value.- Specified by:
getAggregatedValueTypein interfaceValueAggregator<Object,AvgPair>
-
getInitialAggregatedValue
public AvgPair getInitialAggregatedValue(Object rawValue)
Description copied from interface:ValueAggregatorReturns the initial aggregated value.- Specified by:
getInitialAggregatedValuein interfaceValueAggregator<Object,AvgPair>
-
applyRawValue
public AvgPair applyRawValue(AvgPair value, Object rawValue)
Description copied from interface:ValueAggregatorApplies a raw value to the current aggregated value.NOTE: if value is mutable, will directly modify the value.
- Specified by:
applyRawValuein interfaceValueAggregator<Object,AvgPair>
-
applyAggregatedValue
public AvgPair applyAggregatedValue(AvgPair value, AvgPair aggregatedValue)
Description copied from interface:ValueAggregatorApplies an aggregated value to the current aggregated value.NOTE: if value is mutable, will directly modify the value.
- Specified by:
applyAggregatedValuein interfaceValueAggregator<Object,AvgPair>
-
cloneAggregatedValue
public AvgPair cloneAggregatedValue(AvgPair value)
Description copied from interface:ValueAggregatorClones an aggregated value.- Specified by:
cloneAggregatedValuein interfaceValueAggregator<Object,AvgPair>
-
getMaxAggregatedValueByteSize
public int getMaxAggregatedValueByteSize()
Description copied from interface:ValueAggregatorReturns the maximum size in bytes of the aggregated values seen so far.- Specified by:
getMaxAggregatedValueByteSizein interfaceValueAggregator<Object,AvgPair>
-
serializeAggregatedValue
public byte[] serializeAggregatedValue(AvgPair value)
Description copied from interface:ValueAggregatorSerializes an aggregated value into a byte array.- Specified by:
serializeAggregatedValuein interfaceValueAggregator<Object,AvgPair>
-
deserializeAggregatedValue
public AvgPair deserializeAggregatedValue(byte[] bytes)
Description copied from interface:ValueAggregatorDe-serializes an aggregated value from a byte array.- Specified by:
deserializeAggregatedValuein interfaceValueAggregator<Object,AvgPair>
-
-