Class MapBasedGlobalDictionaries
- java.lang.Object
-
- org.apache.pinot.tools.anonymizer.MapBasedGlobalDictionaries
-
- All Implemented Interfaces:
GlobalDictionaries
public class MapBasedGlobalDictionaries extends Object implements GlobalDictionaries
-
-
Field Summary
-
Fields inherited from interface org.apache.pinot.tools.anonymizer.GlobalDictionaries
DICT_FILE_EXTENSION
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDerivedValuesToGlobalDictionaries()This is the third and final step where we complete the global dictionaries by generating values: For numeric columns, we generate in order since we start with a base value.voidaddOrigValueToGlobalDictionary(Object origValue, String column, org.apache.pinot.segment.spi.ColumnMetadata columnMetadata, int cardinality)First step towards building global dictionary by inserting the original values from segments into global dictionaryObjectgetDerivedValueForOrigValueSV(String column, Object origValue)Object[]getDerivedValuesForOrigValuesMV(String column, Object[] origMultiValues)voidserialize(String outputDir)voidsortOriginalValuesInGlobalDictionaries()This is the second step where we complete the global dictionaries by sorting the original values to get sort order across all segments
-
-
-
Method Detail
-
addOrigValueToGlobalDictionary
public void addOrigValueToGlobalDictionary(Object origValue, String column, org.apache.pinot.segment.spi.ColumnMetadata columnMetadata, int cardinality)
First step towards building global dictionary by inserting the original values from segments into global dictionary- Specified by:
addOrigValueToGlobalDictionaryin interfaceGlobalDictionaries- Parameters:
origValue- original valuecolumn- column namecolumnMetadata- column metadatacardinality- total cardinality of column
-
sortOriginalValuesInGlobalDictionaries
public void sortOriginalValuesInGlobalDictionaries()
This is the second step where we complete the global dictionaries by sorting the original values to get sort order across all segments- Specified by:
sortOriginalValuesInGlobalDictionariesin interfaceGlobalDictionaries
-
addDerivedValuesToGlobalDictionaries
public void addDerivedValuesToGlobalDictionaries()
This is the third and final step where we complete the global dictionaries by generating values: For numeric columns, we generate in order since we start with a base value. For string column, we first generate and then sort- Specified by:
addDerivedValuesToGlobalDictionariesin interfaceGlobalDictionaries
-
serialize
public void serialize(String outputDir) throws Exception
- Specified by:
serializein interfaceGlobalDictionaries- Throws:
Exception
-
getDerivedValueForOrigValueSV
public Object getDerivedValueForOrigValueSV(String column, Object origValue)
- Specified by:
getDerivedValueForOrigValueSVin interfaceGlobalDictionaries
-
getDerivedValuesForOrigValuesMV
public Object[] getDerivedValuesForOrigValuesMV(String column, Object[] origMultiValues)
- Specified by:
getDerivedValuesForOrigValuesMVin interfaceGlobalDictionaries
-
-