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

Method moveTree

src/org/apache/pig/newplan/BaseOperatorPlan.java:491–511  ·  view source on GitHub ↗

Move everything below a given operator to the new operator plan. The specified operator will be moved and will be the root of the new operator plan @param root Operator to move everything after @param newPlan new operator plan to move things into @throws PlanException

(Operator root, BaseOperatorPlan newPlan)

Source from the content-addressed store, hash-verified

489 * @throws PlanException
490 */
491 public void moveTree(Operator root, BaseOperatorPlan newPlan) throws FrontendException {
492 Deque<Operator> queue = new ArrayDeque<Operator>();
493 newPlan.add(root);
494 root.setPlan(newPlan);
495 queue.addLast(root);
496 while (!queue.isEmpty()) {
497 Operator node = queue.poll();
498 if (getSuccessors(node)!=null) {
499 for (Operator succ : getSuccessors(node)) {
500 if (!queue.contains(succ)) {
501 queue.addLast(succ);
502 newPlan.add(succ);
503 succ.setPlan(newPlan);
504 newPlan.connect(node, succ);
505 }
506 }
507 }
508 }
509
510 trimBelow(root);
511 }
512
513 /**
514 * Trim everything below a given operator. The specified operator will

Callers 1

executeMethod · 0.45

Calls 7

getSuccessorsMethod · 0.95
trimBelowMethod · 0.95
addMethod · 0.65
connectMethod · 0.65
setPlanMethod · 0.45
isEmptyMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected