Alexey Serbin has posted comments on this change.

Change subject: [web-ui] KUDU-1619 Separate tables for live and dead tservers 
on /tablet-servers
......................................................................


Patch Set 5:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/4450/5/src/kudu/master/master-path-handlers.cc
File src/kudu/master/master-path-handlers.cc:

PS5, Line 111:   if (!live_tserver_rows.empty()) {
             :    *output << "<h4>Live Tablet Servers</h4>\n";
             :    *output << "<table class='table table-striped'>\n";
             :    *output << "<tr><th>UUID</th><th>Time since 
heartbeat</th><th>Registration</th></tr>\n";
             :    *output << JoinStrings(live_tserver_rows, "\n");
             :    *output << "</table>\n";
             :   }
Consider making a function out of it (e.g., a lambda function) and re-using it 
for generating both tables.

Something like

  auto generate_table = [](const vector<string>& rows,
                           const string& header,
                           ostream* output) {
    if (!rows.empty()) {
      *output << "<h4>" << header << "</h4>\n";
      *output << "<table class='table table-striped'>\n";
      *output << "<tr><th>UUID</th><th>Time since 
heartbeat</th><th>Registration</th></tr>\n";
      *output << JoinStrings(rows, "\n");
      *output << "</table>\n";
    }
  };

  generate_table(live_tserver_rows, "Live Tablet Servers", output);
  generate_table(dead_tserver_rows, "Dead Tablet Servers", output);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I479fad5c2db61949f7d67bde7901e7a59c60b786
Gerrit-PatchSet: 5
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Ninad Shringarpure <ni...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot
Gerrit-Reviewer: Todd Lipcon <t...@apache.org>
Gerrit-HasComments: Yes

Reply via email to