You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@quickstep.apache.org by zu...@apache.org on 2017/03/13 20:56:02 UTC

[53/60] [abbrv] incubator-quickstep git commit: Fixed the admitQueries bug.

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 <zu...@apache.org>
Authored: Fri Mar 10 00:19:58 2017 -0800
Committer: Zuyu Zhang <zu...@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(