quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbdeshm...@apache.org
Subject [14/20] incubator-quickstep git commit: AdmitRequest message function accepts multiple queries.
Date Sat, 02 Jul 2016 23:17:50 GMT
AdmitRequest message function accepts multiple queries.


Project: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/commit/6718adf8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/6718adf8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/6718adf8

Branch: refs/heads/scheduler++
Commit: 6718adf8bb5d829fef17aa4a763399d9e4ddae3f
Parents: 6dfbcf0
Author: Harshad Deshmukh <hbdeshmukh@apache.org>
Authored: Tue Jun 28 15:10:51 2016 -0500
Committer: Harshad Deshmukh <hbdeshmukh@apache.org>
Committed: Sat Jul 2 18:16:30 2016 -0500

----------------------------------------------------------------------
 cli/CommandExecutor.cpp                                | 4 +++-
 cli/QuickstepCli.cpp                                   | 4 +++-
 query_execution/AdmitRequestMessage.hpp                | 5 +++--
 query_execution/QueryExecutionUtil.hpp                 | 4 ++--
 query_optimizer/tests/ExecutionGeneratorTestRunner.cpp | 4 +++-
 5 files changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/6718adf8/cli/CommandExecutor.cpp
----------------------------------------------------------------------
diff --git a/cli/CommandExecutor.cpp b/cli/CommandExecutor.cpp
index 7083ef5..440a30f 100644
--- a/cli/CommandExecutor.cpp
+++ b/cli/CommandExecutor.cpp
@@ -216,9 +216,11 @@ inline TypedValue executeQueryForSingleResult(
       query_processor->generateQueryHandle(*result.parsed_statement));
   DCHECK(query_handle->getQueryPlanMutable() != nullptr);
 
+  std::vector<QueryHandle*> query_handles;
+  query_handles.push_back(query_handle.get());
   // Use foreman to execute the query plan.
   QueryExecutionUtil::ConstructAndSendAdmitRequestMessage(
-      main_thread_client_id, foreman_client_id, query_handle.get(), bus);
+      main_thread_client_id, foreman_client_id, &query_handles, bus);
 
   QueryExecutionUtil::ReceiveQueryCompletionMessage(main_thread_client_id, bus);
 

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/6718adf8/cli/QuickstepCli.cpp
----------------------------------------------------------------------
diff --git a/cli/QuickstepCli.cpp b/cli/QuickstepCli.cpp
index 3f99130..d7b687e 100644
--- a/cli/QuickstepCli.cpp
+++ b/cli/QuickstepCli.cpp
@@ -434,11 +434,13 @@ int main(int argc, char* argv[]) {
         }
 
         DCHECK(query_handle->getQueryPlanMutable() != nullptr);
+        std::vector<QueryHandle*> query_handles;
+        query_handles.push_back(query_handle.get());
         start = std::chrono::steady_clock::now();
         QueryExecutionUtil::ConstructAndSendAdmitRequestMessage(
             main_thread_client_id,
             foreman.getBusClientID(),
-            query_handle.get(),
+            &query_handles,
             &bus);
 
         try {

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/6718adf8/query_execution/AdmitRequestMessage.hpp
----------------------------------------------------------------------
diff --git a/query_execution/AdmitRequestMessage.hpp b/query_execution/AdmitRequestMessage.hpp
index e33b354..0aefcbf 100644
--- a/query_execution/AdmitRequestMessage.hpp
+++ b/query_execution/AdmitRequestMessage.hpp
@@ -41,8 +41,9 @@ class AdmitRequestMessage {
    * @param query_handles The handles of the queries requesting to be admitted
    *        to the system.
    **/
-  explicit AdmitRequestMessage(const std::vector<QueryHandle*> &query_handles)
-      : query_handles_(query_handles) {}
+  explicit AdmitRequestMessage(std::vector<QueryHandle*> *query_handles)
+      : query_handles_(*DCHECK_NOTNULL(query_handles)) {
+  }
 
   /**
    * @brief Constructor for requesting single query admission.

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/6718adf8/query_execution/QueryExecutionUtil.hpp
----------------------------------------------------------------------
diff --git a/query_execution/QueryExecutionUtil.hpp b/query_execution/QueryExecutionUtil.hpp
index 6ea4a29..2b95f1f 100644
--- a/query_execution/QueryExecutionUtil.hpp
+++ b/query_execution/QueryExecutionUtil.hpp
@@ -74,7 +74,7 @@ class QueryExecutionUtil {
    *
    * @param sender_id The TMB client ID of the sender.
    * @param receiver_id The TMB client ID of the receiver.
-   * @param query_handle The QueryHandle used in the AdmitRequestMessage.
+   * @param query_handle The QueryHandles used in the AdmitRequestMessage.
    * @param bus A pointer to the TMB.
    * @param tagged_message A moved from reference to the tagged message.
    *
@@ -84,7 +84,7 @@ class QueryExecutionUtil {
   static tmb::MessageBus::SendStatus ConstructAndSendAdmitRequestMessage(
       const tmb::client_id sender_id,
       const tmb::client_id receiver_id,
-      QueryHandle *query_handle,
+      std::vector<QueryHandle*> *query_handle,
       MessageBus *bus) {
     std::unique_ptr<AdmitRequestMessage> request_message(
         new AdmitRequestMessage(query_handle));

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/6718adf8/query_optimizer/tests/ExecutionGeneratorTestRunner.cpp
----------------------------------------------------------------------
diff --git a/query_optimizer/tests/ExecutionGeneratorTestRunner.cpp b/query_optimizer/tests/ExecutionGeneratorTestRunner.cpp
index 8c1d306..92baf19 100644
--- a/query_optimizer/tests/ExecutionGeneratorTestRunner.cpp
+++ b/query_optimizer/tests/ExecutionGeneratorTestRunner.cpp
@@ -96,10 +96,12 @@ void ExecutionGeneratorTestRunner::runTestCase(
                 logical_generator.generatePlan(*result.parsed_statement));
         execution_generator.generatePlan(physical_plan);
 
+        std::vector<QueryHandle*> query_handles;
+        query_handles.push_back(&query_handle);
         QueryExecutionUtil::ConstructAndSendAdmitRequestMessage(
             main_thread_client_id_,
             foreman_->getBusClientID(),
-            &query_handle,
+            &query_handles,
             &bus_);
 
         QueryExecutionUtil::ReceiveQueryCompletionMessage(


Mime
View raw message