tool: feedback from clang-tidy Tidy Bot is going to steal our jobs! [1]
1. https://en.wikipedia.org/wiki/John_Henry_(folklore) Change-Id: Ice35f5735952532d2051ec634fc193d4050d8b68 Reviewed-on: http://gerrit.cloudera.org:8080/4423 Reviewed-by: Todd Lipcon <[email protected]> Tested-by: Todd Lipcon <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/136184cd Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/136184cd Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/136184cd Branch: refs/heads/master Commit: 136184cdfc5c015fd3dccd2a97c43af241366e2b Parents: 590207d Author: Adar Dembo <[email protected]> Authored: Wed Sep 14 18:31:41 2016 -0700 Committer: Todd Lipcon <[email protected]> Committed: Thu Sep 15 05:06:37 2016 +0000 ---------------------------------------------------------------------- src/kudu/tools/tool_action_common.cc | 1 - src/kudu/tools/tool_action_remote_replica.cc | 13 ++++--------- src/kudu/tools/tool_action_tablet.cc | 1 - 3 files changed, 4 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/136184cd/src/kudu/tools/tool_action_common.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/tool_action_common.cc b/src/kudu/tools/tool_action_common.cc index bbcf981..867cc2a 100644 --- a/src/kudu/tools/tool_action_common.cc +++ b/src/kudu/tools/tool_action_common.cc @@ -88,7 +88,6 @@ using server::ServerStatusPB; using server::SetFlagRequestPB; using server::SetFlagResponsePB; using std::cout; -using std::cerr; using std::endl; using std::shared_ptr; using std::string; http://git-wip-us.apache.org/repos/asf/kudu/blob/136184cd/src/kudu/tools/tool_action_remote_replica.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/tool_action_remote_replica.cc b/src/kudu/tools/tool_action_remote_replica.cc index 8ee7cb9..02f973e 100644 --- a/src/kudu/tools/tool_action_remote_replica.cc +++ b/src/kudu/tools/tool_action_remote_replica.cc @@ -35,6 +35,7 @@ #include "kudu/gutil/gscoped_ptr.h" #include "kudu/gutil/map-util.h" #include "kudu/gutil/strings/human_readable.h" +#include "kudu/rpc/rpc_controller.h" #include "kudu/server/server_base.pb.h" #include "kudu/tablet/tablet.pb.h" #include "kudu/tools/tool_action_common.h" @@ -42,8 +43,6 @@ #include "kudu/tserver/tserver.pb.h" #include "kudu/tserver/tserver_admin.proxy.h" #include "kudu/tserver/tserver_service.proxy.h" -#include "kudu/rpc/messenger.h" -#include "kudu/rpc/rpc_controller.h" #include "kudu/util/net/net_util.h" #include "kudu/util/net/sockaddr.h" #include "kudu/util/status.h" @@ -56,14 +55,11 @@ namespace tools { using client::KuduRowResult; using client::KuduScanBatch; using client::KuduSchema; -using rpc::Messenger; -using rpc::MessengerBuilder; using rpc::RpcController; using server::ServerStatusPB; using std::cerr; using std::cout; using std::endl; -using std::shared_ptr; using std::string; using std::unique_ptr; using std::vector; @@ -176,7 +172,7 @@ Status CheckReplicas(const RunnerContext& context) { bool all_running = true; for (const auto& r : replicas) { - TabletStatusPB rs = r.tablet_status(); + const TabletStatusPB& rs = r.tablet_status(); if (rs.state() != tablet::RUNNING) { cerr << "Tablet id: " << rs.tablet_id() << " is " << tablet::TabletStatePB_Name(rs.state()) << endl; @@ -187,9 +183,8 @@ Status CheckReplicas(const RunnerContext& context) { if (all_running) { cout << "All tablets are running" << endl; return Status::OK(); - } else { - return Status::IllegalState("Not all tablets are running"); } + return Status::IllegalState("Not all tablets are running"); } Status DeleteReplica(const RunnerContext& context) { @@ -271,7 +266,7 @@ Status ListReplicas(const RunnerContext& context) { Partition partition; Partition::FromPB(rs.partition(), &partition); - string state = tablet::TabletStatePB_Name(rs.state()); + const string& state = tablet::TabletStatePB_Name(rs.state()); cout << "Tablet id: " << rs.tablet_id() << endl; cout << "State: " << state << endl; cout << "Table name: " << rs.table_name() << endl; http://git-wip-us.apache.org/repos/asf/kudu/blob/136184cd/src/kudu/tools/tool_action_tablet.cc ---------------------------------------------------------------------- diff --git a/src/kudu/tools/tool_action_tablet.cc b/src/kudu/tools/tool_action_tablet.cc index 86e3df7..8ba5340 100644 --- a/src/kudu/tools/tool_action_tablet.cc +++ b/src/kudu/tools/tool_action_tablet.cc @@ -47,7 +47,6 @@ using consensus::ChangeConfigType; using consensus::ConsensusServiceProxy; using consensus::RaftPeerPB; using rpc::RpcController; -using std::shared_ptr; using std::string; using std::unique_ptr; using std::vector;
