MCPcopy Create free account
hub / github.com/apache/pig / pathExists

Method pathExists

src/org/apache/pig/impl/plan/OperatorPlan.java:371–383  ·  view source on GitHub ↗

A method to check if there is a path from a given node to another node @param from the start node for checking @param to the end node for checking @return true if path exists, false otherwise

(E from, E to)

Source from the content-addressed store, hash-verified

369 * @return true if path exists, false otherwise
370 */
371 public boolean pathExists(E from, E to) {
372 List<E> successors = getSuccessors(from);
373 if(successors == null || successors.size() == 0) {
374 return false;
375 }
376 for (E successor : successors) {
377 if(successor.equals(to)
378 || pathExists(successor, to)) {
379 return true;
380 }
381 }
382 return false;
383 }
384
385 public Iterator<E> iterator() {
386 return mOps.keySet().iterator();

Callers

nothing calls this directly

Calls 3

getSuccessorsMethod · 0.95
sizeMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected