use of org.apache.carbondata.core.writer.CarbonIndexFileMergeWriter in project carbondata by apache.
the class MapredCarbonOutputCommitter method commitJob.
@Override
public void commitJob(JobContext jobContext) throws IOException {
try {
Configuration configuration = jobContext.getConfiguration();
CarbonLoadModel carbonLoadModel = MapredCarbonOutputFormat.getLoadModel(configuration);
ThreadLocalSessionInfo.unsetAll();
CarbonTable carbonTable = carbonLoadModel.getCarbonDataLoadSchema().getCarbonTable();
new CarbonIndexFileMergeWriter(carbonTable).mergeCarbonIndexFilesOfSegment(carbonLoadModel.getSegmentId(), carbonTable.getTablePath(), false, String.valueOf(carbonLoadModel.getFactTimeStamp()));
SegmentFileStore.writeSegmentFile(carbonLoadModel.getCarbonDataLoadSchema().getCarbonTable(), carbonLoadModel.getSegmentId(), String.valueOf(carbonLoadModel.getFactTimeStamp()));
CarbonTableOutputFormat.setLoadModel(configuration, carbonLoadModel);
carbonOutputCommitter.commitJob(jobContext);
} catch (Exception e) {
LOGGER.error(e);
throw e;
}
}
Aggregations