public static void visitSimpleChunks(@Nonnull Collection<FlowNode> heads, @Nonnull SimpleChunkVisitor visitor, @Nonnull ChunkFinder finder) { ForkScanner scanner = new ForkScanner(); scanner.setup(heads); scanner.visitSimpleChunks(visitor, finder); }
/** Walk through flows */ public void visitSimpleChunks(@Nonnull SimpleChunkVisitor visitor, @Nonnull ChunkFinder finder) { FlowNode prev; if (this.currentParallelStart != null) { FlowNode last = findLastRunningNode(currentParallelHeads()); if (last != null) { visitor.parallelEnd(this.currentParallelStartNode, last, this); } } while(hasNext()) { prev = (myCurrent != myNext) ? myCurrent : null; FlowNode f = next(); fireVisitChunkCallbacks(myNext, myCurrent, prev, visitor, finder, this); fireVisitParallelCallbacks(myNext, myCurrent, prev, visitor, finder, this); } }
if (p == currentParallelStartNode || isParallelStart(p)) { FlowNode temp = hitParallelStart(); if (temp != null) { // Start node for current parallel block now that it is done nextType = NodeType.PARALLEL_START; if (isParallelEnd(current)) { BlockEndNode end = ((BlockEndNode) current); FlowNode possibleOutput = hitParallelEnd(end, parents, blackList); // possibleOutput can only be "p" nextType = getNodeType(p); if (!blackList.contains(p)) { return p; } else if (isParallelEnd(current)) { FlowNode possibleOutput = hitParallelEnd(end, parents, blackList); // What if output is block but other branches aren't? if (possibleOutput != null) { nextType = NodeType.PARALLEL_BRANCH_END;
headIds.add(f.getId()); parallelBlockStartStack = leastCommonAncestor(new LinkedHashSet<FlowNode>(heads)); assert parallelBlockStartStack.size() > 0; currentParallelStart = parallelBlockStartStack.pop(); NodeType tempType = getNodeType(myCurrent); if (tempType == NodeType.NORMAL) { nextType = NodeType.PARALLEL_BRANCH_END; myCurrent = f; myNext = f; if (isParallelEnd(f)) { nextType = NodeType.PARALLEL_END; } else if (isParallelStart(f)) { nextType = NodeType.PARALLEL_START; } else {
FlowExecution exec = run.getExecution(); String log = r.getLog(run); ForkScanner scanner = new ForkScanner(); List<FlowNode> filtered = scanner.filteredNodes(exec, new DescriptorMatchPredicate(BindingStep.DescriptorImpl.class)); filtered = scanner.filteredNodes(exec, new DescriptorMatchPredicate(EchoStep.DescriptorImpl.class)); for (FlowNode f : filtered) { act = f.getPersistentAction(ArgumentsActionImpl.class); List<FlowNode> allStepped = scanner.filteredNodes(run.getExecution().getCurrentHeads(), FlowScanningUtils.hasActionPredicate(ArgumentsActionImpl.class)); Assert.assertEquals(6, allStepped.size()); // One ArgumentsActionImpl per block or atomic step
if (f.getPersistentAction(ThreadNameAction.class) != null) { return NodeType.PARALLEL_BRANCH_START; } else if (isParallelStart(f)) { return NodeType.PARALLEL_START; } else { NodeType type = getNodeType(start); if (type == null) { return null;
Collection<FlowNode> checkHeads = convertToFastCheckable(heads); return convertForksToBlockStarts(parallelForks);
break; case PARALLEL_END: FlowNode n = scanner.getCurrentParallelStartNode(); if (n != null) { visitor.parallelEnd(n, current, scanner); break; case PARALLEL_BRANCH_END: FlowNode f = scanner.getCurrentParallelStartNode(); if (f != null) { visitor.parallelBranchEnd(f, current, scanner); case PARALLEL_BRANCH_START: FlowNode parallelStart = (scanner.nextType == NodeType.PARALLEL_START) ? next : scanner.getCurrentParallelStartNode(); if (scanner.headIds.contains(current.getId())) {
public static void visitSimpleChunks(@Nonnull Collection<FlowNode> heads, @Nonnull Collection<FlowNode> blacklist, @Nonnull SimpleChunkVisitor visitor, @Nonnull ChunkFinder finder) { ForkScanner scanner = new ForkScanner(); scanner.setup(heads, blacklist); scanner.visitSimpleChunks(visitor, finder); }