private void setJobParents(MapReduceOper mro, Configuration conf) {
// PigStats maintains a job DAG with the job id being updated
// upon available. Therefore, before a job is submitted, the ids
// of its parent jobs are already available.
JobGraph jg = PigStats.get().getJobGraph();
JobStats js = null;
Iterator<JobStats> iter = jg.iterator();
while (iter.hasNext()) {
JobStats job = iter.next();
if (job.getName().equals(mro.getOperatorKey().toString())) {
js = job;
break;
}
}
if (js != null) {
List<Operator> preds = jg.getPredecessors(js);
if (preds != null) {
StringBuilder sb = new StringBuilder();
for (Operator op : preds) {
JobStats job = (JobStats)op;
if (sb.length() > 0) sb.append(",");