Search in sources :

Example 1 with NoRetryException

use of org.apache.carbondata.processing.loading.exception.NoRetryException in project carbondata by apache.

the class DataLoadExecutor method execute.

public void execute(CarbonLoadModel loadModel, String[] storeLocation, CarbonIterator<Object[]>[] inputIterators) throws Exception {
    try {
        loadProcessorStep = new DataLoadProcessBuilder().build(loadModel, storeLocation, inputIterators);
        // 1. initialize
        loadProcessorStep.initialize();
        LOGGER.info("Data Loading is started for table " + loadModel.getTableName());
        // 2. execute the step
        loadProcessorStep.execute();
        // check and remove any bad record key from bad record entry logger static map
        if (CarbonBadRecordUtil.hasBadRecord(loadModel)) {
            LOGGER.error("Data Load is partially success for table " + loadModel.getTableName());
        } else {
            LOGGER.info("Data loading is successful for table " + loadModel.getTableName());
        }
    } catch (CarbonDataLoadingException e) {
        if (e instanceof BadRecordFoundException) {
            throw new NoRetryException(e.getMessage());
        } else {
            throw e;
        }
    } catch (Exception e) {
        LOGGER.error(e, "Data Loading failed for table " + loadModel.getTableName());
        throw new CarbonDataLoadingException("Data Loading failed for table " + loadModel.getTableName(), e);
    }
}
Also used : CarbonDataLoadingException(org.apache.carbondata.processing.loading.exception.CarbonDataLoadingException) NoRetryException(org.apache.carbondata.processing.loading.exception.NoRetryException) CarbonDataLoadingException(org.apache.carbondata.processing.loading.exception.CarbonDataLoadingException) NoRetryException(org.apache.carbondata.processing.loading.exception.NoRetryException) BadRecordFoundException(org.apache.carbondata.processing.loading.exception.BadRecordFoundException) BadRecordFoundException(org.apache.carbondata.processing.loading.exception.BadRecordFoundException)

Aggregations

BadRecordFoundException (org.apache.carbondata.processing.loading.exception.BadRecordFoundException)1 CarbonDataLoadingException (org.apache.carbondata.processing.loading.exception.CarbonDataLoadingException)1 NoRetryException (org.apache.carbondata.processing.loading.exception.NoRetryException)1