Skip to content

Commit

Permalink
Change 'tablets' page to make local peer bold
Browse files Browse the repository at this point in the history
Previously, we bolded the LEADER replica, but that's not particularly useful.
Usually, we're more interested in seeing the current role of the host whose web
server we are hitting.

Tested manually on a 3-node cluster.

Change-Id: Idec3b7e8d37194f5e9af9a0c3347e428287e07ab
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/6878
Tested-by: jenkins
Reviewed-by: Jean-Daniel Cryans <[email protected]>
  • Loading branch information
toddlipcon authored and Jean-Daniel Cryans committed Jun 9, 2015
1 parent 26c9799 commit 3261756
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/kudu/tserver/tserver-path-handlers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ string TabletServerPathHandlers::ConsensusStatePBToHtml(const ConsensusStatePB&
string peer_addr_or_uuid =
peer.has_last_known_addr() ? peer.last_known_addr().host() : peer.permanent_uuid();
peer_addr_or_uuid = EscapeForHtmlToString(peer_addr_or_uuid);
if (peer.permanent_uuid() == cstate.leader_uuid()) {
html << Substitute(" <li><b>LEADER: $0</b></li>\n",
peer_addr_or_uuid);
} else {
html << Substitute(" <li>$0: $1</li>\n",
RaftPeerPB::Role_Name(GetConsensusRole(peer.permanent_uuid(), cstate)),
peer_addr_or_uuid);
string role_name = RaftPeerPB::Role_Name(GetConsensusRole(peer.permanent_uuid(), cstate));
string formatted = Substitute("$0: $1", role_name, peer_addr_or_uuid);
// Make the local peer bold.
if (peer.permanent_uuid() == tserver_->instance_pb().permanent_uuid()) {
formatted = Substitute("<b>$0</b>", formatted);
}

html << Substitute(" <li>$0</li>\n", formatted);
}
html << "</ul>\n";
return html.str();
Expand Down

0 comments on commit 3261756

Please sign in to comment.