use of org.apache.carbondata.processing.store.CarbonFactDataHandlerModel in project carbondata by apache.
the class CompactionResultSortProcessor method initDataHandler.
/**
* initialise carbon data writer instance
*/
private void initDataHandler() throws Exception {
String carbonStoreLocation;
if (partitionSpec != null) {
carbonStoreLocation = partitionSpec.getLocation().toString() + CarbonCommonConstants.FILE_SEPARATOR + carbonLoadModel.getFactTimeStamp() + ".tmp";
} else {
carbonStoreLocation = CarbonDataProcessorUtil.createCarbonStoreLocation(carbonLoadModel.getCarbonDataLoadSchema().getCarbonTable(), carbonLoadModel.getSegmentId());
}
CarbonFactDataHandlerModel carbonFactDataHandlerModel = CarbonFactDataHandlerModel.getCarbonFactDataHandlerModel(carbonLoadModel, carbonTable, segmentProperties, tableName, tempStoreLocation, carbonStoreLocation);
carbonFactDataHandlerModel.setSegmentId(carbonLoadModel.getSegmentId());
carbonFactDataHandlerModel.setBucketId(carbonLoadModel.getBucketId());
setDataFileAttributesInModel(carbonLoadModel, compactionType, carbonFactDataHandlerModel);
this.noDicAndComplexColumns = carbonFactDataHandlerModel.getNoDictAndComplexColumns();
dataHandler = CarbonFactHandlerFactory.createCarbonFactHandler(carbonFactDataHandlerModel);
try {
dataHandler.initialise();
} catch (CarbonDataWriterException e) {
LOGGER.error(e.getMessage(), e);
throw new Exception("Problem initialising data handler during compaction: " + e.getMessage(), e);
}
}
Aggregations