Search in sources :

Example 1 with BlockletIndexModel

use of org.apache.carbondata.core.indexstore.blockletindex.BlockletIndexModel in project carbondata by apache.

the class BlockletIndexStore method loadAndGetIndex.

/**
 * Below method will be used to load the segment of segments
 * One segment may have multiple task , so  table segment will be loaded
 * based on task id and will return the map of taskId to table segment
 * map
 *
 * @return map of task id to segment mapping
 * @throws IOException
 */
private BlockIndex loadAndGetIndex(TableBlockIndexUniqueIdentifier identifier, SegmentIndexFileStore indexFileStore, Map<String, BlockMetaInfo> blockMetaInfoMap, CarbonTable carbonTable, boolean addTableBlockToUnsafe, Configuration configuration, boolean serializeDmStore, List<DataFileFooter> indexInfos) throws IOException {
    BlockIndex blockIndex = (BlockIndex) BlockletIndexFactory.createIndex(carbonTable);
    final BlockletIndexModel blockletIndexModel = new BlockletIndexModel(carbonTable, identifier.getIndexFilePath() + CarbonCommonConstants.FILE_SEPARATOR + identifier.getIndexFileName(), indexFileStore.getFileData(identifier.getIndexFileName()), blockMetaInfoMap, identifier.getSegmentId(), addTableBlockToUnsafe, configuration, serializeDmStore);
    blockletIndexModel.setIndexInfos(indexInfos);
    blockIndex.init(blockletIndexModel);
    return blockIndex;
}
Also used : BlockIndex(org.apache.carbondata.core.indexstore.blockletindex.BlockIndex) BlockletIndexModel(org.apache.carbondata.core.indexstore.blockletindex.BlockletIndexModel)

Aggregations

BlockIndex (org.apache.carbondata.core.indexstore.blockletindex.BlockIndex)1 BlockletIndexModel (org.apache.carbondata.core.indexstore.blockletindex.BlockletIndexModel)1