Search in sources :

Example 1 with DataFileFooterConverterV3

use of org.apache.carbondata.core.util.DataFileFooterConverterV3 in project carbondata by apache.

the class CarbonFactDataWriterImplV3 method fillBlockIndexInfoDetails.

/**
 * Below method will be used to fill the block info details
 *
 * @param numberOfRows       number of rows in file
 * @param carbonDataFileName The name of carbonData file
 * @param currentPosition    current offset
 */
@Override
protected void fillBlockIndexInfoDetails(long numberOfRows, String carbonDataFileName, long currentPosition) {
    int i = 0;
    DataFileFooterConverterV3 converterV3 = new DataFileFooterConverterV3();
    for (org.apache.carbondata.format.BlockletIndex index : blockletIndex) {
        BlockletInfo3 blockletInfo3 = blockletMetadata.get(i);
        BlockletInfo blockletInfo = converterV3.getBlockletInfo(blockletInfo3, model.getSegmentProperties().getDimensions().size());
        BlockletBTreeIndex bTreeIndex = new BlockletBTreeIndex(index.b_tree_index.getStart_key(), index.b_tree_index.getEnd_key());
        BlockletMinMaxIndex minMaxIndex = new BlockletMinMaxIndex();
        minMaxIndex.setMinValues(toByteArray(index.getMin_max_index().getMin_values()));
        minMaxIndex.setMaxValues(toByteArray(index.getMin_max_index().getMax_values()));
        org.apache.carbondata.core.metadata.blocklet.index.BlockletIndex bIndex = new org.apache.carbondata.core.metadata.blocklet.index.BlockletIndex(bTreeIndex, minMaxIndex);
        BlockIndexInfo biInfo = new BlockIndexInfo(numberOfRows, carbonDataFileName, currentPosition, bIndex, blockletInfo);
        blockIndexInfoList.add(biInfo);
        i++;
    }
}
Also used : BlockletBTreeIndex(org.apache.carbondata.core.metadata.blocklet.index.BlockletBTreeIndex) BlockletInfo(org.apache.carbondata.core.metadata.blocklet.BlockletInfo) BlockletInfo3(org.apache.carbondata.format.BlockletInfo3) DataFileFooterConverterV3(org.apache.carbondata.core.util.DataFileFooterConverterV3) BlockletMinMaxIndex(org.apache.carbondata.core.metadata.blocklet.index.BlockletMinMaxIndex) BlockIndexInfo(org.apache.carbondata.core.metadata.index.BlockIndexInfo)

Aggregations

BlockletInfo (org.apache.carbondata.core.metadata.blocklet.BlockletInfo)1 BlockletBTreeIndex (org.apache.carbondata.core.metadata.blocklet.index.BlockletBTreeIndex)1 BlockletMinMaxIndex (org.apache.carbondata.core.metadata.blocklet.index.BlockletMinMaxIndex)1 BlockIndexInfo (org.apache.carbondata.core.metadata.index.BlockIndexInfo)1 DataFileFooterConverterV3 (org.apache.carbondata.core.util.DataFileFooterConverterV3)1 BlockletInfo3 (org.apache.carbondata.format.BlockletInfo3)1