@Override public void error(Throwable cause) { Closeables.closeQuietly(closeable); nodeStates.put(nodeId, new WorkflowNodeState(nodeId, NodeStatus.FAILED, controller.getRunId().getId(), cause)); completion.setException(cause); } }, Threads.SAME_THREAD_EXECUTOR);
@Override public void error(Throwable cause) { Closeables.closeQuietly(closeable); nodeStates.put(nodeId, new WorkflowNodeState(nodeId, NodeStatus.FAILED, controller.getRunId().getId(), cause)); completion.setException(cause); } }, Threads.SAME_THREAD_EXECUTOR);
private void add(RuntimeInfo runtimeInfo) { Lock lock = runtimeInfosLock.writeLock(); lock.lock(); try { runtimeInfos.put(runtimeInfo.getType(), runtimeInfo.getController().getRunId(), runtimeInfo); } finally { lock.unlock(); } }
private void add(RuntimeInfo runtimeInfo) { Lock lock = runtimeInfosLock.writeLock(); lock.lock(); try { runtimeInfos.put(runtimeInfo.getType(), runtimeInfo.getController().getRunId(), runtimeInfo); } finally { lock.unlock(); } }
@Override public void killed() { Closeables.closeQuietly(closeable); nodeStates.put(nodeId, new WorkflowNodeState(nodeId, NodeStatus.KILLED, controller.getRunId().getId(), null)); completion.set(null); }
@Override public void killed() { Closeables.closeQuietly(closeable); nodeStates.put(nodeId, new WorkflowNodeState(nodeId, NodeStatus.KILLED, controller.getRunId().getId(), null)); completion.set(null); }
@Override public void completed() { Closeables.closeQuietly(closeable); Set<Operation> fieldLineageOperations = new HashSet<>(); if (controller instanceof WorkflowDataProvider) { fieldLineageOperations.addAll(((WorkflowDataProvider) controller).getFieldLineageOperations()); } nodeStates.put(nodeId, new WorkflowNodeState(nodeId, NodeStatus.COMPLETED, fieldLineageOperations, controller.getRunId().getId(), null)); completion.set(null); }
@Override public void completed() { Closeables.closeQuietly(closeable); Set<Operation> fieldLineageOperations = new HashSet<>(); if (controller instanceof WorkflowDataProvider) { fieldLineageOperations.addAll(((WorkflowDataProvider) controller).getFieldLineageOperations()); } nodeStates.put(nodeId, new WorkflowNodeState(nodeId, NodeStatus.COMPLETED, fieldLineageOperations, controller.getRunId().getId(), null)); completion.set(null); }
@Override public void killed() { programStateWriter.killed(programId.run(controller.getRunId())); } }, MoreExecutors.sameThreadExecutor());
@Override public void killed() { programStateWriter.killed(programId.run(controller.getRunId())); } }, MoreExecutors.sameThreadExecutor());
private void remove(RuntimeInfo info, Runnable cleanUpTask) { Lock lock = runtimeInfosLock.writeLock(); lock.lock(); try { LOG.debug("Removing RuntimeInfo: {} {} {}", info.getType(), info.getProgramId().getProgram(), info.getController().getRunId()); RuntimeInfo removed = runtimeInfos.remove(info.getType(), info.getController().getRunId()); LOG.debug("RuntimeInfo removed: {}", removed); } finally { lock.unlock(); cleanUpTask.run(); } }
private void remove(RuntimeInfo info, Runnable cleanUpTask) { Lock lock = runtimeInfosLock.writeLock(); lock.lock(); try { LOG.debug("Removing RuntimeInfo: {} {} {}", info.getType(), info.getProgramId().getProgram(), info.getController().getRunId()); RuntimeInfo removed = runtimeInfos.remove(info.getType(), info.getController().getRunId()); LOG.debug("RuntimeInfo removed: {}", removed); } finally { lock.unlock(); cleanUpTask.run(); } }