use of org.apache.carbondata.processing.constants.LoggerAction in project carbondata by apache.
the class DataConverterProcessorStepImpl method createBadRecordLogger.
private BadRecordsLogger createBadRecordLogger() {
boolean badRecordsLogRedirect = false;
boolean badRecordConvertNullDisable = false;
boolean isDataLoadFail = false;
boolean badRecordsLoggerEnable = Boolean.parseBoolean(configuration.getDataLoadProperty(DataLoadProcessorConstants.BAD_RECORDS_LOGGER_ENABLE).toString());
Object bad_records_action = configuration.getDataLoadProperty(DataLoadProcessorConstants.BAD_RECORDS_LOGGER_ACTION).toString();
if (null != bad_records_action) {
LoggerAction loggerAction = null;
try {
loggerAction = LoggerAction.valueOf(bad_records_action.toString().toUpperCase());
} catch (IllegalArgumentException e) {
loggerAction = LoggerAction.FORCE;
}
switch(loggerAction) {
case FORCE:
badRecordConvertNullDisable = false;
break;
case REDIRECT:
badRecordsLogRedirect = true;
badRecordConvertNullDisable = true;
break;
case IGNORE:
badRecordsLogRedirect = false;
badRecordConvertNullDisable = true;
break;
case FAIL:
isDataLoadFail = true;
break;
}
}
CarbonTableIdentifier identifier = configuration.getTableIdentifier().getCarbonTableIdentifier();
return new BadRecordsLogger(identifier.getBadRecordLoggerKey(), identifier.getTableName() + '_' + System.currentTimeMillis(), getBadLogStoreLocation(identifier.getDatabaseName() + CarbonCommonConstants.FILE_SEPARATOR + identifier.getTableName() + CarbonCommonConstants.FILE_SEPARATOR + configuration.getSegmentId() + CarbonCommonConstants.FILE_SEPARATOR + configuration.getTaskNo()), badRecordsLogRedirect, badRecordsLoggerEnable, badRecordConvertNullDisable, isDataLoadFail);
}
use of org.apache.carbondata.processing.constants.LoggerAction in project carbondata by apache.
the class DataConverterProcessorWithBucketingStepImpl method createBadRecordLogger.
private BadRecordsLogger createBadRecordLogger() {
boolean badRecordsLogRedirect = false;
boolean badRecordConvertNullDisable = false;
boolean isDataLoadFail = false;
boolean badRecordsLoggerEnable = Boolean.parseBoolean(configuration.getDataLoadProperty(DataLoadProcessorConstants.BAD_RECORDS_LOGGER_ENABLE).toString());
Object bad_records_action = configuration.getDataLoadProperty(DataLoadProcessorConstants.BAD_RECORDS_LOGGER_ACTION).toString();
if (null != bad_records_action) {
LoggerAction loggerAction = null;
try {
loggerAction = LoggerAction.valueOf(bad_records_action.toString().toUpperCase());
} catch (IllegalArgumentException e) {
loggerAction = LoggerAction.FORCE;
}
switch(loggerAction) {
case FORCE:
badRecordConvertNullDisable = false;
break;
case REDIRECT:
badRecordsLogRedirect = true;
badRecordConvertNullDisable = true;
break;
case IGNORE:
badRecordsLogRedirect = false;
badRecordConvertNullDisable = true;
break;
case FAIL:
isDataLoadFail = true;
break;
}
}
CarbonTableIdentifier identifier = configuration.getTableIdentifier().getCarbonTableIdentifier();
return new BadRecordsLogger(identifier.getBadRecordLoggerKey(), identifier.getTableName() + '_' + System.currentTimeMillis(), getBadLogStoreLocation(identifier.getDatabaseName() + CarbonCommonConstants.FILE_SEPARATOR + identifier.getTableName() + CarbonCommonConstants.FILE_SEPARATOR + configuration.getSegmentId() + CarbonCommonConstants.FILE_SEPARATOR + configuration.getTaskNo()), badRecordsLogRedirect, badRecordsLoggerEnable, badRecordConvertNullDisable, isDataLoadFail);
}
Aggregations