quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jianq...@apache.org
Subject [55/62] [abbrv] incubator-quickstep git commit: Enabled more concurrent queries in the distributed version.
Date Wed, 15 Mar 2017 19:01:14 GMT
Enabled more concurrent queries 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/14fcd61b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/14fcd61b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/14fcd61b

Branch: refs/heads/LIP-time-decomposition
Commit: 14fcd61b4362e434baf5f39a567bf1b463f97c45
Parents: 42bf6b8
Author: Zuyu Zhang <zuyuz@apache.org>
Authored: Sun Mar 12 13:16:50 2017 -0700
Committer: Zuyu Zhang <zuyuz@apache.org>
Committed: Sun Mar 12 13:18:04 2017 -0700

----------------------------------------------------------------------
 query_execution/PolicyEnforcerDistributed.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/14fcd61b/query_execution/PolicyEnforcerDistributed.cpp
----------------------------------------------------------------------
diff --git a/query_execution/PolicyEnforcerDistributed.cpp b/query_execution/PolicyEnforcerDistributed.cpp
index 9f246ed..0709e68 100644
--- a/query_execution/PolicyEnforcerDistributed.cpp
+++ b/query_execution/PolicyEnforcerDistributed.cpp
@@ -130,7 +130,10 @@ void PolicyEnforcerDistributed::getWorkOrderProtoMessages(
 }
 
 bool PolicyEnforcerDistributed::admitQuery(QueryHandle *query_handle) {
-  if (admitted_queries_.size() >= PolicyEnforcerBase::kMaxConcurrentQueries) {
+  const std::size_t num_shiftbosses = shiftboss_directory_->size();
+  // We only allow the number of concurrent queries that equals to
+  // that of Shiftbosses.
+  if (admitted_queries_.size() > num_shiftbosses) {
     // This query will have to wait.
     waiting_queries_.push(query_handle);
     return false;
@@ -148,8 +151,6 @@ bool PolicyEnforcerDistributed::admitQuery(QueryHandle *query_handle)
{
   // initializes.
   initiateQueryInShiftboss(query_handle);
 
-  const std::size_t num_shiftbosses = shiftboss_directory_->size();
-
   tmb::Address shiftboss_addresses;
   for (std::size_t i = 0; i < num_shiftbosses; ++i) {
     shiftboss_addresses.AddRecipient(shiftboss_directory_->getClientId(i));


Mime
View raw message