Class AbstractColumnStatisticsCollector
- java.lang.Object
-
- org.apache.pinot.segment.local.segment.creator.impl.stats.AbstractColumnStatisticsCollector
-
- All Implemented Interfaces:
Serializable,ColumnStatistics
- Direct Known Subclasses:
BigDecimalColumnPreIndexStatsCollector,BytesColumnPredIndexStatsCollector,DoubleColumnPreIndexStatsCollector,FloatColumnPreIndexStatsCollector,IntColumnPreIndexStatsCollector,LongColumnPreIndexStatsCollector,StringColumnPreIndexStatsCollector
public abstract class AbstractColumnStatisticsCollector extends Object implements ColumnStatistics
This class in initialized per column and all the data is sent to it before actual indexes are created the job of this class is to collect unique elements record cardinality compute min compute max see if column isSorted- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected FieldSpec_fieldSpecprotected int_maxNumberOfMultiValuesprotected boolean_sortedprotected int_totalNumberOfEntriesprotected static intINITIAL_HASH_SET_SIZE
-
Constructor Summary
Constructors Constructor Description AbstractColumnStatisticsCollector(String column, StatsCollectorConfig statsCollectorConfig)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddressSorted(Comparable entry)abstract voidcollect(Object entry)Collects statistics for the given entry (entry can be either single-valued or multi-valued).intgetLengthOfLargestElement()intgetLengthOfShortestElement()intgetMaxNumberOfMultiValues()intgetNumPartitions()Returns the number of partitions for this column.PartitionFunctiongetPartitionFunction()Returns thePartitionFunctionfor the column.Map<String,String>getPartitionFunctionConfig()Returns thePartitionFunction's functionConfig for the column.Set<Integer>getPartitions()Returns the partitions within which the column values exist.intgetTotalNumberOfEntries()protected booleanisPartitionEnabled()booleanisSorted()abstract voidseal()protected voidupdatePartition(String value)Updates the partition range based on the partition of the given value.protected voidupdateTotalNumberOfEntries(Object[] entries)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pinot.segment.spi.creator.ColumnStatistics
getCardinality, getMaxRowLengthInBytes, getMaxValue, getMinValue, getUniqueValuesSet, isFixedLength
-
-
-
-
Field Detail
-
INITIAL_HASH_SET_SIZE
protected static final int INITIAL_HASH_SET_SIZE
- See Also:
- Constant Field Values
-
_fieldSpec
protected final FieldSpec _fieldSpec
-
_totalNumberOfEntries
protected int _totalNumberOfEntries
-
_maxNumberOfMultiValues
protected int _maxNumberOfMultiValues
-
_sorted
protected boolean _sorted
-
-
Constructor Detail
-
AbstractColumnStatisticsCollector
public AbstractColumnStatisticsCollector(String column, StatsCollectorConfig statsCollectorConfig)
-
-
Method Detail
-
getMaxNumberOfMultiValues
public int getMaxNumberOfMultiValues()
- Specified by:
getMaxNumberOfMultiValuesin interfaceColumnStatistics
-
addressSorted
protected void addressSorted(Comparable entry)
-
isSorted
public boolean isSorted()
- Specified by:
isSortedin interfaceColumnStatistics
-
collect
public abstract void collect(Object entry)
Collects statistics for the given entry (entry can be either single-valued or multi-valued).
-
getLengthOfShortestElement
public int getLengthOfShortestElement()
- Specified by:
getLengthOfShortestElementin interfaceColumnStatistics
-
getLengthOfLargestElement
public int getLengthOfLargestElement()
- Specified by:
getLengthOfLargestElementin interfaceColumnStatistics
-
seal
public abstract void seal()
-
getPartitionFunction
@Nullable public PartitionFunction getPartitionFunction()
Returns thePartitionFunctionfor the column.- Specified by:
getPartitionFunctionin interfaceColumnStatistics- Returns:
- Partition function for the column.
-
getNumPartitions
public int getNumPartitions()
Returns the number of partitions for this column.- Specified by:
getNumPartitionsin interfaceColumnStatistics- Returns:
- Number of partitions.
-
getPartitionFunctionConfig
@Nullable public Map<String,String> getPartitionFunctionConfig()
Returns thePartitionFunction's functionConfig for the column.- Specified by:
getPartitionFunctionConfigin interfaceColumnStatistics- Returns:
- Partition Function config for the column.
-
getPartitions
@Nullable public Set<Integer> getPartitions()
Returns the partitions within which the column values exist.- Specified by:
getPartitionsin interfaceColumnStatistics- Returns:
- List of ranges for the column values.
-
isPartitionEnabled
protected boolean isPartitionEnabled()
-
updatePartition
protected void updatePartition(String value)
Updates the partition range based on the partition of the given value.- Parameters:
value- Column value.
-
updateTotalNumberOfEntries
protected void updateTotalNumberOfEntries(Object[] entries)
-
getTotalNumberOfEntries
public int getTotalNumberOfEntries()
- Specified by:
getTotalNumberOfEntriesin interfaceColumnStatistics
-
-