Search in sources :

Example 1 with HashBiMap

use of com.google.common.collect.HashBiMap in project pinot by linkedin.

the class SegmentIndexCreationDriverImpl method serializeTree.

private void serializeTree(StarTreeBuilder starTreeBuilder, boolean enableOffHeapFormat) throws Exception {
    //star tree was built using its own dictionary, we need to re-map dimension value id
    Map<String, HashBiMap<Object, Integer>> dictionaryMap = starTreeBuilder.getDictionaryMap();
    StarTree tree = starTreeBuilder.getTree();
    HashBiMap<String, Integer> dimensionNameToIndexMap = starTreeBuilder.getDimensionNameToIndexMap();
    StarTreeIndexNode node = (StarTreeIndexNode) tree.getRoot();
    updateTree(node, dictionaryMap, dimensionNameToIndexMap);
    File starTreeFile = new File(tempIndexDir, V1Constants.STAR_TREE_INDEX_FILE);
    if (enableOffHeapFormat) {
        StarTreeSerDe.writeTreeOffHeapFormat(tree, starTreeFile);
    } else {
        StarTreeSerDe.writeTreeOnHeapFormat(tree, starTreeFile);
    }
}
Also used : StarTree(com.linkedin.pinot.core.startree.StarTree) StarTreeIndexNode(com.linkedin.pinot.core.startree.StarTreeIndexNode) File(java.io.File) HashBiMap(com.google.common.collect.HashBiMap)

Aggregations

HashBiMap (com.google.common.collect.HashBiMap)1 StarTree (com.linkedin.pinot.core.startree.StarTree)1 StarTreeIndexNode (com.linkedin.pinot.core.startree.StarTreeIndexNode)1 File (java.io.File)1