quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbdeshm...@apache.org
Subject [16/18] incubator-quickstep git commit: More conditions and logging in PolicyEnforcer.
Date Fri, 01 Jul 2016 04:41:46 GMT
More conditions and logging in PolicyEnforcer.


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

Branch: refs/heads/scheduler++
Commit: aab8f6530e4a515531b0f4c8e54dd006b108b566
Parents: f379b46
Author: Harshad Deshmukh <hbdeshmukh@apache.org>
Authored: Tue Jun 28 14:35:53 2016 -0500
Committer: Harshad Deshmukh <hbdeshmukh@apache.org>
Committed: Thu Jun 30 23:41:05 2016 -0500

----------------------------------------------------------------------
 query_execution/PriorityPolicyEnforcer.cpp | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/aab8f653/query_execution/PriorityPolicyEnforcer.cpp
----------------------------------------------------------------------
diff --git a/query_execution/PriorityPolicyEnforcer.cpp b/query_execution/PriorityPolicyEnforcer.cpp
index 6467367..f9a741d 100644
--- a/query_execution/PriorityPolicyEnforcer.cpp
+++ b/query_execution/PriorityPolicyEnforcer.cpp
@@ -174,18 +174,26 @@ void PriorityPolicyEnforcer::getWorkerMessages(
     // While there are more priority levels to be checked ..
     while (checked_priority_levels.size() < priority_query_ids_.size()) {
       const int chosen_priority_level = learner_->pickRandomPriorityLevel();
-      DCHECK(chosen_priority_level != kInvalidPriorityLevel);
-      WorkerMessage *next_worker_message =
-          getNextWorkerMessageFromPriorityLevel(chosen_priority_level,
-                                                &finished_queries_ids);
-      if (next_worker_message != nullptr) {
-        worker_messages->push_back(std::unique_ptr<WorkerMessage>(next_worker_message));
+      if (chosen_priority_level == kInvalidPriorityLevel) {
+        LOG(INFO) << "No valid priority level chosen";
+        break;
+      } else if (checked_priority_levels.find(static_cast<std::size_t>(
+                     chosen_priority_level)) != checked_priority_levels.end()) {
+        DLOG(INFO) << "The chosen priority level " << chosen_priority_level <<
" was checked already";
+        continue;
       } else {
-        checked_priority_levels[static_cast<std::size_t>(chosen_priority_level)] =
true;
+        WorkerMessage *next_worker_message =
+            getNextWorkerMessageFromPriorityLevel(chosen_priority_level,
+                                                  &finished_queries_ids);
+        if (next_worker_message != nullptr) {
+          worker_messages->push_back(std::unique_ptr<WorkerMessage>(next_worker_message));
+        } else {
+          checked_priority_levels[static_cast<std::size_t>(chosen_priority_level)]
= true;
+        }
       }
     }
   } else {
-    LOG(INFO) << "No active queries in the learner at this point.";
+    DLOG(INFO) << "No active queries in the learner at this point.";
     return;
   }
   for (const std::size_t finished_qid : finished_queries_ids) {


Mime
View raw message