Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5FC69200CF3 for ; Wed, 30 Aug 2017 02:58:58 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5E89C167F09; Wed, 30 Aug 2017 00:58:58 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A6760167F08 for ; Wed, 30 Aug 2017 02:58:57 +0200 (CEST) Received: (qmail 64227 invoked by uid 500); 30 Aug 2017 00:58:56 -0000 Mailing-List: contact dev-help@drill.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@drill.apache.org Delivered-To: mailing list dev@drill.apache.org Received: (qmail 64216 invoked by uid 99); 30 Aug 2017 00:58:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Aug 2017 00:58:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 5663FF16B2; Wed, 30 Aug 2017 00:58:56 +0000 (UTC) From: sohami To: dev@drill.apache.org Reply-To: dev@drill.apache.org References: In-Reply-To: Subject: [GitHub] drill pull request #919: DRILL-5721: Query with only root fragment and no no... Content-Type: text/plain Message-Id: <20170830005856.5663FF16B2@git1-us-west.apache.org> Date: Wed, 30 Aug 2017 00:58:56 +0000 (UTC) archived-at: Wed, 30 Aug 2017 00:58:58 -0000 Github user sohami commented on a diff in the pull request: https://github.com/apache/drill/pull/919#discussion_r135948567 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java --- @@ -1073,26 +1070,22 @@ public QueryId getQueryId() { */ private void setupRootFragment(final PlanFragment rootFragment, final FragmentRoot rootOperator) throws ExecutionSetupException { - @SuppressWarnings("resource") final FragmentContext rootContext = new FragmentContext(drillbitContext, rootFragment, queryContext, initiatingClient, drillbitContext.getFunctionImplementationRegistry()); - @SuppressWarnings("resource") - final IncomingBuffers buffers = new IncomingBuffers(rootFragment, rootContext); - rootContext.setBuffers(buffers); - - queryManager.addFragmentStatusTracker(rootFragment, true); - final ControlTunnel tunnel = drillbitContext.getController().getTunnel(queryContext.getCurrentEndpoint()); + final FragmentStatusReporter statusReporter = new FragmentStatusReporter(rootContext, tunnel); final FragmentExecutor rootRunner = new FragmentExecutor(rootContext, rootFragment, - new FragmentStatusReporter(rootContext, tunnel), - rootOperator); - final RootFragmentManager fragmentManager = new RootFragmentManager(rootFragment.getHandle(), buffers, rootRunner); + statusReporter, rootOperator); - if (buffers.isDone()) { + queryManager.addFragmentStatusTracker(rootFragment, true); + + // FragmentManager is setting buffer for FragmentContext + if (rootContext.isBuffersDone()) { --- End diff -- Inside AbstractFragmentManager constructor, since that's where the Incoming Buffers are created. https://github.com/apache/drill/pull/919/files#diff-d7418a1fd07314f268049ae9f07b7ed3 ``` + public AbstractFragmentManager(final PlanFragment fragment, final FragmentExecutor executor, final FragmentStatusReporter statusReporter, final FragmentRoot rootOperator) { + this.fragmentHandle = fragment.getHandle(); + this.fragmentContext = executor.getContext(); + this.buffers = new IncomingBuffers(fragment, fragmentContext); + this.fragmentContext.setBuffers(buffers); ``` --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---