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/02/11 19:31:48 UTC

[1/3] incubator-quickstep git commit: Refactored block loading order in StorageManager::loadBlockOrBlob.

Repository: incubator-quickstep
Updated Branches:
  refs/heads/dist-patch [created] e86b244ce


Refactored block loading order in StorageManager::loadBlockOrBlob.


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

Branch: refs/heads/dist-patch
Commit: e86b244ce04b0175f9853a1fa484860b9e8c1e0b
Parents: 97f459c
Author: Zuyu Zhang <zu...@apache.org>
Authored: Sat Feb 11 11:24:54 2017 -0800
Committer: Zuyu Zhang <zu...@apache.org>
Committed: Sat Feb 11 11:30:51 2017 -0800

----------------------------------------------------------------------
 storage/StorageManager.cpp | 60 ++++++++++++++++++++---------------------
 1 file changed, 29 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/e86b244c/storage/StorageManager.cpp
----------------------------------------------------------------------
diff --git a/storage/StorageManager.cpp b/storage/StorageManager.cpp
index 872e8cc..6f051eb 100644
--- a/storage/StorageManager.cpp
+++ b/storage/StorageManager.cpp
@@ -666,45 +666,43 @@ StorageManager::BlockHandle StorageManager::loadBlockOrBlob(
   // already loaded before this function gets called.
   BlockHandle loaded_handle;
 
-#ifdef QUICKSTEP_DISTRIBUTED
-  // TODO(quickstep-team): Use a cost model to determine whether to load from
-  // a remote peer or the disk.
-  if (BlockIdUtil::Domain(block) != block_domain_) {
-    DLOG(INFO) << "Pulling Block " << BlockIdUtil::ToString(block) << " from a remote peer";
-    const vector<string> peer_domain_network_addresses = getPeerDomainNetworkAddresses(block);
-    for (const string &peer_domain_network_address : peer_domain_network_addresses) {
-      DataExchangerClientAsync client(
-          grpc::CreateChannel(peer_domain_network_address, grpc::InsecureChannelCredentials()),
-          this);
-
-      if (client.Pull(block, numa_node, &loaded_handle)) {
-        sendBlockLocationMessage(block, kAddBlockLocationMessage);
-        return loaded_handle;
-      }
-    }
+  const size_t num_slots = file_manager_->numSlots(block);
+  if (num_slots != 0) {
+    void *block_buffer = allocateSlots(num_slots, numa_node);
 
-    DLOG(INFO) << "Failed to pull Block " << BlockIdUtil::ToString(block)
-               << " from remote peers, so try to load from disk.";
-  }
-#endif
+    const bool status = file_manager_->readBlockOrBlob(block, block_buffer, kSlotSizeBytes * num_slots);
+    CHECK(status) << "Failed to read block from persistent storage: " << block;
 
-  const size_t num_slots = file_manager_->numSlots(block);
-  DEBUG_ASSERT(num_slots != 0);
-  void *block_buffer = allocateSlots(num_slots, numa_node);
+    loaded_handle.block_memory = block_buffer;
+    loaded_handle.block_memory_size = num_slots;
 
-  const bool status = file_manager_->readBlockOrBlob(block, block_buffer, kSlotSizeBytes * num_slots);
-  CHECK(status) << "Failed to read block from persistent storage: " << block;
+#ifdef QUICKSTEP_DISTRIBUTED
+    if (bus_) {
+      sendBlockLocationMessage(block, kAddBlockLocationMessage);
+    }
+#endif
 
-  loaded_handle.block_memory = block_buffer;
-  loaded_handle.block_memory_size = num_slots;
+    return loaded_handle;
+  }
 
 #ifdef QUICKSTEP_DISTRIBUTED
-  if (bus_) {
-    sendBlockLocationMessage(block, kAddBlockLocationMessage);
+  // TODO(quickstep-team): Use a cost model to determine whether to load from
+  // a remote peer or the disk.
+  DLOG(INFO) << "Pulling Block " << BlockIdUtil::ToString(block) << " from a remote peer";
+  const vector<string> peer_domain_network_addresses = getPeerDomainNetworkAddresses(block);
+  for (const string &peer_domain_network_address : peer_domain_network_addresses) {
+    DataExchangerClientAsync client(
+        grpc::CreateChannel(peer_domain_network_address, grpc::InsecureChannelCredentials()),
+        this);
+
+    if (client.Pull(block, numa_node, &loaded_handle)) {
+      sendBlockLocationMessage(block, kAddBlockLocationMessage);
+      return loaded_handle;
+    }
   }
+  LOG(FATAL) << "Failed to pull Block " << BlockIdUtil::ToString(block)
+             << " from remote peers.";
 #endif
-
-  return loaded_handle;
 }
 
 void StorageManager::insertBlockHandleAfterLoad(const block_id block,


[2/3] incubator-quickstep git commit: Set the default tmb_implementation value to purememory.

Posted by zu...@apache.org.
Set the default tmb_implementation value to purememory.


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

Branch: refs/heads/dist-patch
Commit: 97f459c26576fab04a0e355fb03698a7d67e6426
Parents: 08a7033
Author: Zuyu Zhang <zu...@apache.org>
Authored: Sat Feb 11 11:17:55 2017 -0800
Committer: Zuyu Zhang <zu...@apache.org>
Committed: Sat Feb 11 11:30:51 2017 -0800

----------------------------------------------------------------------
 third_party/src/tmb/src/tmb_net_server.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/97f459c2/third_party/src/tmb/src/tmb_net_server.cc
----------------------------------------------------------------------
diff --git a/third_party/src/tmb/src/tmb_net_server.cc b/third_party/src/tmb/src/tmb_net_server.cc
index c2be7ef..abe0efe 100644
--- a/third_party/src/tmb/src/tmb_net_server.cc
+++ b/third_party/src/tmb/src/tmb_net_server.cc
@@ -256,7 +256,7 @@ static bool ValidateTmbImplementation(const char *flagname,
                "Invalid value for --%s: %s\n", flagname, value.c_str());
   return false;
 }
-DEFINE_string(tmb_implementation, "nativelog",
+DEFINE_string(tmb_implementation, "purememory",
               "Which underlying TMB implementation to use. Valid choices are "
               "leveldb, nativelog, purememory, sqlite, voltdb, and zookeeper. "
               "Depending on how the TMB library was built, some of these may "


[3/3] incubator-quickstep git commit: Minor improved the scheduling algorithm in the distributed version.

Posted by zu...@apache.org.
Minor improved the scheduling algorithm 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/08a70334
Tree: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/tree/08a70334
Diff: http://git-wip-us.apache.org/repos/asf/incubator-quickstep/diff/08a70334

Branch: refs/heads/dist-patch
Commit: 08a70334a8d6a11aad24ab6c4c1e2131d04f229f
Parents: 9b0a6f9
Author: Zuyu Zhang <zu...@apache.org>
Authored: Fri Feb 10 20:37:23 2017 -0800
Committer: Zuyu Zhang <zu...@apache.org>
Committed: Sat Feb 11 11:30:51 2017 -0800

----------------------------------------------------------------------
 query_execution/ForemanDistributed.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/08a70334/query_execution/ForemanDistributed.cpp
----------------------------------------------------------------------
diff --git a/query_execution/ForemanDistributed.cpp b/query_execution/ForemanDistributed.cpp
index 8c20e65..389d6ab 100644
--- a/query_execution/ForemanDistributed.cpp
+++ b/query_execution/ForemanDistributed.cpp
@@ -378,7 +378,8 @@ void ForemanDistributed::dispatchWorkOrderMessages(const vector<unique_ptr<S::Wo
     sendWorkOrderMessage(shiftboss_index_for_particular_work_order_type, proto);
     shiftboss_directory_.incrementNumQueuedWorkOrders(shiftboss_index_for_particular_work_order_type);
 
-    if (shiftboss_index == shiftboss_index_for_particular_work_order_type) {
+    if (shiftboss_index == shiftboss_index_for_particular_work_order_type &&
+        shiftboss_directory_.hasReachedCapacity(shiftboss_index)) {
       shiftboss_index = (shiftboss_index + 1) % shiftboss_directory_.size();
     } else {
       // NOTE(zuyu): This is not the exact round-robin scheduling, as in this case,