Search in sources :

Example 1 with CarbonDataFileAttributes

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());
    }
}
Also used : CarbonDataFileAttributes(org.apache.carbondata.processing.store.CarbonDataFileAttributes) CarbonFactDataHandlerModel(org.apache.carbondata.processing.store.CarbonFactDataHandlerModel) SecondaryIndexException(org.apache.spark.sql.secondaryindex.exception.SecondaryIndexException) CarbonDataWriterException(org.apache.carbondata.core.datastore.exception.CarbonDataWriterException)

Example 2 with 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, 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);
}
Also used : CarbonDataFileAttributes(org.apache.carbondata.processing.store.CarbonDataFileAttributes)

Example 3 with 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);
}
Also used : CarbonDataFileAttributes(org.apache.carbondata.processing.store.CarbonDataFileAttributes)

Aggregations

CarbonDataFileAttributes (org.apache.carbondata.processing.store.CarbonDataFileAttributes)3 CarbonDataWriterException (org.apache.carbondata.core.datastore.exception.CarbonDataWriterException)1 CarbonFactDataHandlerModel (org.apache.carbondata.processing.store.CarbonFactDataHandlerModel)1 SecondaryIndexException (org.apache.spark.sql.secondaryindex.exception.SecondaryIndexException)1