helifu has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/13435 )

Change subject: [KUDU-2825]add a column named role in 'kudu master list' add a 
column name role in 'kudu master list' to show the role of each master?roles 
include master,follower,learner, nonparticipant and unknowrole
......................................................................


Patch Set 1:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/13435/1/src/kudu/tools/tool_action_master.cc
File src/kudu/tools/tool_action_master.cc:

http://gerrit.cloudera.org:8080/#/c/13435/1/src/kudu/tools/tool_action_master.cc@170
PS1, Line 170: for (const auto& master : masters) {
             :             std::string master_role = "";
             :             switch(master.role()){
             :                 case 
RaftPeerPB_Role::RaftPeerPB_Role_UNKNOWN_ROLE:
             :                     master_role="unknowrole";
             :                     break;
             :                 case RaftPeerPB_Role::RaftPeerPB_Role_FOLLOWER:
             :                     master_role="follower";
             :                     break;
             :                 case RaftPeerPB_Role::RaftPeerPB_Role_LEADER:
             :                     master_role="leader";
             :                     break;
             :                 case RaftPeerPB_Role::RaftPeerPB_Role_LEARNER:
             :                     master_role="learner";
             :                     break;
             :                 case 
RaftPeerPB_Role::RaftPeerPB_Role_NON_PARTICIPANT:
             :                     master_role="nonparticipant";
             :                     break;
             :                 default:
             :                     master_role="unknowrole";
             :                 }
             :             values.push_back(master_role);
             :         }
I think we can use the protobuf function below instead, for example:
for (const auto& master : masters) {
  values.emplace_back(consensus::RaftPeerPB_Role_Name(master.role));
}



--
To view, visit http://gerrit.cloudera.org:8080/13435
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I29da5024ec59d3fb1d576247b2f0f7af0e7968dc
Gerrit-Change-Number: 13435
Gerrit-PatchSet: 1
Gerrit-Owner: GuangchaoDeng <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: helifu <[email protected]>
Gerrit-Comment-Date: Sat, 25 May 2019 14:00:51 +0000
Gerrit-HasComments: Yes

Reply via email to