use of org.apache.carbondata.core.writer.CarbonFooterWriter in project carbondata by apache.
the class CarbonFactDataWriterImplV2 method writeBlockletInfoToFile.
/**
* This method will write metadata at the end of file file format in thrift format
*/
protected void writeBlockletInfoToFile(FileChannel channel, String filePath) throws CarbonDataWriterException {
try {
// get the current file position
long currentPosition = channel.size();
CarbonFooterWriter writer = new CarbonFooterWriter(filePath);
// get thrift file footer instance
FileFooter convertFileMeta = CarbonMetadataUtil.convertFilterFooter2(blockletInfoList, localCardinality, thriftColumnSchemaList, dataChunksOffsets, dataChunksLength);
// fill the carbon index details
fillBlockIndexInfoDetails(convertFileMeta.getNum_rows(), carbonDataFileName, currentPosition);
// write the footer
writer.writeFooter(convertFileMeta, currentPosition);
} catch (IOException e) {
throw new CarbonDataWriterException("Problem while writing the carbon file: ", e);
}
}
use of org.apache.carbondata.core.writer.CarbonFooterWriter in project carbondata by apache.
the class CarbonFactDataWriterImplV1 method writeBlockletInfoToFile.
/**
* This method will write metadata at the end of file file format in thrift format
*/
protected void writeBlockletInfoToFile(FileChannel channel, String filePath) throws CarbonDataWriterException {
try {
long currentPosition = channel.size();
CarbonFooterWriter writer = new CarbonFooterWriter(filePath);
FileFooter convertFileMeta = CarbonMetadataUtil.convertFileFooter(blockletInfoList, localCardinality.length, localCardinality, thriftColumnSchemaList, dataWriterVo.getSegmentProperties());
fillBlockIndexInfoDetails(convertFileMeta.getNum_rows(), carbonDataFileName, currentPosition);
writer.writeFooter(convertFileMeta, currentPosition);
} catch (IOException e) {
throw new CarbonDataWriterException("Problem while writing the carbon file: ", e);
}
}
Aggregations