hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1099101 - in /hbase/trunk/src/main/resources/hbase-webapps/master: master.jsp table.jsp
Date Tue, 03 May 2011 15:54:09 GMT
Author: stack
Date: Tue May  3 15:54:08 2011
New Revision: 1099101

URL: http://svn.apache.org/viewvc?rev=1099101&view=rev
Log:
Fix table.jsp so it shows region locations and counts -- just before we replace all this jsp
stuff.  Location was broke by 1502

Modified:
    hbase/trunk/src/main/resources/hbase-webapps/master/master.jsp
    hbase/trunk/src/main/resources/hbase-webapps/master/table.jsp

Modified: hbase/trunk/src/main/resources/hbase-webapps/master/master.jsp
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/resources/hbase-webapps/master/master.jsp?rev=1099101&r1=1099100&r2=1099101&view=diff
==============================================================================
--- hbase/trunk/src/main/resources/hbase-webapps/master/master.jsp (original)
+++ hbase/trunk/src/main/resources/hbase-webapps/master/master.jsp Tue May  3 15:54:08 2011
@@ -146,8 +146,8 @@
 <%   ServerName [] serverNames = servers.toArray(new ServerName[servers.size()]);
      Arrays.sort(serverNames);
      for (ServerName serverName: serverNames) {
-       // HARDCODED FOR NOW; FIX -- READ FROM ZK
-       String hostname = serverName.getHostname() + ":60030";
+       int infoPort = conf.getInt("hbase.regionserver.info.port", 60030);
+       String hostname = serverName.getHostname() + ":" + infoPort;
        String url = "http://" + hostname + "/";
        HServerLoad hsl = master.getServerManager().getLoad(serverName);
        String loadStr = hsl == null? "-": hsl.toString();

Modified: hbase/trunk/src/main/resources/hbase-webapps/master/table.jsp
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/resources/hbase-webapps/master/table.jsp?rev=1099101&r1=1099100&r2=1099101&view=diff
==============================================================================
--- hbase/trunk/src/main/resources/hbase-webapps/master/table.jsp (original)
+++ hbase/trunk/src/main/resources/hbase-webapps/master/table.jsp Tue May  3 15:54:08 2011
@@ -8,6 +8,7 @@
   import="org.apache.hadoop.hbase.HRegionInfo"
   import="org.apache.hadoop.hbase.ServerName"
   import="org.apache.hadoop.hbase.HServerAddress"
+  import="org.apache.hadoop.hbase.ServerName"
   import="org.apache.hadoop.hbase.HServerInfo"
   import="org.apache.hadoop.hbase.HServerLoad"
   import="org.apache.hadoop.hbase.HServerLoad.RegionLoad"
@@ -29,6 +30,9 @@
   if (showFragmentation) {
       frags = FSUtils.getTableFragmentation(master);
   }
+  // HARDCODED FOR NOW TODO: FIX GET FROM ZK
+  // This port might be wrong if RS actually ended up using something else.
+  int infoPort = conf.getInt("hbase.regionserver.info.port", 60030);
 %>
 
 <?xml version="1.0" encoding="UTF-8" ?>
@@ -84,9 +88,7 @@
   if(tableName.equals(Bytes.toString(HConstants.ROOT_TABLE_NAME))) {
 %>
 <%= tableHeader %>
-// HARDCODED FOR NOW TODO: FIX GET FROM ZK
 <%
-  int infoPort = 60020; // HARDCODED FOR NOW -- TODO FIX
   String url = "http://" + rl.getHostname() + ":" + infoPort + "/";
 %>
 <tr>
@@ -106,7 +108,6 @@
   HRegionInfo meta = HRegionInfo.FIRST_META_REGIONINFO;
   ServerName metaLocation = master.getCatalogTracker().getMetaLocation();
   for (int i = 0; i < 1; i++) {
-    int infoPort = 60020; // HARDCODED FOR NOW -- TODO FIX
     String url = "http://" + metaLocation.getHostname() + ":" + infoPort + "/";
 %>
 <tr>
@@ -139,16 +140,15 @@
 </table>
 <%
   Map<String, Integer> regDistribution = new HashMap<String, Integer>();
-  Map<HRegionInfo, HServerAddress> regions = table.getRegionsInfo();
+  Map<HRegionInfo, ServerName> regions = table.getRegionLocations();
   if(regions != null && regions.size() > 0) { %>
 <%=     tableHeader %>
 <%
-  for (Map.Entry<HRegionInfo, HServerAddress> hriEntry : regions.entrySet()) {
+  for (Map.Entry<HRegionInfo, ServerName> hriEntry : regions.entrySet()) {
     HRegionInfo regionInfo = hriEntry.getKey();
-    HServerAddress addr = hriEntry.getValue();
+    ServerName addr = hriEntry.getValue();
     long req = 0;
 
-    int infoPort = 0;
     String urlRegionServer = null;
 
     if (addr != null) {
@@ -159,9 +159,8 @@
           req = map.get(regionInfo.getRegionName()).getRequestsCount();
         }
         // This port might be wrong if RS actually ended up using something else.
-        int port = conf.getInt("hbase.regionserver.info.port", 60030);
         urlRegionServer =
-            "http://" + addr.getHostname().toString() + ":" + port + "/";
+            "http://" + addr.getHostname().toString() + ":" + infoPort + "/";
         Integer i = regDistribution.get(urlRegionServer);
         if (null == i) i = new Integer(0);
         regDistribution.put(urlRegionServer, i+1);



Mime
View raw message