kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject kudu git commit: KUDU-1534 : Added software_version to ListMasters RPC
Date Fri, 26 Aug 2016 20:33:30 GMT
Repository: kudu
Updated Branches:
  refs/heads/master 43d2749dd -> d4b6520b6


KUDU-1534 : Added software_version to ListMasters RPC

This change also consolidates TSRegistrationPB and
ServerRegistrationPB and merges them into latter
as they seem to bear the same signature.

As a precaution, testing is performed to make sure downgrade/upgrade
are compatible with the message formats being consolidated. Testing
details are attached under JIRA.

Also added registration string to 'Masters' webui.
Sample output is at:
https://github.com/dineshabbi/scripts/blob/master/MasterRegWebUI.pdf

Change-Id: I750eeb78c989daaa6fd5d9793b1218ae5993653c
Reviewed-on: http://gerrit.cloudera.org:8080/4099
Tested-by: Kudu Jenkins
Reviewed-by: Adar Dembo <adar@cloudera.com>


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

Branch: refs/heads/master
Commit: d4b6520b655a7c53af2d7ae08ea70c44baaeae85
Parents: 43d2749
Author: Dinesh Bhat <dinesh@cloudera.com>
Authored: Tue Aug 23 12:49:40 2016 -0700
Committer: Adar Dembo <adar@cloudera.com>
Committed: Fri Aug 26 20:32:39 2016 +0000

----------------------------------------------------------------------
 src/kudu/common/wire_protocol.proto             |  4 ++-
 src/kudu/integration-tests/cluster_itest_util.h |  2 +-
 .../master_replication-itest.cc                 |  2 +-
 src/kudu/integration-tests/registration-test.cc | 14 +++++++++-
 src/kudu/master/catalog_manager.cc              |  8 +++---
 src/kudu/master/master-path-handlers.cc         | 29 +++++++++++---------
 src/kudu/master/master-path-handlers.h          |  9 ++----
 src/kudu/master/master-test.cc                  |  4 +--
 src/kudu/master/master.cc                       |  2 ++
 src/kudu/master/master.h                        |  2 +-
 src/kudu/master/master.proto                    | 14 ++--------
 src/kudu/master/master_service.cc               |  2 +-
 src/kudu/master/ts_descriptor.cc                |  8 +++---
 src/kudu/master/ts_descriptor.h                 | 11 ++++----
 src/kudu/master/ts_manager.cc                   |  2 +-
 src/kudu/master/ts_manager.h                    |  4 +--
 src/kudu/tserver/heartbeater.cc                 |  4 +--
 17 files changed, 63 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/common/wire_protocol.proto
----------------------------------------------------------------------
diff --git a/src/kudu/common/wire_protocol.proto b/src/kudu/common/wire_protocol.proto
index e1d2784..27365eb 100644
--- a/src/kudu/common/wire_protocol.proto
+++ b/src/kudu/common/wire_protocol.proto
@@ -79,10 +79,12 @@ message NodeInstancePB {
   required int64 instance_seqno = 2;
 }
 
-// RPC and HTTP addresses for each server.
+// Some basic properties common to both masters and tservers.
+// They are guaranteed not to change unless the server is restarted.
 message ServerRegistrationPB {
   repeated HostPortPB rpc_addresses = 1;
   repeated HostPortPB http_addresses = 2;
+  optional string software_version = 3;
 }
 
 message ServerEntryPB {

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/integration-tests/cluster_itest_util.h
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/cluster_itest_util.h b/src/kudu/integration-tests/cluster_itest_util.h
index 00f2229..3722b23 100644
--- a/src/kudu/integration-tests/cluster_itest_util.h
+++ b/src/kudu/integration-tests/cluster_itest_util.h
@@ -74,7 +74,7 @@ namespace itest {
 
 struct TServerDetails {
   NodeInstancePB instance_id;
-  master::TSRegistrationPB registration;
+  ServerRegistrationPB registration;
   gscoped_ptr<tserver::TabletServerServiceProxy> tserver_proxy;
   gscoped_ptr<tserver::TabletServerAdminServiceProxy> tserver_admin_proxy;
   gscoped_ptr<consensus::ConsensusServiceProxy> consensus_proxy;

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/integration-tests/master_replication-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/master_replication-itest.cc b/src/kudu/integration-tests/master_replication-itest.cc
index 3356736..920fed0 100644
--- a/src/kudu/integration-tests/master_replication-itest.cc
+++ b/src/kudu/integration-tests/master_replication-itest.cc
@@ -228,7 +228,7 @@ TEST_F(MasterReplicationTest, TestHeartbeatAcceptedByAnyMaster) {
   TSToMasterCommonPB common;
   common.mutable_ts_instance()->set_permanent_uuid("fake-ts-uuid");
   common.mutable_ts_instance()->set_instance_seqno(1);
-  TSRegistrationPB fake_reg;
+  ServerRegistrationPB fake_reg;
   HostPortPB* pb = fake_reg.add_rpc_addresses();
   pb->set_host("localhost");
   pb->set_port(1000);

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/integration-tests/registration-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/registration-test.cc b/src/kudu/integration-tests/registration-test.cc
index 57a2c70..55ba9b1 100644
--- a/src/kudu/integration-tests/registration-test.cc
+++ b/src/kudu/integration-tests/registration-test.cc
@@ -120,7 +120,7 @@ TEST_F(RegistrationTest, TestTSRegisters) {
   ASSERT_EQ(1, descs.size());
 
   // Verify that the registration is sane.
-  master::TSRegistrationPB reg;
+  ServerRegistrationPB reg;
   descs[0]->GetRegistration(&reg);
   {
     SCOPED_TRACE(reg.ShortDebugString());
@@ -141,6 +141,18 @@ TEST_F(RegistrationTest, TestTSRegisters) {
   // number.
 }
 
+TEST_F(RegistrationTest, TestMasterSoftwareVersion) {
+  // Verify that the master's software version exists.
+  ServerRegistrationPB reg;
+  cluster_->mini_master()->master()->GetMasterRegistration(&reg);
+  {
+    SCOPED_TRACE(reg.ShortDebugString());
+    ASSERT_TRUE(reg.has_software_version());
+    ASSERT_STR_CONTAINS(reg.software_version(),
+                        VersionInfo::GetShortVersionString());
+  }
+}
+
 // Test starting multiple tablet servers and ensuring they both register with the master.
 TEST_F(RegistrationTest, TestMultipleTS) {
   ASSERT_OK(cluster_->AddTabletServer());

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/master/catalog_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/catalog_manager.cc b/src/kudu/master/catalog_manager.cc
index 2290693..d499296 100644
--- a/src/kudu/master/catalog_manager.cc
+++ b/src/kudu/master/catalog_manager.cc
@@ -2774,7 +2774,7 @@ bool AsyncAddServerTask::SendRequest(int attempt) {
   req_.set_cas_config_opid_index(cstate_.config().opid_index());
   RaftPeerPB* peer = req_.mutable_server();
   peer->set_permanent_uuid(replacement_replica->permanent_uuid());
-  TSRegistrationPB peer_reg;
+  ServerRegistrationPB peer_reg;
   replacement_replica->GetRegistration(&peer_reg);
   if (peer_reg.rpc_addresses_size() == 0) {
     KLOG_EVERY_N(WARNING, 100) << LogPrefix() << "Candidate replacement "
@@ -3296,7 +3296,7 @@ void CatalogManager::SelectReplicas(const TSDescriptorVector& ts_descs,
     // value decays back to 0 over time.
     ts->IncrementRecentReplicaCreations();
 
-    TSRegistrationPB reg;
+    ServerRegistrationPB reg;
     ts->GetRegistration(&reg);
 
     RaftPeerPB *peer = config->add_peers();
@@ -3336,7 +3336,7 @@ Status CatalogManager::BuildLocationsForTablet(const scoped_refptr<TabletInfo>&
 
     shared_ptr<TSDescriptor> ts_desc;
     if (master_->ts_manager()->LookupTSByUUID(peer.permanent_uuid(), &ts_desc))
{
-      TSRegistrationPB reg;
+      ServerRegistrationPB reg;
       ts_desc->GetRegistration(&reg);
       tsinfo_pb->mutable_rpc_addresses()->Swap(reg.mutable_rpc_addresses());
     } else {
@@ -3404,7 +3404,7 @@ Status CatalogManager::GetTableLocations(const GetTableLocationsRequestPB*
req,
   vector<scoped_refptr<TabletInfo> > tablets_in_range;
   table->GetTabletsInRange(req, &tablets_in_range);
 
-  TSRegistrationPB reg;
+  ServerRegistrationPB reg;
   for (const scoped_refptr<TabletInfo>& tablet : tablets_in_range) {
     Status s = BuildLocationsForTablet(tablet, resp->add_tablet_locations());
     if (s.ok()) {

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/master/master-path-handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/master-path-handlers.cc b/src/kudu/master/master-path-handlers.cc
index 533866c..e45ad0e 100644
--- a/src/kudu/master/master-path-handlers.cc
+++ b/src/kudu/master/master-path-handlers.cc
@@ -71,7 +71,7 @@ void MasterPathHandlers::HandleTabletServers(const Webserver::WebRequest&
req,
   *output << "  <tr><th>UUID</th><th>Time since heartbeat</th><th>Registration</th></tr>\n";
   for (const std::shared_ptr<TSDescriptor>& desc : descs) {
     const string time_since_hb = StringPrintf("%.1fs", desc->TimeSinceHeartbeat().ToSeconds());
-    TSRegistrationPB reg;
+    ServerRegistrationPB reg;
     desc->GetRegistration(&reg);
     *output << Substitute("<tr><th>$0</th><td>$1</td><td><code>$2</code></td></tr>\n",
                           RegistrationToHtml(reg, desc->permanent_uuid()),
@@ -313,7 +313,7 @@ void MasterPathHandlers::HandleMasters(const Webserver::WebRequest&
req,
   }
   *output << "<h1> Masters </h1>\n";
   *output <<  "<table class='table table-striped'>\n";
-  *output <<  "  <tr><th>Registration</th><th>Role</th></tr>\n";
+  *output <<  "  <tr><th>UUID</th><th>Role</th><th>Registration</th></tr>\n";
 
   for (const ServerEntryPB& master : masters) {
     if (master.has_error()) {
@@ -322,13 +322,16 @@ void MasterPathHandlers::HandleMasters(const Webserver::WebRequest&
req,
                             EscapeForHtmlToString(error.ToString()));
       continue;
     }
-    string reg_text = RegistrationToHtml(master.registration(),
-                                         master.instance_id().permanent_uuid());
-    if (master.instance_id().permanent_uuid() == master_->instance_pb().permanent_uuid())
{
-      reg_text = Substitute("<b>$0</b>", reg_text);
-    }
-    *output << Substitute("  <tr><td>$0</td><td>$1</td></tr>\n",
reg_text,
-                          master.has_role() ?  RaftPeerPB_Role_Name(master.role()) : "N/A");
+    string uuid_text = RegistrationToHtml(
+        master.registration(),
+        master.instance_id().permanent_uuid());
+    string reg_str = EscapeForHtmlToString(
+        master.registration().ShortDebugString());
+    *output << Substitute(
+        "  <tr><td>$0</td><td>$1</td><td><code>$2</code></td></tr>\n",
+        uuid_text,
+        master.has_role() ? RaftPeerPB_Role_Name(master.role()) : "N/A",
+        reg_str);
   }
 
   *output << "</table>";
@@ -490,7 +493,7 @@ Status MasterPathHandlers::Register(Webserver* server) {
 
 string MasterPathHandlers::TSDescriptorToHtml(const TSDescriptor& desc,
                                               const std::string& tablet_id) const {
-  TSRegistrationPB reg;
+  ServerRegistrationPB reg;
   desc.GetRegistration(&reg);
 
   if (reg.http_addresses().size() > 0) {
@@ -505,9 +508,9 @@ string MasterPathHandlers::TSDescriptorToHtml(const TSDescriptor&
desc,
   }
 }
 
-template<class RegistrationType>
-string MasterPathHandlers::RegistrationToHtml(const RegistrationType& reg,
-                                              const std::string& link_text) const {
+string MasterPathHandlers::RegistrationToHtml(
+    const ServerRegistrationPB& reg,
+    const std::string& link_text) const {
   string link_html = EscapeForHtmlToString(link_text);
   if (reg.http_addresses().size() > 0) {
     link_html = Substitute("<a href=\"http://$0:$1/\">$2</a>",

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/master/master-path-handlers.h
----------------------------------------------------------------------
diff --git a/src/kudu/master/master-path-handlers.h b/src/kudu/master/master-path-handlers.h
index 4406757..bcda0a3 100644
--- a/src/kudu/master/master-path-handlers.h
+++ b/src/kudu/master/master-path-handlers.h
@@ -25,15 +25,14 @@
 #include "kudu/server/webserver.h"
 
 namespace kudu {
-
 class Schema;
+class ServerRegistrationPB;
 
 namespace master {
 
 class Master;
 struct TabletReplica;
 class TSDescriptor;
-class TSRegistrationPB;
 
 // Web page support for the master.
 class MasterPathHandlers {
@@ -65,10 +64,8 @@ class MasterPathHandlers {
 
   // Convert the specified server registration to HTML, adding a link
   // to the server's own web server (if specified in 'reg') with
-  // anchor text 'link_text'. 'RegistrationType' must be
-  // TSRegistrationPB or MasterRegistrationPB.
-  template<class RegistrationType>
-  std::string RegistrationToHtml(const RegistrationType& reg,
+  // anchor text 'link_text'.
+  std::string RegistrationToHtml(const ServerRegistrationPB& reg,
                                  const std::string& link_text) const;
 
   Master* master_;

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/master/master-test.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/master-test.cc b/src/kudu/master/master-test.cc
index e47ec07..8979401 100644
--- a/src/kudu/master/master-test.cc
+++ b/src/kudu/master/master-test.cc
@@ -145,7 +145,7 @@ TEST_F(MasterTest, TestRegisterAndHeartbeat) {
   ASSERT_FALSE(master_->ts_manager()->LookupTSByUUID(kTsUUID, &ts_desc));
 
   // Register the fake TS, without sending any tablet report.
-  TSRegistrationPB fake_reg;
+  ServerRegistrationPB fake_reg;
   MakeHostPortPB("localhost", 1000, fake_reg.add_rpc_addresses());
   MakeHostPortPB("localhost", 2000, fake_reg.add_http_addresses());
 
@@ -165,7 +165,7 @@ TEST_F(MasterTest, TestRegisterAndHeartbeat) {
 
   master_->ts_manager()->GetAllDescriptors(&descs);
   ASSERT_EQ(1, descs.size()) << "Should have registered the TS";
-  TSRegistrationPB reg;
+  ServerRegistrationPB reg;
   descs[0]->GetRegistration(&reg);
   ASSERT_EQ(fake_reg.DebugString(), reg.DebugString()) << "Master got different registration";
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/master/master.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/master.cc b/src/kudu/master/master.cc
index 5a2c099..8d592ce 100644
--- a/src/kudu/master/master.cc
+++ b/src/kudu/master/master.cc
@@ -44,6 +44,7 @@
 #include "kudu/util/net/sockaddr.h"
 #include "kudu/util/status.h"
 #include "kudu/util/threadpool.h"
+#include "kudu/util/version_info.h"
 
 DEFINE_int32(master_registration_rpc_timeout_ms, 1500,
              "Timeout for retrieving master registration over RPC.");
@@ -207,6 +208,7 @@ Status Master::InitMasterRegistration() {
   vector<Sockaddr> http_addrs;
   web_server()->GetBoundAddresses(&http_addrs);
   RETURN_NOT_OK(AddHostPortPBs(http_addrs, reg.mutable_http_addresses()));
+  reg.set_software_version(VersionInfo::GetShortVersionString());
 
   registration_.Swap(&reg);
   registration_initialized_.store(true);

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/master/master.h
----------------------------------------------------------------------
diff --git a/src/kudu/master/master.h b/src/kudu/master/master.h
index b3296b5..753bea8 100644
--- a/src/kudu/master/master.h
+++ b/src/kudu/master/master.h
@@ -22,6 +22,7 @@
 #include <string>
 #include <vector>
 
+#include "kudu/common/wire_protocol.h"
 #include "kudu/gutil/gscoped_ptr.h"
 #include "kudu/gutil/macros.h"
 #include "kudu/master/master_options.h"
@@ -36,7 +37,6 @@ namespace kudu {
 class MaintenanceManager;
 class RpcServer;
 struct RpcServerOptions;
-class ServerEntryPB;
 class ThreadPool;
 
 namespace rpc {

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/master/master.proto
----------------------------------------------------------------------
diff --git a/src/kudu/master/master.proto b/src/kudu/master/master.proto
index 5b207a2..7b013c4 100644
--- a/src/kudu/master/master.proto
+++ b/src/kudu/master/master.proto
@@ -175,15 +175,6 @@ message PingRequestPB {
 message PingResponsePB {
 }
 
-// Sent by the TS when it first heartbeats with a master. This sends the
-// master all of the necessary information about the current instance
-// of the TS.
-message TSRegistrationPB {
-  repeated HostPortPB rpc_addresses = 1;
-  repeated HostPortPB http_addresses = 2;
-  optional string software_version = 3;
-}
-
 message ReportedTabletPB {
   required bytes tablet_id = 1;
   optional tablet.TabletStatePB state = 2 [ default = UNKNOWN ];
@@ -239,7 +230,7 @@ message TSHeartbeatRequestPB {
 
   // Sent upon start-up of the TS, or in response to 'needs_reregister' on a heartbeat
   // response.
-  optional TSRegistrationPB registration = 2;
+  optional ServerRegistrationPB registration = 2;
 
   // Sent when the tablet information has changed, or in response to
   // 'needs_full_tablet_report'.
@@ -549,7 +540,7 @@ message ListTabletServersResponsePB {
 
   message Entry {
     required NodeInstancePB instance_id = 1;
-    optional TSRegistrationPB registration = 2;
+    optional ServerRegistrationPB registration = 2;
     optional int32 millis_since_heartbeat = 3;
   }
   repeated Entry servers = 2;
@@ -560,7 +551,6 @@ message ListTabletServersResponsePB {
 message GetMasterRegistrationRequestPB {
 }
 
-// TODO: Just use ServerRegistration here.
 message GetMasterRegistrationResponsePB {
   // Node instance information is always set.
   required NodeInstancePB instance_id = 1;

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/master/master_service.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/master_service.cc b/src/kudu/master/master_service.cc
index d39547a..4bacb9b 100644
--- a/src/kudu/master/master_service.cc
+++ b/src/kudu/master/master_service.cc
@@ -154,7 +154,7 @@ void MasterServiceImpl::GetTabletLocations(const GetTabletLocationsRequestPB*
re
     SleepFor(MonoDelta::FromMilliseconds(FLAGS_master_inject_latency_on_tablet_lookups_ms));
   }
 
-  TSRegistrationPB reg;
+  ServerRegistrationPB reg;
   vector<TSDescriptor*> locs;
   for (const string& tablet_id : req->tablet_ids()) {
     // TODO: once we have catalog data. ACL checks would also go here, probably.

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/master/ts_descriptor.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/ts_descriptor.cc b/src/kudu/master/ts_descriptor.cc
index 1f3ef11..1651c0b 100644
--- a/src/kudu/master/ts_descriptor.cc
+++ b/src/kudu/master/ts_descriptor.cc
@@ -36,7 +36,7 @@ namespace kudu {
 namespace master {
 
 Status TSDescriptor::RegisterNew(const NodeInstancePB& instance,
-                                 const TSRegistrationPB& registration,
+                                 const ServerRegistrationPB& registration,
                                  shared_ptr<TSDescriptor>* desc) {
   shared_ptr<TSDescriptor> ret(make_shared<TSDescriptor>(instance.permanent_uuid()));
   RETURN_NOT_OK(ret->Register(instance, registration));
@@ -78,7 +78,7 @@ static bool HostPortPBsEqual(const google::protobuf::RepeatedPtrField<HostPortPB
 }
 
 Status TSDescriptor::Register(const NodeInstancePB& instance,
-                              const TSRegistrationPB& registration) {
+                              const ServerRegistrationPB& registration) {
   std::lock_guard<simple_spinlock> l(lock_);
   CHECK_EQ(instance.permanent_uuid(), permanent_uuid_);
 
@@ -111,7 +111,7 @@ Status TSDescriptor::Register(const NodeInstancePB& instance,
   }
 
   latest_seqno_ = instance.instance_seqno();
-  registration_.reset(new TSRegistrationPB(registration));
+  registration_.reset(new ServerRegistrationPB(registration));
   ts_admin_proxy_.reset();
   consensus_proxy_.reset();
 
@@ -163,7 +163,7 @@ double TSDescriptor::RecentReplicaCreations() {
   return recent_replica_creations_;
 }
 
-void TSDescriptor::GetRegistration(TSRegistrationPB* reg) const {
+void TSDescriptor::GetRegistration(ServerRegistrationPB* reg) const {
   std::lock_guard<simple_spinlock> l(lock_);
   CHECK(registration_) << "No registration";
   CHECK_NOTNULL(reg)->CopyFrom(*registration_);

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/master/ts_descriptor.h
----------------------------------------------------------------------
diff --git a/src/kudu/master/ts_descriptor.h b/src/kudu/master/ts_descriptor.h
index 1a571f2..60c30bc 100644
--- a/src/kudu/master/ts_descriptor.h
+++ b/src/kudu/master/ts_descriptor.h
@@ -31,6 +31,7 @@ namespace kudu {
 
 class NodeInstancePB;
 class Sockaddr;
+class ServerRegistrationPB;
 
 namespace consensus {
 class ConsensusServiceProxy;
@@ -46,8 +47,6 @@ class TabletServerAdminServiceProxy;
 
 namespace master {
 
-class TSRegistrationPB;
-
 // Master-side view of a single tablet server.
 //
 // Tracks the last heartbeat, status, instance identifier, etc.
@@ -55,7 +54,7 @@ class TSRegistrationPB;
 class TSDescriptor {
  public:
   static Status RegisterNew(const NodeInstancePB& instance,
-                            const TSRegistrationPB& registration,
+                            const ServerRegistrationPB& registration,
                             std::shared_ptr<TSDescriptor>* desc);
 
   virtual ~TSDescriptor();
@@ -69,7 +68,7 @@ class TSDescriptor {
 
   // Register this tablet server.
   Status Register(const NodeInstancePB& instance,
-                  const TSRegistrationPB& registration);
+                  const ServerRegistrationPB& registration);
 
   const std::string &permanent_uuid() const { return permanent_uuid_; }
   int64_t latest_seqno() const;
@@ -77,7 +76,7 @@ class TSDescriptor {
   // Copy the current registration info into the given PB object.
   // A safe copy is returned because the internal Registration object
   // may be mutated at any point if the tablet server re-registers.
-  void GetRegistration(TSRegistrationPB* reg) const;
+  void GetRegistration(ServerRegistrationPB* reg) const;
 
   void GetNodeInstancePB(NodeInstancePB* instance_pb) const;
 
@@ -138,7 +137,7 @@ class TSDescriptor {
   // The number of live replicas on this host, from the last heartbeat.
   int num_live_replicas_;
 
-  gscoped_ptr<TSRegistrationPB> registration_;
+  gscoped_ptr<ServerRegistrationPB> registration_;
 
   std::shared_ptr<tserver::TabletServerAdminServiceProxy> ts_admin_proxy_;
   std::shared_ptr<consensus::ConsensusServiceProxy> consensus_proxy_;

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/master/ts_manager.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/ts_manager.cc b/src/kudu/master/ts_manager.cc
index f7601ac..052b503 100644
--- a/src/kudu/master/ts_manager.cc
+++ b/src/kudu/master/ts_manager.cc
@@ -71,7 +71,7 @@ bool TSManager::LookupTSByUUID(const string& uuid,
 }
 
 Status TSManager::RegisterTS(const NodeInstancePB& instance,
-                             const TSRegistrationPB& registration,
+                             const ServerRegistrationPB& registration,
                              std::shared_ptr<TSDescriptor>* desc) {
   std::lock_guard<rw_spinlock> l(lock_);
   const string& uuid = instance.permanent_uuid();

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/master/ts_manager.h
----------------------------------------------------------------------
diff --git a/src/kudu/master/ts_manager.h b/src/kudu/master/ts_manager.h
index 52d0b24..9e06039 100644
--- a/src/kudu/master/ts_manager.h
+++ b/src/kudu/master/ts_manager.h
@@ -30,11 +30,11 @@
 namespace kudu {
 
 class NodeInstancePB;
+class ServerRegistrationPB;
 
 namespace master {
 
 class TSDescriptor;
-class TSRegistrationPB;
 
 typedef std::vector<std::shared_ptr<TSDescriptor> > TSDescriptorVector;
 
@@ -70,7 +70,7 @@ class TSManager {
   //
   // If successful, *desc reset to the registered descriptor.
   Status RegisterTS(const NodeInstancePB& instance,
-                    const TSRegistrationPB& registration,
+                    const ServerRegistrationPB& registration,
                     std::shared_ptr<TSDescriptor>* desc);
 
   // Return all of the currently registered TS descriptors into the provided

http://git-wip-us.apache.org/repos/asf/kudu/blob/d4b6520b/src/kudu/tserver/heartbeater.cc
----------------------------------------------------------------------
diff --git a/src/kudu/tserver/heartbeater.cc b/src/kudu/tserver/heartbeater.cc
index d56a8ca..231539b 100644
--- a/src/kudu/tserver/heartbeater.cc
+++ b/src/kudu/tserver/heartbeater.cc
@@ -114,7 +114,7 @@ class Heartbeater::Thread {
   int GetMinimumHeartbeatMillis() const;
   int GetMillisUntilNextHeartbeat() const;
   Status DoHeartbeat();
-  Status SetupRegistration(master::TSRegistrationPB* reg);
+  Status SetupRegistration(ServerRegistrationPB* reg);
   void SetupCommonField(master::TSToMasterCommonPB* common);
   bool IsCurrentThread() const;
 
@@ -300,7 +300,7 @@ void Heartbeater::Thread::SetupCommonField(master::TSToMasterCommonPB*
common) {
   common->mutable_ts_instance()->CopyFrom(server_->instance_pb());
 }
 
-Status Heartbeater::Thread::SetupRegistration(master::TSRegistrationPB* reg) {
+Status Heartbeater::Thread::SetupRegistration(ServerRegistrationPB* reg) {
   reg->Clear();
 
   vector<Sockaddr> addrs;


Mime
View raw message