@CheckForNull public static TimingInfo computeChunkTiming(@Nonnull WorkflowRun run, long internalPauseDuration, @Nonnull MemoryFlowChunk chunk) { return computeChunkTiming(run, internalPauseDuration, chunk.getFirstNode(), chunk.getLastNode(), chunk.getNodeAfter()); }
@Nonnull /** Get statuses for each branch - note: some statuses may be null, API consumers MUST use {@link #coerceStatusApi(GenericStatus, StatusApiVersion)} on outputs * to safely handle addition of new statuses. */ public static Map<String, GenericStatus> computeBranchStatuses2(@Nonnull WorkflowRun run, @Nonnull ParallelMemoryFlowChunk parallel) { Map<String,MemoryFlowChunk> branches = parallel.getBranches(); List<BlockStartNode> starts = new ArrayList<BlockStartNode>(branches.size()); List<FlowNode> ends = new ArrayList<FlowNode>(branches.size()); // We can optimize this if needed by not fetching the LabelAction below for (MemoryFlowChunk chunk : branches.values()) { starts.add((BlockStartNode)chunk.getFirstNode()); ends.add(chunk.getLastNode()); } return computeBranchStatuses2(run, parallel.getFirstNode(), starts, ends, parallel.getLastNode()); }
/** * Return status or null if not executed all (null FlowExecution) * Note: API consumers MUST use {@link #coerceStatusApi(GenericStatus, StatusApiVersion)} on outputs * to safely handle addition of new statuses. * @param run * @param chunk * @return Status or null if not executed all (null FlowExecution) */ @CheckForNull public static GenericStatus computeChunkStatus2(@Nonnull WorkflowRun run, @Nonnull MemoryFlowChunk chunk) { FlowExecution exec = run.getExecution(); if (exec == null) { return null; } if (chunk instanceof ParallelMemoryFlowChunk) { ParallelMemoryFlowChunk par = ((ParallelMemoryFlowChunk) chunk); return condenseStatus(computeBranchStatuses2(run, par).values()); } else { return computeChunkStatus2(run, chunk.getNodeBefore(), chunk.getFirstNode(), chunk.getLastNode(), chunk.getNodeAfter()); } }