use of org.apache.carbondata.processing.store.CarbonDataFileAttributes in project carbondata by apache.
the class SecondaryIndexQueryResultProcessor method initDataHandler.
/**
* initialise carbon data writer instance
*/
private void initDataHandler() throws SecondaryIndexException {
String carbonStoreLocation = CarbonDataProcessorUtil.createCarbonStoreLocation(this.indexTable, segmentId);
CarbonFactDataHandlerModel carbonFactDataHandlerModel = CarbonFactDataHandlerModel.getCarbonFactDataHandlerModel(carbonLoadModel, indexTable, segmentProperties, indexTable.getTableName(), tempStoreLocation, carbonStoreLocation);
carbonFactDataHandlerModel.setSchemaUpdatedTimeStamp(indexTable.getTableLastUpdatedTime());
CarbonDataFileAttributes carbonDataFileAttributes = new CarbonDataFileAttributes(Integer.parseInt(carbonLoadModel.getTaskNo()), carbonLoadModel.getFactTimeStamp());
carbonFactDataHandlerModel.setCarbonDataFileAttributes(carbonDataFileAttributes);
dataHandler = CarbonFactHandlerFactory.createCarbonFactHandler(carbonFactDataHandlerModel);
try {
dataHandler.initialise();
} catch (CarbonDataWriterException e) {
this.sortDataRows.close();
LOGGER.error(e);
throw new SecondaryIndexException("Problem initialising data handler while creating secondary index: " + e.getMessage());
}
}
use of org.apache.carbondata.processing.store.CarbonDataFileAttributes in project carbondata by apache.
the class AbstractResultProcessor method setDataFileAttributesInModel.
protected void setDataFileAttributesInModel(CarbonLoadModel loadModel, CompactionType compactionType, CarbonTable carbonTable, CarbonFactDataHandlerModel carbonFactDataHandlerModel) {
CarbonDataFileAttributes carbonDataFileAttributes;
if (compactionType == CompactionType.IUD_UPDDEL_DELTA_COMPACTION) {
int taskNo = CarbonUpdateUtil.getLatestTaskIdForSegment(loadModel.getSegmentId(), CarbonStorePath.getCarbonTablePath(loadModel.getStorePath(), carbonTable.getCarbonTableIdentifier()));
// Increase the Task Index as in IUD_UPDDEL_DELTA_COMPACTION the new file will
// be written in same segment. So the TaskNo should be incremented by 1 from max val.
int index = taskNo + 1;
carbonDataFileAttributes = new CarbonDataFileAttributes(index, loadModel.getFactTimeStamp());
} else {
carbonDataFileAttributes = new CarbonDataFileAttributes(Integer.parseInt(loadModel.getTaskNo()), loadModel.getFactTimeStamp());
}
carbonFactDataHandlerModel.setCarbonDataFileAttributes(carbonDataFileAttributes);
}
use of org.apache.carbondata.processing.store.CarbonDataFileAttributes in project carbondata by apache.
the class AbstractResultProcessor method setDataFileAttributesInModel.
protected void setDataFileAttributesInModel(CarbonLoadModel loadModel, CompactionType compactionType, CarbonFactDataHandlerModel carbonFactDataHandlerModel) throws IOException {
CarbonDataFileAttributes carbonDataFileAttributes = new CarbonDataFileAttributes(loadModel.getTaskNo(), loadModel.getFactTimeStamp());
carbonFactDataHandlerModel.setCarbonDataFileAttributes(carbonDataFileAttributes);
}
Aggregations