quickstep-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zu...@apache.org
Subject incubator-quickstep git commit: Used an alternative implementation for the proto map.
Date Fri, 17 Mar 2017 01:59:33 GMT
Repository: incubator-quickstep
Updated Branches:
  refs/heads/fix-proto-map [created] 7aaa0533d


Used an alternative implementation for the proto map.


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

Branch: refs/heads/fix-proto-map
Commit: 7aaa0533de7abed6bd6ae0beb30f17bfc1974e52
Parents: 8c26c31
Author: Zuyu Zhang <zuyuz@apache.org>
Authored: Thu Mar 16 18:59:28 2017 -0700
Committer: Zuyu Zhang <zuyuz@apache.org>
Committed: Thu Mar 16 18:59:28 2017 -0700

----------------------------------------------------------------------
 query_execution/BlockLocator.cpp             | 6 ++++--
 query_execution/QueryExecutionMessages.proto | 7 ++++++-
 storage/StorageManager.cpp                   | 7 ++++---
 3 files changed, 14 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/7aaa0533/query_execution/BlockLocator.cpp
----------------------------------------------------------------------
diff --git a/query_execution/BlockLocator.cpp b/query_execution/BlockLocator.cpp
index 1c8c690..a898aba 100644
--- a/query_execution/BlockLocator.cpp
+++ b/query_execution/BlockLocator.cpp
@@ -196,8 +196,10 @@ void BlockLocator::processGetAllDomainNetworkAddressesMessage(const client_id
re
   // NOTE(zuyu): We don't need to protect here, as all the writers are in the
   // single thread.
   for (const auto &domain_network_address_pair : domain_network_addresses_) {
-    (*proto.mutable_domain_network_addresses())[domain_network_address_pair.first] =
-        domain_network_address_pair.second;
+    serialization::GetAllDomainNetworkAddressesResponseMessage::DomainNetworkAddress *proto_domain_network_address
=
+        proto.add_domain_network_addresses();
+    proto_domain_network_address->set_block_domain(domain_network_address_pair.first);
+    proto_domain_network_address->set_network_address(domain_network_address_pair.second);
   }
 
   const int proto_length = proto.ByteSize();

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/7aaa0533/query_execution/QueryExecutionMessages.proto
----------------------------------------------------------------------
diff --git a/query_execution/QueryExecutionMessages.proto b/query_execution/QueryExecutionMessages.proto
index 9c59985..6aa8769 100644
--- a/query_execution/QueryExecutionMessages.proto
+++ b/query_execution/QueryExecutionMessages.proto
@@ -165,5 +165,10 @@ message BlockMessage {
 }
 
 message GetAllDomainNetworkAddressesResponseMessage {
-  map<uint32, string> domain_network_addresses = 1;
+  message DomainNetworkAddress {
+    required uint32 block_domain = 1;
+    required string network_address = 2;
+  }
+
+  repeated DomainNetworkAddress domain_network_addresses = 1;
 }

http://git-wip-us.apache.org/repos/asf/incubator-quickstep/blob/7aaa0533/storage/StorageManager.cpp
----------------------------------------------------------------------
diff --git a/storage/StorageManager.cpp b/storage/StorageManager.cpp
index b7d87e7..7eb132c 100644
--- a/storage/StorageManager.cpp
+++ b/storage/StorageManager.cpp
@@ -613,10 +613,11 @@ string StorageManager::getPeerDomainNetworkAddress(const block_id_domain
block_d
     serialization::GetAllDomainNetworkAddressesResponseMessage proto;
     CHECK(proto.ParseFromArray(tagged_message.message(), tagged_message.message_bytes()));
 
-    for (const auto &domain_network_address_pair : proto.domain_network_addresses())
{
-      const block_id_domain block_domain = domain_network_address_pair.first;
+    for (int i = 0; i < proto.domain_network_addresses_size(); ++i) {
+      const auto &proto_domain_network_address = proto.domain_network_addresses(i);
+      const block_id_domain block_domain = proto_domain_network_address.block_domain();
       if (block_domain_network_addresses_.find(block_domain) == block_domain_network_addresses_.end())
{
-        block_domain_network_addresses_.emplace(block_domain, domain_network_address_pair.second);
+        block_domain_network_addresses_.emplace(block_domain, proto_domain_network_address.network_address());
       }
     }
 


Mime
View raw message