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

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 018394f62 [tools] remove the duplicated function GetReplicas
018394f62 is described below

commit 018394f62520b521ab7fb0d19740b06961e76deb
Author: Yingchun Lai <[email protected]>
AuthorDate: Fri Jun 2 17:02:05 2023 +0800

    [tools] remove the duplicated function GetReplicas
    
    Change-Id: I069997fa566d70fccf6df3f3decd1aa990417048
    Reviewed-on: http://gerrit.cloudera.org:8080/19998
    Tested-by: Kudu Jenkins
    Reviewed-by: Yuqi Du <[email protected]>
    Reviewed-by: Alexey Serbin <[email protected]>
---
 src/kudu/tools/tool_action_common.cc         |  4 ++++
 src/kudu/tools/tool_action_remote_replica.cc | 21 ---------------------
 2 files changed, 4 insertions(+), 21 deletions(-)

diff --git a/src/kudu/tools/tool_action_common.cc 
b/src/kudu/tools/tool_action_common.cc
index e39b506b7..5817d1bf5 100644
--- a/src/kudu/tools/tool_action_common.cc
+++ b/src/kudu/tools/tool_action_common.cc
@@ -579,6 +579,10 @@ Status GetServerStatus(const string& address, uint16_t 
default_port,
 Status GetReplicas(TabletServerServiceProxy* proxy,
                    vector<ListTabletsResponsePB::StatusAndSchemaPB>* replicas) 
{
   ListTabletsRequestPB req;
+  // Even with FLAGS_include_schema=false, don't set need_schema_info=false
+  // in the request. The reason is that the schema is still needed to decode
+  // the partition of each replica, and the partition information is pretty
+  // much always nice to have.
   req.set_need_schema_info(true);
   ListTabletsResponsePB resp;
   RpcController rpc;
diff --git a/src/kudu/tools/tool_action_remote_replica.cc 
b/src/kudu/tools/tool_action_remote_replica.cc
index 91fe78b47..ef62ac0b1 100644
--- a/src/kudu/tools/tool_action_remote_replica.cc
+++ b/src/kudu/tools/tool_action_remote_replica.cc
@@ -176,27 +176,6 @@ constexpr const char* const kPeerUUIDsArgDesc =
     "List of peer uuids to be part of new config, separated by whitespace";
 
 
-Status GetReplicas(TabletServerServiceProxy* proxy,
-                   vector<ListTabletsResponsePB::StatusAndSchemaPB>* replicas) 
{
-  ListTabletsRequestPB req;
-  ListTabletsResponsePB resp;
-  RpcController rpc;
-  rpc.set_timeout(MonoDelta::FromMilliseconds(FLAGS_timeout_ms));
-
-  // Even with FLAGS_include_schema=false, don't set need_schema_info=false
-  // in the request. The reason is that the schema is still needed to decode
-  // the partition of each replica, and the partition information is pretty
-  // much always nice to have.
-  RETURN_NOT_OK(proxy->ListTablets(req, &resp, &rpc));
-  if (resp.has_error()) {
-    return StatusFromPB(resp.error().status());
-  }
-
-  replicas->assign(resp.status_and_schema().begin(),
-                   resp.status_and_schema().end());
-  return Status::OK();
-}
-
 Status CheckReplicas(const RunnerContext& context) {
   const string& address = FindOrDie(context.required_args, kTServerAddressArg);
 

Reply via email to