Search in sources :

Example 1 with PipeTransformDetail

use of co.cask.cdap.etl.batch.PipeTransformDetail in project cdap by caskdata.

the class PipeTransformExecutor method runOneIteration.

public void runOneIteration(IN input) {
    for (String stageName : startingPoints) {
        PipeTransformDetail transformDetail = transformDetailMap.get(stageName);
        transformDetail.process(new KeyValue<String, Object>(stageName, input));
    }
}
Also used : PipeTransformDetail(co.cask.cdap.etl.batch.PipeTransformDetail)

Example 2 with PipeTransformDetail

use of co.cask.cdap.etl.batch.PipeTransformDetail in project cdap by caskdata.

the class TransformEmitter method emitError.

@Override
public void emitError(InvalidEntry<Object> invalidEntry) {
    if (shouldLogErrorWarning && errorConsumers.isEmpty() && errorOutputWriter == null) {
        shouldLogErrorWarning = false;
        LOG.warn("Stage {} emits error records, but has no error consumer. Error records will be dropped.", stageName);
        return;
    }
    for (PipeTransformDetail pipeTransformDetail : errorConsumers.values()) {
        ErrorRecord errorRecord = new BasicErrorRecord<>(invalidEntry.getInvalidRecord(), stageName, invalidEntry.getErrorCode(), invalidEntry.getErrorMsg());
        pipeTransformDetail.process(new KeyValue<>(stageName, (Object) errorRecord));
    }
    try {
        if (errorOutputWriter != null) {
            errorOutputWriter.write(invalidEntry);
        }
    } catch (Exception e) {
        Throwables.propagateIfPossible(e);
        throw new RuntimeException(e);
    }
}
Also used : PipeTransformDetail(co.cask.cdap.etl.batch.PipeTransformDetail) BasicErrorRecord(co.cask.cdap.etl.common.BasicErrorRecord) ErrorRecord(co.cask.cdap.etl.api.ErrorRecord) BasicErrorRecord(co.cask.cdap.etl.common.BasicErrorRecord)

Aggregations

PipeTransformDetail (co.cask.cdap.etl.batch.PipeTransformDetail)2 ErrorRecord (co.cask.cdap.etl.api.ErrorRecord)1 BasicErrorRecord (co.cask.cdap.etl.common.BasicErrorRecord)1