@Override public Set<Operation> getFieldLineageOperations() { return context.getFieldLineageOperations(); } }
@Override public Set<Operation> getFieldLineageOperations() { return context.getFieldLineageOperations(); } }
private boolean emitFieldLineage() { if (context.getFieldLineageOperations().isEmpty()) { // no operations to emit return false; } ProgramStatus status = context.getState().getStatus(); if (ProgramStatus.COMPLETED != status) { // MapReduce program failed, so field operations wont be emitted return false; } WorkflowProgramInfo workflowInfo = context.getWorkflowInfo(); return workflowInfo == null || !workflowInfo.fieldLineageConsolidationEnabled(); }
private boolean emitFieldLineage() { if (context.getFieldLineageOperations().isEmpty()) { // no operations to emit return false; } ProgramStatus status = context.getState().getStatus(); if (ProgramStatus.COMPLETED != status) { // MapReduce program failed, so field operations wont be emitted return false; } WorkflowProgramInfo workflowInfo = context.getWorkflowInfo(); return workflowInfo == null || !workflowInfo.fieldLineageConsolidationEnabled(); }
/** * Calls the destroy method of {@link ProgramLifecycle}. */ private void destroy() { TransactionControl defaultTxControl = context.getDefaultTxControl(); TransactionControl txControl = mapReduce instanceof ProgramLifecycle ? Transactions.getTransactionControl(defaultTxControl, MapReduce.class, mapReduce, "destroy") : defaultTxControl; context.destroyProgram(programLifecycle, txControl, false); if (emitFieldLineage()) { try { FieldLineageInfo info = new FieldLineageInfo(context.getFieldLineageOperations()); fieldLineageWriter.write(mapReduceRunId, info); } catch (Throwable t) { LOG.warn("Failed to emit the field lineage operations for MapReduce {}", mapReduceRunId, t); } } }
/** * Calls the destroy method of {@link ProgramLifecycle}. */ private void destroy() { TransactionControl defaultTxControl = context.getDefaultTxControl(); TransactionControl txControl = mapReduce instanceof ProgramLifecycle ? Transactions.getTransactionControl(defaultTxControl, MapReduce.class, mapReduce, "destroy") : defaultTxControl; context.destroyProgram(programLifecycle, txControl, false); if (emitFieldLineage()) { try { FieldLineageInfo info = new FieldLineageInfo(context.getFieldLineageOperations()); fieldLineageWriter.write(mapReduceRunId, info); } catch (Throwable t) { LOG.warn("Failed to emit the field lineage operations for MapReduce {}", mapReduceRunId, t); } } }