From b6ad337ea15a9957a0a1089ba4dd331013d25f3a Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Tue, 3 May 2011 05:48:37 +0000 Subject: [PATCH] HBASE-3849 Fix master ui; hbase-1502 broke requests/second git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1098919 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../apache/hadoop/hbase/master/ServerManager.java | 2 +- src/main/resources/hbase-webapps/master/master.jsp | 12 ++++++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index d93eb8542fb..76384bc853f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -97,6 +97,7 @@ Release 0.91.0 - Unreleased no RegionObserver registered (Himanshu Vashishtha) HBASE-3847 Turn off DEBUG logging of RPCs in WriteableRPCEngine on TRUNK HBASE-3777 Redefine Identity Of HBase Configuration (Karthick Sankarachary) + HBASE-3849 Fix master ui; hbase-1502 broke requests/second IMPROVEMENTS HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack) diff --git a/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java b/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java index 32e7c11b209..5786b42289c 100644 --- a/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java +++ b/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java @@ -238,7 +238,7 @@ public class ServerManager { * @return HServerLoad if serverName is known else null */ public HServerLoad getLoad(final ServerName serverName) { - return this.onlineServers.get(serverName.toString()); + return this.onlineServers.get(serverName); } /** diff --git a/src/main/resources/hbase-webapps/master/master.jsp b/src/main/resources/hbase-webapps/master/master.jsp index 2ed58d05ecb..91c633870a2 100644 --- a/src/main/resources/hbase-webapps/master/master.jsp +++ b/src/main/resources/hbase-webapps/master/master.jsp @@ -8,6 +8,7 @@ import="org.apache.hadoop.hbase.master.HMaster" import="org.apache.hadoop.hbase.HConstants" import="org.apache.hadoop.hbase.ServerName" + import="org.apache.hadoop.hbase.HServerLoad" import="org.apache.hadoop.hbase.client.HBaseAdmin" import="org.apache.hadoop.hbase.client.HConnectionManager" import="org.apache.hadoop.hbase.HTableDescriptor" %><% @@ -148,12 +149,15 @@ // HARDCODED FOR NOW; FIX -- READ FROM ZK String hostname = serverName.getHostname() + ":60020"; String url = "http://" + hostname + "/"; - // TODO: FIX - totalRegions += 0; - totalRequests += 0; + HServerLoad hsl = master.getServerManager().getLoad(serverName); + String loadStr = hsl == null? "-": hsl.toString(); + if (hsl != null) { + totalRegions += hsl.getNumberOfRegions(); + totalRequests += hsl.getNumberOfRequests(); + } long startCode = serverName.getStartcode(); %> -<%= hostname %><%= startCode %><%= 0 %> +<%= hostname %><%= startCode %><%= serverName %><%= loadStr %> <% } %> Total: servers: <%= servers.size() %> requests=<%= totalRequests %>, regions=<%= totalRegions %>