Class GroupedHistogramState
- java.lang.Object
-
- io.prestosql.operator.aggregation.state.AbstractGroupedAccumulatorState
-
- io.prestosql.operator.aggregation.histogram.GroupedHistogramState
-
- All Implemented Interfaces:
HistogramState
,AccumulatorState
,GroupedAccumulatorState
public class GroupedHistogramState extends AbstractGroupedAccumulatorState implements HistogramState
state object that uses a single histogram for all groups. SeeGroupedTypedHistogram
-
-
Constructor Summary
Constructors Constructor Description GroupedHistogramState(Type keyType, BlockTypeOperators.BlockPositionEqual equalOperator, BlockTypeOperators.BlockPositionHashCode hashCodeOperator, int expectedEntriesCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMemoryUsage(long memory)
void
deserialize(Block block, int expectedSize)
void
ensureCapacity(long size)
TypedHistogram
get()
will create an empty histogram if none existslong
getEstimatedSize()
-
Methods inherited from class io.prestosql.operator.aggregation.state.AbstractGroupedAccumulatorState
getGroupId, setGroupId
-
-
-
-
Constructor Detail
-
GroupedHistogramState
public GroupedHistogramState(Type keyType, BlockTypeOperators.BlockPositionEqual equalOperator, BlockTypeOperators.BlockPositionHashCode hashCodeOperator, int expectedEntriesCount)
-
-
Method Detail
-
ensureCapacity
public void ensureCapacity(long size)
- Specified by:
ensureCapacity
in interfaceGroupedAccumulatorState
-
get
public TypedHistogram get()
Description copied from interface:HistogramState
will create an empty histogram if none exists- Specified by:
get
in interfaceHistogramState
- Returns:
- histogram based on the type of state (single, grouped). Note that empty histograms will serialize to null as required
-
deserialize
public void deserialize(Block block, int expectedSize)
- Specified by:
deserialize
in interfaceHistogramState
-
addMemoryUsage
public void addMemoryUsage(long memory)
- Specified by:
addMemoryUsage
in interfaceHistogramState
-
getEstimatedSize
public long getEstimatedSize()
- Specified by:
getEstimatedSize
in interfaceAccumulatorState
-
-