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 14dec6d  [tool] fix inconsistent definition among tool_action_common 
header and src
14dec6d is described below

commit 14dec6d9b185066fda0f584f538a894937679371
Author: liguohao <[email protected]>
AuthorDate: Wed Oct 21 16:43:51 2020 +0800

    [tool] fix inconsistent definition among tool_action_common header and src
    
    Change-Id: I81fe9799be01608c0984d6266c5a1163cfe41ada
    Reviewed-on: http://gerrit.cloudera.org:8080/16618
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <[email protected]>
---
 src/kudu/tools/tool_action_common.cc | 67 ++++++++++++++++++++----------------
 src/kudu/tools/tool_action_common.h  | 16 ---------
 2 files changed, 38 insertions(+), 45 deletions(-)

diff --git a/src/kudu/tools/tool_action_common.cc 
b/src/kudu/tools/tool_action_common.cc
index 6086508..314db9c 100644
--- a/src/kudu/tools/tool_action_common.cc
+++ b/src/kudu/tools/tool_action_common.cc
@@ -316,6 +316,44 @@ bool GetClusterName(const string& master_addresses_str, 
string* cluster_name) {
   return false;
 }
 
+// Retrieve flags from a remote server.
+//
+// If 'address' does not contain a port, 'default_port' is used instead.
+//
+// 'all_flags' controls whether all flags are returned, or only flags which are
+// explicitly set.
+//
+// 'flag_tags' is a comma-separated list of tags used to restrict which flags
+// are returned. An empty value matches all tags.
+Status GetServerFlags(const string& address,
+                      uint16_t default_port,
+                      bool all_flags,
+                      const string& flags_to_get,
+                      const string& flag_tags,
+                      vector<server::GetFlagsResponsePB_Flag>* flags) {
+  unique_ptr<GenericServiceProxy> proxy;
+  RETURN_NOT_OK(BuildProxy(address, default_port, &proxy));
+
+  GetFlagsRequestPB req;
+  GetFlagsResponsePB resp;
+  RpcController rpc;
+  rpc.set_timeout(MonoDelta::FromMilliseconds(FLAGS_timeout_ms));
+
+  req.set_all_flags(all_flags);
+  for (StringPiece tag : strings::Split(flag_tags, ",", strings::SkipEmpty())) 
{
+    req.add_tags(tag.as_string());
+  }
+  for (StringPiece flag: strings::Split(flags_to_get, ",", 
strings::SkipEmpty())) {
+    req.add_flags(flag.as_string());
+  }
+
+  RETURN_NOT_OK(proxy->GetFlags(req, &resp, &rpc));
+
+  flags->clear();
+  std::move(resp.flags().begin(), resp.flags().end(), 
std::back_inserter(*flags));
+  return Status::OK();
+}
+
 } // anonymous namespace
 
 template<class ProxyClass>
@@ -409,35 +447,6 @@ Status PrintSegment(const 
scoped_refptr<ReadableLogSegment>& segment) {
   return Status::OK();
 }
 
-Status GetServerFlags(const string& address,
-                      uint16_t default_port,
-                      bool all_flags,
-                      const string& flags_to_get,
-                      const string& flag_tags,
-                      vector<server::GetFlagsResponsePB_Flag>* flags) {
-  unique_ptr<GenericServiceProxy> proxy;
-  RETURN_NOT_OK(BuildProxy(address, default_port, &proxy));
-
-  GetFlagsRequestPB req;
-  GetFlagsResponsePB resp;
-  RpcController rpc;
-  rpc.set_timeout(MonoDelta::FromMilliseconds(FLAGS_timeout_ms));
-
-  req.set_all_flags(all_flags);
-  for (StringPiece tag : strings::Split(flag_tags, ",", strings::SkipEmpty())) 
{
-    req.add_tags(tag.as_string());
-  }
-  for (StringPiece flag: strings::Split(flags_to_get, ",", 
strings::SkipEmpty())) {
-    req.add_flags(flag.as_string());
-  }
-
-  RETURN_NOT_OK(proxy->GetFlags(req, &resp, &rpc));
-
-  flags->clear();
-  std::move(resp.flags().begin(), resp.flags().end(), 
std::back_inserter(*flags));
-  return Status::OK();
-}
-
 Status PrintServerFlags(const string& address, uint16_t default_port) {
   vector<server::GetFlagsResponsePB_Flag> flags;
   RETURN_NOT_OK(GetServerFlags(address, default_port, FLAGS_all_flags,
diff --git a/src/kudu/tools/tool_action_common.h 
b/src/kudu/tools/tool_action_common.h
index 2783af0..083a6c6 100644
--- a/src/kudu/tools/tool_action_common.h
+++ b/src/kudu/tools/tool_action_common.h
@@ -51,7 +51,6 @@ class ReadableLogSegment;
 } // namespace log
 
 namespace server {
-class GetFlagsResponsePB_Flag;
 class ServerStatusPB;
 } // namespace server
 
@@ -106,21 +105,6 @@ Status PrintServerStatus(const std::string& address, 
uint16_t default_port);
 // If 'address' does not contain a port, 'default_port' is used instead.
 Status PrintServerTimestamp(const std::string& address, uint16_t default_port);
 
-// Retrieve flags from a remote server.
-//
-// If 'address' does not contain a port, 'default_port' is used instead.
-//
-// 'all_flags' controls whether all flags are returned, or only flags which are
-// explicitly set.
-//
-// 'flag_tags' is a comma-separated list of tags used to restrict which flags
-// are returned. An empty value matches all tags.
-Status GetServerFlags(const std::string& address,
-                      uint16_t default_port,
-                      bool all_flags,
-                      const std::string& flag_tags,
-                      std::vector<server::GetFlagsResponsePB_Flag>* flags) 
WARN_UNUSED_RESULT;
-
 // Prints the values of the gflags set for the Kudu server running at 
'address'.
 //
 // If 'address' does not contain a port, 'default_port' is used instead.

Reply via email to