Class DefaultIndexCreatorProvider
- java.lang.Object
-
- org.apache.pinot.segment.local.segment.creator.impl.DefaultIndexCreatorProvider
-
- All Implemented Interfaces:
BloomFilterCreatorProvider,ForwardIndexCreatorProvider,GeoSpatialIndexCreatorProvider,IndexCreatorProvider,InvertedIndexCreatorProvider,JsonIndexCreatorProvider,RangeIndexCreatorProvider,TextIndexCreatorProvider
public final class DefaultIndexCreatorProvider extends Object implements IndexCreatorProvider
This class centralizes logic for how to create indexes. It can be overridden by SPI {@see IndexCreatorProviders} and should not be constructed directly, but accessed only via {@see IndexCreatorProviders#getIndexCreatorProvider}. Unless a user provides an override, this is the logic which will be used to create each index type.
-
-
Constructor Summary
Constructors Constructor Description DefaultIndexCreatorProvider()
-
Method Summary
-
-
-
Method Detail
-
newForwardIndexCreator
public ForwardIndexCreator newForwardIndexCreator(IndexCreationContext.Forward context) throws Exception
- Specified by:
newForwardIndexCreatorin interfaceForwardIndexCreatorProvider- Throws:
Exception
-
newInvertedIndexCreator
public DictionaryBasedInvertedIndexCreator newInvertedIndexCreator(IndexCreationContext.Inverted context) throws IOException
- Specified by:
newInvertedIndexCreatorin interfaceInvertedIndexCreatorProvider- Throws:
IOException
-
newJsonIndexCreator
public JsonIndexCreator newJsonIndexCreator(IndexCreationContext.Json context) throws IOException
- Specified by:
newJsonIndexCreatorin interfaceJsonIndexCreatorProvider- Throws:
IOException
-
newTextIndexCreator
public TextIndexCreator newTextIndexCreator(IndexCreationContext.Text context) throws IOException
- Specified by:
newTextIndexCreatorin interfaceTextIndexCreatorProvider- Throws:
IOException
-
newGeoSpatialIndexCreator
public GeoSpatialIndexCreator newGeoSpatialIndexCreator(IndexCreationContext.Geospatial context) throws IOException
- Specified by:
newGeoSpatialIndexCreatorin interfaceGeoSpatialIndexCreatorProvider- Throws:
IOException
-
shouldDeriveNumDocsPerChunk
public static boolean shouldDeriveNumDocsPerChunk(String columnName, Map<String,Map<String,String>> columnProperties)
-
getRawIndexWriterVersion
public static int getRawIndexWriterVersion(String columnName, Map<String,Map<String,String>> columnProperties)
-
getRawIndexCreatorForSVColumn
public static ForwardIndexCreator getRawIndexCreatorForSVColumn(File file, ChunkCompressionType compressionType, String column, FieldSpec.DataType dataType, int totalDocs, int lengthOfLongestEntry, boolean deriveNumDocsPerChunk, int writerVersion) throws IOException
Helper method to build the raw index creator for the column. Assumes that column to be indexed is single valued.- Parameters:
file- Output index filecolumn- Column nametotalDocs- Total number of documents to indexlengthOfLongestEntry- Length of longest entryderiveNumDocsPerChunk- true if varbyte writer should auto-derive the number of rows per chunkwriterVersion- version to use for the raw index writer- Returns:
- raw index creator
- Throws:
IOException
-
getRawIndexCreatorForMVColumn
public static ForwardIndexCreator getRawIndexCreatorForMVColumn(File file, ChunkCompressionType compressionType, String column, FieldSpec.DataType dataType, int totalDocs, int maxNumberOfMultiValueElements, boolean deriveNumDocsPerChunk, int writerVersion, int maxRowLengthInBytes) throws IOException
Helper method to build the raw index creator for the column. Assumes that column to be indexed is single valued.- Parameters:
file- Output index filecolumn- Column nametotalDocs- Total number of documents to indexderiveNumDocsPerChunk- true if varbyte writer should auto-derive the number of rows per chunkwriterVersion- version to use for the raw index writermaxRowLengthInBytes- the length of the longest row in bytes- Returns:
- raw index creator
- Throws:
IOException
-
newBloomFilterCreator
public BloomFilterCreator newBloomFilterCreator(IndexCreationContext.BloomFilter context) throws IOException
- Specified by:
newBloomFilterCreatorin interfaceBloomFilterCreatorProvider- Throws:
IOException
-
newRangeIndexCreator
public CombinedInvertedIndexCreator newRangeIndexCreator(IndexCreationContext.Range context) throws IOException
- Specified by:
newRangeIndexCreatorin interfaceRangeIndexCreatorProvider- Throws:
IOException
-
-