Class ValueStore
- java.lang.Object
-
- io.trino.operator.aggregation.histogram.ValueStore
-
public class ValueStore extends Object
helper class forGroupedTypedHistogramMay be used for other cases that need a simple hash for valuessort of a FlyWeightStore for values--will return unique number for a value. If it exists, you'll get the same number. Class map Value -> number
Note it assumes you're storing # -> Value (Type, Block, position, or the result of the ) somewhere else
-
-
Constructor Summary
Constructors Constructor Description ValueStore(Type type, BlockTypeOperators.BlockPositionEqual equalOperator, int expectedSize, BlockBuilder values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intaddAndGetPosition(Block block, int position, long valueHash)This will add an item if not already in the system.longgetEstimatedSize()intgetRehashCount()
-
-
-
Constructor Detail
-
ValueStore
public ValueStore(Type type, BlockTypeOperators.BlockPositionEqual equalOperator, int expectedSize, BlockBuilder values)
-
-
Method Detail
-
addAndGetPosition
public int addAndGetPosition(Block block, int position, long valueHash)
This will add an item if not already in the system. It returns a pointer that is unique for multiple instances of the value. If item present, returns the pointer into the system
-
getRehashCount
public int getRehashCount()
-
getEstimatedSize
public long getEstimatedSize()
-
-