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 1053D200B7A for ; Sun, 21 Aug 2016 18:38:48 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0F087160A8E; Sun, 21 Aug 2016 16:38:48 +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 2F02D160AAA for ; Sun, 21 Aug 2016 18:38:47 +0200 (CEST) Received: (qmail 69443 invoked by uid 500); 21 Aug 2016 16:38:46 -0000 Mailing-List: contact commits-help@quickstep.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@quickstep.incubator.apache.org Delivered-To: mailing list commits@quickstep.incubator.apache.org Received: (qmail 69431 invoked by uid 99); 21 Aug 2016 16:38:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Aug 2016 16:38:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id E4736C093A for ; Sun, 21 Aug 2016 16:38:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.739 X-Spam-Level: X-Spam-Status: No, score=-3.739 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.519] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id v9-GgJv8VzBg for ; Sun, 21 Aug 2016 16:38:45 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id CFFAA5F5A2 for ; Sun, 21 Aug 2016 16:38:43 +0000 (UTC) Received: (qmail 68915 invoked by uid 99); 21 Aug 2016 16:38:42 -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; Sun, 21 Aug 2016 16:38:42 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6FDB3E08AB; Sun, 21 Aug 2016 16:38:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hbdeshmukh@apache.org To: commits@quickstep.incubator.apache.org Date: Sun, 21 Aug 2016 16:38:44 -0000 Message-Id: <57f76947a0ed4d6eb2806677bf376a94@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [3/3] incubator-quickstep git commit: DAG support for destroy aggregation state op. archived-at: Sun, 21 Aug 2016 16:38:48 -0000 DAG support for destroy aggregation state op. Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/b7bc9f4a Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/b7bc9f4a Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/b7bc9f4a Branch: refs/heads/partitioned-aggregation Commit: b7bc9f4a28c0c3c5155dda9b534fe39da43a4d52 Parents: f543784 Author: Harshad Deshmukh Authored: Sun Aug 21 11:38:11 2016 -0500 Committer: Harshad Deshmukh Committed: Sun Aug 21 11:38:11 2016 -0500 ---------------------------------------------------------------------- query_optimizer/CMakeLists.txt | 1 + query_optimizer/ExecutionGenerator.cpp | 10 ++++++++ relational_operators/CMakeLists.txt | 1 + .../tests/AggregationOperator_unittest.cpp | 25 ++++++++++++++++++++ 4 files changed, 37 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/b7bc9f4a/query_optimizer/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/query_optimizer/CMakeLists.txt b/query_optimizer/CMakeLists.txt index a56b714..bd922d0 100644 --- a/query_optimizer/CMakeLists.txt +++ b/query_optimizer/CMakeLists.txt @@ -118,6 +118,7 @@ target_link_libraries(quickstep_queryoptimizer_ExecutionGenerator quickstep_relationaloperators_CreateIndexOperator quickstep_relationaloperators_CreateTableOperator quickstep_relationaloperators_DeleteOperator + quickstep_relationaloperators_DestroyAggregationStateOperator quickstep_relationaloperators_DestroyHashOperator quickstep_relationaloperators_DropTableOperator quickstep_relationaloperators_FinalizeAggregationOperator http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/b7bc9f4a/query_optimizer/ExecutionGenerator.cpp ---------------------------------------------------------------------- diff --git a/query_optimizer/ExecutionGenerator.cpp b/query_optimizer/ExecutionGenerator.cpp index 88103df..6abef2d 100644 --- a/query_optimizer/ExecutionGenerator.cpp +++ b/query_optimizer/ExecutionGenerator.cpp @@ -92,6 +92,7 @@ #include "relational_operators/CreateIndexOperator.hpp" #include "relational_operators/CreateTableOperator.hpp" #include "relational_operators/DeleteOperator.hpp" +#include "relational_operators/DestroyAggregationStateOperator.hpp" #include "relational_operators/DestroyHashOperator.hpp" #include "relational_operators/DropTableOperator.hpp" #include "relational_operators/FinalizeAggregationOperator.hpp" @@ -1478,6 +1479,15 @@ void ExecutionGenerator::convertAggregate( std::forward_as_tuple(finalize_aggregation_operator_index, output_relation)); temporary_relation_info_vec_.emplace_back(finalize_aggregation_operator_index, output_relation); + + const QueryPlan::DAGNodeIndex destroy_aggregation_state_operator_index = + execution_plan_->addRelationalOperator( + new DestroyAggregationStateOperator(query_handle_->query_id(), + aggr_state_index)); + + execution_plan_->addDirectDependency(destroy_aggregation_state_operator_index, + finalize_aggregation_operator_index, + true); } void ExecutionGenerator::convertSort(const P::SortPtr &physical_sort) { http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/b7bc9f4a/relational_operators/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/relational_operators/CMakeLists.txt b/relational_operators/CMakeLists.txt index 0cbb5c7..4b3ac84 100644 --- a/relational_operators/CMakeLists.txt +++ b/relational_operators/CMakeLists.txt @@ -545,6 +545,7 @@ target_link_libraries(AggregationOperator_unittest quickstep_queryexecution_QueryExecutionTypedefs quickstep_queryexecution_WorkOrdersContainer quickstep_relationaloperators_AggregationOperator + quickstep_relationaloperators_DestroyAggregationStateOperator quickstep_relationaloperators_FinalizeAggregationOperator quickstep_relationaloperators_WorkOrder quickstep_storage_AggregationOperationState_proto http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/b7bc9f4a/relational_operators/tests/AggregationOperator_unittest.cpp ---------------------------------------------------------------------- diff --git a/relational_operators/tests/AggregationOperator_unittest.cpp b/relational_operators/tests/AggregationOperator_unittest.cpp index fd4692a..0d5d8f5 100644 --- a/relational_operators/tests/AggregationOperator_unittest.cpp +++ b/relational_operators/tests/AggregationOperator_unittest.cpp @@ -42,6 +42,7 @@ #include "query_execution/QueryExecutionTypedefs.hpp" #include "query_execution/WorkOrdersContainer.hpp" #include "relational_operators/AggregationOperator.hpp" +#include "relational_operators/DestroyAggregationStateOperator.hpp" #include "relational_operators/FinalizeAggregationOperator.hpp" #include "relational_operators/WorkOrder.hpp" #include "storage/AggregationOperationState.pb.h" @@ -290,6 +291,9 @@ class AggregationOperatorTest : public ::testing::Test { *result_table_, insert_destination_index)); + destroy_aggr_state_op_.reset( + new DestroyAggregationStateOperator(kQueryId, aggr_state_index)); + // Set up the QueryContext. query_context_.reset(new QueryContext(query_context_proto, *db_, @@ -302,6 +306,7 @@ class AggregationOperatorTest : public ::testing::Test { // class' checks about operator index are successful. op_->setOperatorIndex(kOpIndex); finalize_op_->setOperatorIndex(kOpIndex); + destroy_aggr_state_op_->setOperatorIndex(kOpIndex); } void setupTestGroupBy(const std::string &stem, @@ -377,6 +382,9 @@ class AggregationOperatorTest : public ::testing::Test { *result_table_, insert_destination_index)); + destroy_aggr_state_op_.reset( + new DestroyAggregationStateOperator(kQueryId, aggr_state_index)); + // Set up the QueryContext. query_context_.reset(new QueryContext(query_context_proto, *db_, @@ -389,6 +397,7 @@ class AggregationOperatorTest : public ::testing::Test { // class' checks about operator index are successful. op_->setOperatorIndex(kOpIndex); finalize_op_->setOperatorIndex(kOpIndex); + destroy_aggr_state_op_->setOperatorIndex(kOpIndex); } void execute() { @@ -421,6 +430,21 @@ class AggregationOperatorTest : public ::testing::Test { work_order->execute(); delete work_order; } + + destroy_aggr_state_op_->informAllBlockingDependenciesMet(); + + WorkOrdersContainer destroy_aggr_state_op_container(1, 0); + const std::size_t destroy_aggr_state_op_index = 0; + destroy_aggr_state_op_->getAllWorkOrders(&destroy_aggr_state_op_container, + query_context_.get(), + storage_manager_.get(), + foreman_client_id_, + &bus_); + while (destroy_aggr_state_op_container.hasNormalWorkOrder(destroy_aggr_state_op_index)) { + WorkOrder *work_order = destroy_aggr_state_op_container.getNormalWorkOrder(destroy_aggr_state_op_index); + work_order->execute(); + delete work_order; + } } template @@ -526,6 +550,7 @@ class AggregationOperatorTest : public ::testing::Test { std::unique_ptr op_; std::unique_ptr finalize_op_; + std::unique_ptr destroy_aggr_state_op_; }; const char AggregationOperatorTest::kDatabaseName[] = "database";