quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zu...@apache.org
Subject incubator-quickstep git commit: Minor refactor scheduler in the distributed version.
Date Wed, 17 May 2017 05:45:42 GMT
Repository: incubator-quickstep
Updated Branches:
  refs/heads/master ed72e2477 -> 97650fb85


Minor refactor scheduler in the distributed version.


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

Branch: refs/heads/master
Commit: 97650fb85cee9c93aadc37adf6cbcc0f6d61244c
Parents: ed72e24
Author: Zuyu Zhang <zuyuz@apache.org>
Authored: Tue May 16 21:29:15 2017 -0700
Committer: Zuyu Zhang <zuyuz@apache.org>
Committed: Tue May 16 21:29:15 2017 -0700

----------------------------------------------------------------------
 query_execution/PolicyEnforcerDistributed.cpp |  8 ++++----
 query_execution/QueryManagerDistributed.cpp   | 10 +++-------
 query_execution/QueryManagerDistributed.hpp   |  6 +-----
 3 files changed, 8 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/97650fb8/query_execution/PolicyEnforcerDistributed.cpp
----------------------------------------------------------------------
diff --git a/query_execution/PolicyEnforcerDistributed.cpp b/query_execution/PolicyEnforcerDistributed.cpp
index 36becf2..b410152 100644
--- a/query_execution/PolicyEnforcerDistributed.cpp
+++ b/query_execution/PolicyEnforcerDistributed.cpp
@@ -112,11 +112,11 @@ void PolicyEnforcerDistributed::getWorkOrderProtoMessages(
     DCHECK(curr_query_manager != nullptr);
     std::size_t messages_collected_curr_query = 0;
     while (messages_collected_curr_query < per_query_share) {
-      S::WorkOrderMessage *next_work_order_message =
-          static_cast<QueryManagerDistributed*>(curr_query_manager)->getNextWorkOrderMessage(0);
-      if (next_work_order_message != nullptr) {
+      unique_ptr<S::WorkOrderMessage> next_work_order_message(
+          static_cast<QueryManagerDistributed*>(curr_query_manager)->getNextWorkOrderMessage());
+      if (next_work_order_message) {
         ++messages_collected_curr_query;
-        work_order_proto_messages->push_back(unique_ptr<S::WorkOrderMessage>(next_work_order_message));
+        work_order_proto_messages->push_back(move(next_work_order_message));
       } else {
         // No more work ordes from the current query at this time.
         // Check if the query's execution is over.

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/97650fb8/query_execution/QueryManagerDistributed.cpp
----------------------------------------------------------------------
diff --git a/query_execution/QueryManagerDistributed.cpp b/query_execution/QueryManagerDistributed.cpp
index 92645b6..b304f9f 100644
--- a/query_execution/QueryManagerDistributed.cpp
+++ b/query_execution/QueryManagerDistributed.cpp
@@ -79,19 +79,15 @@ QueryManagerDistributed::QueryManagerDistributed(QueryHandle *query_handle,
   }
 }
 
-serialization::WorkOrderMessage* QueryManagerDistributed::getNextWorkOrderMessage(
-    const dag_node_index start_operator_index) {
+serialization::WorkOrderMessage* QueryManagerDistributed::getNextWorkOrderMessage() {
   // Default policy: Operator with lowest index first.
-  size_t num_operators_checked = 0;
-  for (dag_node_index index = start_operator_index;
-       num_operators_checked < num_operators_in_dag_;
-       index = (index + 1) % num_operators_in_dag_, ++num_operators_checked) {
+  for (dag_node_index index = 0u; index < num_operators_in_dag_; ++index) {
     if (query_exec_state_->hasExecutionFinished(index)) {
       continue;
     }
     unique_ptr<serialization::WorkOrder> work_order_proto(
         normal_workorder_protos_container_->getWorkOrderProto(index));
-    if (work_order_proto != nullptr) {
+    if (work_order_proto) {
       query_exec_state_->incrementNumQueuedWorkOrders(index);
 
       unique_ptr<serialization::WorkOrderMessage> message_proto(new serialization::WorkOrderMessage);

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/97650fb8/query_execution/QueryManagerDistributed.hpp
----------------------------------------------------------------------
diff --git a/query_execution/QueryManagerDistributed.hpp b/query_execution/QueryManagerDistributed.hpp
index 6a47ce8..ab4479c 100644
--- a/query_execution/QueryManagerDistributed.hpp
+++ b/query_execution/QueryManagerDistributed.hpp
@@ -91,14 +91,10 @@ class QueryManagerDistributed final : public QueryManagerBase {
    * @brief Get the next normal workorder to be excuted, wrapped in a
    *        WorkOrderMessage proto.
    *
-   * @param start_operator_index Begin the search for the schedulable WorkOrder
-   *        with the operator at this index.
-   *
    * @return A pointer to the WorkOrderMessage proto. If there is no WorkOrder
    *         to be executed, return NULL.
    **/
-  serialization::WorkOrderMessage* getNextWorkOrderMessage(
-      const dag_node_index start_operator_index);
+  serialization::WorkOrderMessage* getNextWorkOrderMessage();
 
   /**
    * @brief Get the index of Shiftboss for an Aggregation related WorkOrder. If


Mime
View raw message