/** * {@inheritDoc} * @param heads Nodes to start iterating backward from by visiting their parents. <strong>Do not pass multiple heads.</strong> */ @Override public List<FlowNode> filteredNodes(Collection<FlowNode> heads, Collection<FlowNode> blackList, Predicate<FlowNode> matchCondition) { return super.filteredNodes(heads, blackList, matchCondition); }
/** * {@inheritDoc} * @param heads Head nodes to start walking from. <strong>Do not pass multiple heads.</strong> */ @Override public FlowNode findFirstMatch(Collection<FlowNode> heads, Collection<FlowNode> blackListNodes, Predicate<FlowNode> matchCondition) { return super.findFirstMatch(heads, blackListNodes, matchCondition); }
@Override public FlowNode next() { currentType = nextType; FlowNode output = super.next(); return output; }
/** 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); } }
protected void resetChunk(@Nonnull MemoryFlowChunk chunk) { chunk.setFirstNode(null); chunk.setLastNode(null); chunk.setNodeBefore(null); chunk.setNodeAfter(null); chunk.setPauseTimeMillis(0); }
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); }
@Override public void chunkStart(@Nonnull FlowNode startNode, @CheckForNull FlowNode beforeBlock, @Nonnull ForkScanner scanner) { chunk.setNodeBefore(beforeBlock); chunk.setFirstNode(startNode); handleChunkDone(chunk); resetChunk(chunk); }
/** * {@inheritDoc} * @deprecated prefer {@link #setup(FlowNode)} */ @Deprecated @Override public boolean setup(Collection<FlowNode> heads) { return super.setup(heads); }
/** * {@inheritDoc} * @param heads <strong>Do not pass multiple heads.</strong> */ @Override public void visitAll(Collection<FlowNode> heads, FlowNodeVisitor visitor) { super.visitAll(heads, visitor); }
public FilteratorImpl<T> filter(Predicate<T> matchCondition) { return new FilteratorImpl<T>(this, matchCondition); }
@Override public boolean setup(@CheckForNull Collection<FlowNode> heads, @CheckForNull Collection<FlowNode> blackList) { boolean possiblyStartable = super.setup(heads, blackList); return possiblyStartable && myCurrent != null; // In case we start at an end block }
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); }
/** * {@inheritDoc} * @deprecated prefer {@link #findFirstMatch(FlowNode, Predicate)} */ @Deprecated @Override public FlowNode findFirstMatch(Collection<FlowNode> heads, Predicate<FlowNode> matchPredicate) { return super.findFirstMatch(heads, matchPredicate); }
/** * Helper: version of {@link #setup(Collection, Collection)} where we don't have any nodes to blacklist */ public boolean setup(@CheckForNull Collection<FlowNode> heads) { if (heads == null) { return false; } return setup(heads, Collections.EMPTY_SET); }
/** * {@inheritDoc} * @deprecated prefer {@link #filteredNodes(FlowNode, Predicate)} */ @Deprecated @Override public List<FlowNode> filteredNodes(Collection<FlowNode> heads, Predicate<FlowNode> matchPredicate) { return super.filteredNodes(heads, matchPredicate); }
@Override public FlowNode next() { if (myNext == null) { throw new NoSuchElementException(); } myCurrent = myNext; myNext = next(myCurrent, myBlackList); return myCurrent; }
/** * {@inheritDoc} * @param heads Nodes to start walking the DAG backwards from. <strong>Do not pass multiple heads.</strong> */ @Override public void visitAll(Collection<FlowNode> heads, Collection<FlowNode> blackList, FlowNodeVisitor visitor) { super.visitAll(heads, blackList, visitor); }
/** * Expose a filtered view of this FlowScanner's output. * @param filterCondition Filterator only returns {@link FlowNode}s matching this predicate. * @return A {@link Filterator} against this FlowScanner, which can be filtered in additional ways. */ @Override @Nonnull public Filterator<FlowNode> filter(@Nonnull Predicate<FlowNode> filterCondition) { return new FilteratorImpl<FlowNode>(this, filterCondition); }
/** * {@inheritDoc} * @deprecated unsafe to call */ @Deprecated @Override public FlowNode findFirstMatch(FlowExecution exec, Predicate<FlowNode> matchPredicate) { return super.findFirstMatch(exec, matchPredicate); }
/** * {@inheritDoc} * @deprecated prefer {@link #setup(FlowNode, Collection)} */ @Deprecated @Override public boolean setup(Collection<FlowNode> heads, Collection<FlowNode> blackList) { return super.setup(heads, blackList); }