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));
}
}
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);
}
}
Aggregations