Class SegmentDictionaryCreator
- java.lang.Object
-
- org.apache.pinot.segment.local.segment.creator.impl.SegmentDictionaryCreator
-
- All Implemented Interfaces:
Closeable,AutoCloseable,IndexCreator
public class SegmentDictionaryCreator extends Object implements IndexCreator
The IndexCreator for dictionaries. Although this class implementsIndexCreator, it is not intended to be used as a normal IndexCreator. Specifically, neitheradd(Object, int)oradd(Object[], int[])should be called on this object. In order to make sure these methods are not being called, they throw exceptions in this class. This requirement is a corollary from the fact that theIndexCreatorcontract assumes the dictionary id can be calculated before callingaddmethods.
-
-
Constructor Summary
Constructors Constructor Description SegmentDictionaryCreator(FieldSpec fieldSpec, File indexDir)SegmentDictionaryCreator(FieldSpec fieldSpec, File indexDir, boolean useVarLengthDictionary)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Object[] values, int[] dictIds)voidadd(Object value, int dictId)voidbuild(Object sortedValues)voidclose()intgetNumBytesPerEntry()int[]indexOfMV(Object value)intindexOfSV(Object value)voidpostIndexingCleanup()Cleans up the no longer needed objects after all the indexing is done to free up some memory.voidseal()
-
-
-
Method Detail
-
add
public void add(@Nonnull Object value, int dictId) throws IOException- Specified by:
addin interfaceIndexCreator- Throws:
IOException
-
add
public void add(@Nonnull Object[] values, @Nullable int[] dictIds) throws IOException- Specified by:
addin interfaceIndexCreator- Throws:
IOException
-
build
public void build(Object sortedValues) throws IOException
- Throws:
IOException
-
getNumBytesPerEntry
public int getNumBytesPerEntry()
-
indexOfSV
public int indexOfSV(Object value)
-
indexOfMV
public int[] indexOfMV(Object value)
-
postIndexingCleanup
public void postIndexingCleanup()
Cleans up the no longer needed objects after all the indexing is done to free up some memory.
-
seal
public void seal()
- Specified by:
sealin interfaceIndexCreator
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
-