List<PhysicalOperator> ls = mr.reducePlan.getLeaves();
for(PhysicalOperator op: ls) {
scan(mr, op, fs.getFileName());
}
} catch (PlanException e) {
throw new VisitorException(e);
}
// Second, replace the loader in our successor with whatever the originally used loader was.
fs = new FileSpec(predFs.getFileName(), predFs.getFuncSpec());
newLoad = new POLoad(succLoad.getOperatorKey(), succLoad.getRequestedParallelism(), fs);
newLoad.setSignature(predLoad.getSignature());
try {
succ.mapPlan.replace(succLoad, newLoad);
// Add the loader's funcspec to the list of udf's associated with this mr operator
succ.UDFs.add(newLoad.getLFile().getFuncSpec().toString());
} catch (PlanException e) {
throw new VisitorException(e);
}
// Cannot delete the pred right now, because we are still traversing the graph. So, mark the pred and remove it from the
// plan once the visit by this optimizer is complete.
opsToRemove.add(pred);