Class BaseDefaultColumnHandler
- java.lang.Object
-
- org.apache.pinot.segment.local.segment.index.loader.defaultcolumn.BaseDefaultColumnHandler
-
- All Implemented Interfaces:
DefaultColumnHandler
- Direct Known Subclasses:
V1DefaultColumnHandler,V3DefaultColumnHandler
public abstract class BaseDefaultColumnHandler extends Object implements DefaultColumnHandler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classBaseDefaultColumnHandler.DefaultColumnAction
-
Field Summary
Fields Modifier and Type Field Description protected File_indexDirprotected IndexLoadingConfig_indexLoadingConfigprotected Schema_schemaprotected SegmentMetadata_segmentMetadataprotected SegmentDirectory.Writer_segmentWriter
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseDefaultColumnHandler(File indexDir, SegmentMetadata segmentMetadata, IndexLoadingConfig indexLoadingConfig, Schema schema, SegmentDirectory.Writer segmentWriter)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected booleancreateColumnV1Indices(String column)Helper method to create the V1 indices (dictionary and forward index) for a column, returnstrueif the creation succeeds,falseotherwise.protected booleanisForwardIndexDisabled(String column)Check and return whether the forward index is disabled for a given columnbooleanneedUpdateDefaultColumns()Check if there is a need to add/remove/update the auto-generated default columns for the segment, according to the current table schema.protected voidremoveColumnIndices(String column)Helper method to remove the indices (dictionary and forward index) for a default column.protected abstract booleanupdateDefaultColumn(String column, BaseDefaultColumnHandler.DefaultColumnAction action)Helper method to update default column indices, returnstrueif the update succeeds,falseotherwise.voidupdateDefaultColumns()Update the auto-generated default columns.
-
-
-
Field Detail
-
_indexDir
protected final File _indexDir
-
_segmentMetadata
protected final SegmentMetadata _segmentMetadata
-
_indexLoadingConfig
protected final IndexLoadingConfig _indexLoadingConfig
-
_schema
protected final Schema _schema
-
_segmentWriter
protected final SegmentDirectory.Writer _segmentWriter
-
-
Constructor Detail
-
BaseDefaultColumnHandler
protected BaseDefaultColumnHandler(File indexDir, SegmentMetadata segmentMetadata, IndexLoadingConfig indexLoadingConfig, Schema schema, SegmentDirectory.Writer segmentWriter)
-
-
Method Detail
-
needUpdateDefaultColumns
public boolean needUpdateDefaultColumns()
Description copied from interface:DefaultColumnHandlerCheck if there is a need to add/remove/update the auto-generated default columns for the segment, according to the current table schema.- Specified by:
needUpdateDefaultColumnsin interfaceDefaultColumnHandler- Returns:
- true if there is a need to update.
-
updateDefaultColumns
public void updateDefaultColumns() throws ExceptionUpdate the auto-generated default columns.Supported default column actions include:
ADD/UPDATE/REMOVE DIMENSION/METRIC- Specified by:
updateDefaultColumnsin interfaceDefaultColumnHandler- Throws:
Exception
-
updateDefaultColumn
protected abstract boolean updateDefaultColumn(String column, BaseDefaultColumnHandler.DefaultColumnAction action) throws Exception
Helper method to update default column indices, returnstrueif the update succeeds,falseotherwise.- Throws:
Exception
-
removeColumnIndices
protected void removeColumnIndices(String column) throws IOException
Helper method to remove the indices (dictionary and forward index) for a default column.- Parameters:
column- column name.- Throws:
IOException
-
createColumnV1Indices
protected boolean createColumnV1Indices(String column) throws Exception
Helper method to create the V1 indices (dictionary and forward index) for a column, returnstrueif the creation succeeds,falseotherwise.- Throws:
Exception
-
isForwardIndexDisabled
protected boolean isForwardIndexDisabled(String column)
Check and return whether the forward index is disabled for a given column
-
-