Search in sources :

Example 11 with CarbonFactDataHandlerModel

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);
    }
}
Also used : CarbonFactDataHandlerModel(org.apache.carbondata.processing.store.CarbonFactDataHandlerModel) CarbonDataWriterException(org.apache.carbondata.core.datastore.exception.CarbonDataWriterException) CarbonSortKeyAndGroupByException(org.apache.carbondata.processing.sort.exception.CarbonSortKeyAndGroupByException) CarbonDataWriterException(org.apache.carbondata.core.datastore.exception.CarbonDataWriterException) IOException(java.io.IOException)

Aggregations

CarbonFactDataHandlerModel (org.apache.carbondata.processing.store.CarbonFactDataHandlerModel)11 CarbonFactHandler (org.apache.carbondata.processing.store.CarbonFactHandler)7 IOException (java.io.IOException)5 Iterator (java.util.Iterator)4 CarbonTableIdentifier (org.apache.carbondata.core.metadata.CarbonTableIdentifier)3 CarbonDataLoadingException (org.apache.carbondata.processing.newflow.exception.CarbonDataLoadingException)3 CarbonDataWriterException (org.apache.carbondata.core.datastore.exception.CarbonDataWriterException)2 CarbonRowBatch (org.apache.carbondata.processing.newflow.row.CarbonRowBatch)2 CarbonDataWriterException (org.apache.carbondata.processing.store.writer.exception.CarbonDataWriterException)2 ExecutorService (java.util.concurrent.ExecutorService)1 Future (java.util.concurrent.Future)1 KeyGenException (org.apache.carbondata.core.keygenerator.KeyGenException)1 IndexWriterListener (org.apache.carbondata.processing.index.IndexWriterListener)1 BadRecordFoundException (org.apache.carbondata.processing.loading.exception.BadRecordFoundException)1 CarbonDataLoadingException (org.apache.carbondata.processing.loading.exception.CarbonDataLoadingException)1 CarbonRowBatch (org.apache.carbondata.processing.loading.row.CarbonRowBatch)1 CarbonSortKeyAndGroupByException (org.apache.carbondata.processing.sort.exception.CarbonSortKeyAndGroupByException)1 CarbonDataFileAttributes (org.apache.carbondata.processing.store.CarbonDataFileAttributes)1 SecondaryIndexException (org.apache.spark.sql.secondaryindex.exception.SecondaryIndexException)1