if(processingPlan){
while(true) {
res = processPlan();
if(res.returnStatus==POStatus.STATUS_OK) {
if(lineageTracer != null && res.result != null) {
ExampleTuple tOut = new ExampleTuple((Tuple) res.result);
tOut.synthetic = tIn.synthetic;
lineageTracer.insert(tOut);
lineageTracer.union(tOut, tIn);
res.result = tOut;
}
return res;
}
if(res.returnStatus==POStatus.STATUS_EOP) {
processingPlan = false;
break;
}
if(res.returnStatus==POStatus.STATUS_ERR) {
return res;
}
if(res.returnStatus==POStatus.STATUS_NULL) {
continue;
}
}
}
//The nested plan processing is done or is
//yet to begin. So process the input and start
//nested plan processing on the input tuple
//read
while (true) {
inp = processInput();
if (inp.returnStatus == POStatus.STATUS_EOP ||
inp.returnStatus == POStatus.STATUS_ERR) {
return inp;
}
if (inp.returnStatus == POStatus.STATUS_NULL) {
continue;
}
attachInputToPlans((Tuple) inp.result);
for (PhysicalOperator po : opsToBeReset) {
po.reset();
}
res = processPlan();
processingPlan = true;
if(lineageTracer != null && res.result != null) {
//we check for res.result since that can also be null in the case of flatten
tIn = (ExampleTuple) inp.result;
ExampleTuple tOut = new ExampleTuple((Tuple) res.result);
tOut.synthetic = tIn.synthetic;
lineageTracer.insert(tOut);
lineageTracer.union(tOut, tIn);
res.result = tOut;
}