use of org.apache.gobblin.state.ConstructState in project incubator-gobblin by apache.
the class Task method addConstructsFinalStateToTaskState.
/**
* Get the final state of each construct used by this task and add it to the {@link org.apache.gobblin.runtime.TaskState}.
* @param extractor the {@link org.apache.gobblin.instrumented.extractor.InstrumentedExtractorBase} used by this task.
* @param converter the {@link org.apache.gobblin.converter.Converter} used by this task.
* @param rowChecker the {@link RowLevelPolicyChecker} used by this task.
*/
private void addConstructsFinalStateToTaskState(InstrumentedExtractorBase<?, ?> extractor, Converter<?, ?, ?, ?> converter, RowLevelPolicyChecker rowChecker) {
ConstructState constructState = new ConstructState();
if (extractor != null) {
constructState.addConstructState(Constructs.EXTRACTOR, new ConstructState(extractor.getFinalState()));
}
if (converter != null) {
constructState.addConstructState(Constructs.CONVERTER, new ConstructState(converter.getFinalState()));
}
if (rowChecker != null) {
constructState.addConstructState(Constructs.ROW_QUALITY_CHECKER, new ConstructState(rowChecker.getFinalState()));
}
int forkIdx = 0;
for (Optional<Fork> fork : this.forks.keySet()) {
constructState.addConstructState(Constructs.FORK_OPERATOR, new ConstructState(fork.get().getFinalState()), Integer.toString(forkIdx));
forkIdx++;
}
constructState.mergeIntoWorkUnitState(this.taskState);
}
use of org.apache.gobblin.state.ConstructState in project incubator-gobblin by apache.
the class FileAwareInputStreamDataWriter method getFinalState.
@Override
public State getFinalState() {
State state = new State();
if (this.actualProcessedCopyableFile.isPresent()) {
CopySource.serializeCopyEntity(state, this.actualProcessedCopyableFile.get());
}
ConstructState constructState = new ConstructState();
constructState.addOverwriteProperties(state);
return constructState;
}
Aggregations