You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by ad...@apache.org on 2017/08/24 05:03:31 UTC

kudu git commit: KUDU-2039 Fix the table count in the /tables page of master webUI

Repository: kudu
Updated Branches:
  refs/heads/master 5bca7d8ba -> 0dab9796d


KUDU-2039 Fix the table count in the /tables page of master webUI

The table count that was displayed on the webUI does not eliminate
the ones that are deleted. Added a check to see if the table's state
is running and then updated the count.

Change-Id: I03c2fa1e3f26a9927d4b748a49dd5cee22d8f9d5
Reviewed-on: http://gerrit.cloudera.org:8080/7568
Reviewed-by: Adar Dembo <ad...@cloudera.com>
Tested-by: Kudu Jenkins


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/0dab9796
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/0dab9796
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/0dab9796

Branch: refs/heads/master
Commit: 0dab9796d53747cef0f2fcd8100d0e912f682c32
Parents: 5bca7d8
Author: abhishektalluri123 <ab...@gmail.com>
Authored: Wed Aug 2 15:57:17 2017 -0400
Committer: Adar Dembo <ad...@cloudera.com>
Committed: Thu Aug 24 05:03:09 2017 +0000

----------------------------------------------------------------------
 src/kudu/master/master-path-handlers.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/0dab9796/src/kudu/master/master-path-handlers.cc
----------------------------------------------------------------------
diff --git a/src/kudu/master/master-path-handlers.cc b/src/kudu/master/master-path-handlers.cc
index 35d67fd..b4fa7c8 100644
--- a/src/kudu/master/master-path-handlers.cc
+++ b/src/kudu/master/master-path-handlers.cc
@@ -149,14 +149,14 @@ void MasterPathHandlers::HandleCatalogManager(const Webserver::WebRequest& req,
 
   std::vector<scoped_refptr<TableInfo>> tables;
   master_->catalog_manager()->GetAllTables(&tables);
-  (*output).Set<int64_t>("num_tables", tables.size());
-
+  int num_running_tables = 0;
   EasyJson tables_json = output->Set("tables", EasyJson::kArray);
   for (const scoped_refptr<TableInfo>& table : tables) {
     TableMetadataLock l(table.get(), TableMetadataLock::READ);
     if (!l.data().is_running()) {
       continue;
     }
+    num_running_tables++; // Table count excluding deleted ones
     string state = SysTablesEntryPB_State_Name(l.data().pb.state());
     Capitalize(&state);
     EasyJson table_json = tables_json.PushBack(EasyJson::kObject);
@@ -165,6 +165,7 @@ void MasterPathHandlers::HandleCatalogManager(const Webserver::WebRequest& req,
     table_json["state"] = state;
     table_json["message"] = EscapeForHtmlToString(l.data().pb.state_msg());
   }
+  (*output).Set<int64_t>("num_tables", num_running_tables);
 }
 
 namespace {