HanumathRao commented on a change in pull request #1677: DRILL-7068: Support 
memory adjustment framework for resource manageme…
URL: https://github.com/apache/drill/pull/1677#discussion_r263651109
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/fragment/MakeFragmentsVisitor.java
 ##########
 @@ -26,29 +26,27 @@
  * Responsible for breaking a plan into its constituent Fragments.
  */
 public class MakeFragmentsVisitor extends AbstractPhysicalVisitor<Fragment, 
Fragment, ForemanSetupException> {
-  static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(MakeFragmentsVisitor.class);
 
   public final static MakeFragmentsVisitor INSTANCE = new 
MakeFragmentsVisitor();
 
   private MakeFragmentsVisitor() {
   }
 
   @Override
-  public Fragment visitExchange(Exchange exchange, Fragment value) throws 
ForemanSetupException {
-//    logger.debug("Visiting Exchange {}", exchange);
-    if (value == null) {
-      throw new ForemanSetupException("The simple fragmenter was called 
without a FragmentBuilder value.  This will only happen if the initial call to 
SimpleFragmenter is by a Exchange node.  This should never happen since an 
Exchange node should never be the root node of a plan.");
+  public Fragment visitExchange(Exchange exchange, Fragment currentFragment) 
throws ForemanSetupException {
+    if (currentFragment == null) {
+      throw new ForemanSetupException("The simple fragmenter was called 
without a FragmentBuilder value. This will only happen if the initial call to 
SimpleFragmenter is by a" +
+        " Exchange node.  This should never happen since an Exchange node 
should never be the root node of a plan.");
     }
-    Fragment next = getNextBuilder();
-    value.addReceiveExchange(exchange, next);
-    next.addSendExchange(exchange, value);
-    exchange.getChild().accept(this, next);
-    return value;
+    Fragment childFragment = getFragmentBuilder();
+    currentFragment.addReceiveExchange(exchange, childFragment);
+    childFragment.addSendExchange(exchange, currentFragment);
 
 Review comment:
   It makes sense. Done.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to