Skip to content

Commit

Permalink
add loopcount
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingwang committed Sep 28, 2015
1 parent 06808ed commit 1f09f7f
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -89,8 +89,13 @@ public static Map<Integer, SubQueryPlan> instantiate(final List<PlanFragmentEnco
for (PlanFragmentEncoding fragment : fragments) {
instantiateFragmentOperators(fragment, args, allOperators);
}
while (setConsumerSchema(fragments, allOperators)) {
/* Do it iteratively until no new consumer has its schema to be set. */
int loopCount = 0;
while (setConsumerSchema(fragments, allOperators) && loopCount++ < allOperators.size()) {
/*
* Do it iteratively until no new consumer has its schema to be set. Add a loop count to prevent us from having an
* infinite loop (which should NOT happen). Since each iteration should set the schema of at least one consumer,
* setting the threshold to be the number of operators is enough.
*/
}
Map<Integer, SubQueryPlan> plan = Maps.newHashMap();
for (PlanFragmentEncoding fragment : fragments) {
Expand Down

0 comments on commit 1f09f7f

Please sign in to comment.