quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zu...@apache.org
Subject [53/60] [abbrv] incubator-quickstep git commit: Fixed the admitQueries bug.
Date Mon, 13 Mar 2017 20:56:02 GMT
Fixed the admitQueries bug.


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

Branch: refs/heads/dist-patch
Commit: 9a991bb002cd94405a01d543d890e21aeb54100c
Parents: 4a95738
Author: Zuyu Zhang <zuyuz@apache.org>
Authored: Fri Mar 10 00:19:58 2017 -0800
Committer: Zuyu Zhang <zuyuz@apache.org>
Committed: Sat Mar 11 18:41:47 2017 -0800

----------------------------------------------------------------------
 query_execution/PolicyEnforcerBase.cpp | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/9a991bb0/query_execution/PolicyEnforcerBase.cpp
----------------------------------------------------------------------
diff --git a/query_execution/PolicyEnforcerBase.cpp b/query_execution/PolicyEnforcerBase.cpp
index 1ffde4d..324bcb3 100644
--- a/query_execution/PolicyEnforcerBase.cpp
+++ b/query_execution/PolicyEnforcerBase.cpp
@@ -157,12 +157,15 @@ void PolicyEnforcerBase::removeQuery(const std::size_t query_id) {
 
 bool PolicyEnforcerBase::admitQueries(
     const std::vector<QueryHandle*> &query_handles) {
+  bool all_queries_admitted = true;
   for (QueryHandle *curr_query : query_handles) {
-    if (!admitQuery(curr_query)) {
-      return false;
+    if (all_queries_admitted) {
+      all_queries_admitted = admitQuery(curr_query);
+    } else {
+      waiting_queries_.push(curr_query);
     }
   }
-  return true;
+  return all_queries_admitted;
 }
 
 void PolicyEnforcerBase::recordTimeForWorkOrder(


Mime
View raw message