This is an automated email from the ASF dual-hosted git repository.

laiyingchun pushed a commit to branch branch-1.17.x
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 95119055741496d3611ef0cff7cac4b018b015df
Author: Alexey Serbin <[email protected]>
AuthorDate: Mon May 22 13:09:41 2023 -0700

    [tools] add bound_http_address into DaemonInfoPB
    
    This patch adds bound_http_address field into the DaemonInfoPB message.
    The new field will be used by test scenarios in follow-up changelists.
    
    Change-Id: I746876e961a9fe42fb20c72c6ccff4afb3fb7943
    Reviewed-on: http://gerrit.cloudera.org:8080/19912
    Tested-by: Alexey Serbin <[email protected]>
    Reviewed-by: Abhishek Chennaka <[email protected]>
    (cherry picked from commit eae0ebf91e94be8341a18cfbb8e4c9dca5d6ef47)
    Reviewed-on: http://gerrit.cloudera.org:8080/19985
    Reviewed-by: Yingchun Lai <[email protected]>
    Tested-by: Yingchun Lai <[email protected]>
---
 src/kudu/tools/tool.proto          |  3 +++
 src/kudu/tools/tool_action_test.cc | 10 ++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/kudu/tools/tool.proto b/src/kudu/tools/tool.proto
index 1fa7878a1..b98345bba 100644
--- a/src/kudu/tools/tool.proto
+++ b/src/kudu/tools/tool.proto
@@ -153,6 +153,9 @@ message DaemonInfoPB {
 
   // Daemon's bound RPC address.
   optional HostPortPB bound_rpc_address = 2;
+
+  // Bound address of the embedded web server.
+  optional HostPortPB bound_http_address = 3;
 }
 
 // Response to a GetMastersRequestPB.
diff --git a/src/kudu/tools/tool_action_test.cc 
b/src/kudu/tools/tool_action_test.cc
index 11153aa98..25f6787b0 100644
--- a/src/kudu/tools/tool_action_test.cc
+++ b/src/kudu/tools/tool_action_test.cc
@@ -244,11 +244,12 @@ Status ProcessRequest(const ControlShellRequestPB& req,
     {
       RETURN_NOT_OK(CheckClusterExists(*cluster));
       for (int i = 0; i < (*cluster)->num_masters(); i++) {
-        HostPortPB pb = 
HostPortToPB((*cluster)->master(i)->bound_rpc_hostport());
+        const auto* m = (*cluster)->master(i);
         DaemonInfoPB* info = 
resp->mutable_get_masters()->mutable_masters()->Add();
         info->mutable_id()->set_type(MASTER);
         info->mutable_id()->set_index(i);
-        *info->mutable_bound_rpc_address() = std::move(pb);
+        *info->mutable_bound_rpc_address() = 
HostPortToPB(m->bound_rpc_hostport());
+        *info->mutable_bound_http_address() = 
HostPortToPB(m->bound_http_hostport());
       }
       break;
     }
@@ -256,11 +257,12 @@ Status ProcessRequest(const ControlShellRequestPB& req,
     {
       RETURN_NOT_OK(CheckClusterExists(*cluster));
       for (int i = 0; i < (*cluster)->num_tablet_servers(); i++) {
-        HostPortPB pb = 
HostPortToPB((*cluster)->tablet_server(i)->bound_rpc_hostport());
+        const auto* ts = (*cluster)->tablet_server(i);
         DaemonInfoPB* info = 
resp->mutable_get_tservers()->mutable_tservers()->Add();
         info->mutable_id()->set_type(TSERVER);
         info->mutable_id()->set_index(i);
-        *info->mutable_bound_rpc_address() = std::move(pb);
+        *info->mutable_bound_rpc_address() = 
HostPortToPB(ts->bound_rpc_hostport());
+        *info->mutable_bound_http_address() = 
HostPortToPB(ts->bound_http_hostport());
       }
       break;
     }

Reply via email to