Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AD27111045 for ; Thu, 31 Jul 2014 22:07:44 +0000 (UTC) Received: (qmail 44278 invoked by uid 500); 31 Jul 2014 22:07:38 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 44185 invoked by uid 500); 31 Jul 2014 22:07:38 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 43402 invoked by uid 99); 31 Jul 2014 22:07:38 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Jul 2014 22:07:38 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 39EEC951CAC; Thu, 31 Jul 2014 22:07:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: eclark@apache.org To: commits@hbase.apache.org Date: Thu, 31 Jul 2014 22:08:00 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [24/50] [abbrv] git commit: [master] Optimize AsignmentPlan page [master] Optimize AsignmentPlan page Summary: # Show current RS server when not in favored nodes. # Refactoring HTML code. Test Plan: Run TestFSUtils and connect to local http server with a browser. Reviewers: manukranthk, elliott, adela Reviewed By: adela Subscribers: hbase-eng@ Differential Revision: https://phabricator.fb.com/D1386043 git-svn-id: svn+ssh://tubbs/svnhive/hadoop/branches/titan/VENDOR.hbase/hbase-trunk@42985 e7acf4d4-3532-417f-9e73-7a9ae25a1f51 Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/cd54a011 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/cd54a011 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/cd54a011 Branch: refs/heads/0.89-fb Commit: cd54a011c92a44fabe60c1bd98eede367c763bfa Parents: a4ba645 Author: daviddeng Authored: Thu Jun 19 18:40:43 2014 +0000 Committer: Elliott Clark Committed: Thu Jul 31 14:44:23 2014 -0700 ---------------------------------------------------------------------- .../hbase-webapps/master/assignmentPlan.jsp | 130 +++++++++---------- .../resources/hbase-webapps/static/hbase.css | 16 +++ 2 files changed, 80 insertions(+), 66 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/cd54a011/src/main/resources/hbase-webapps/master/assignmentPlan.jsp ---------------------------------------------------------------------- diff --git a/src/main/resources/hbase-webapps/master/assignmentPlan.jsp b/src/main/resources/hbase-webapps/master/assignmentPlan.jsp index 059cc28..10851bf 100644 --- a/src/main/resources/hbase-webapps/master/assignmentPlan.jsp +++ b/src/main/resources/hbase-webapps/master/assignmentPlan.jsp @@ -71,82 +71,80 @@ Map> assignmentMap = plan.getAssignmentMap(); Map currentAssignment = snapShot.getRegionToRegionServerMap(); -%> - - - - - HBase Assignment Plan - - - - -

Region Assignment Plan

- -
+%> + + + + + HBase Assignment Plan + + + + +

Region Assignment Plan

+ +
-

Region Assignment Plan

+

Region Assignment Plan

<% - if (error.length() != 0) { + if (error.length() != 0) { %> -

Failed to update the favored nodes: <%=favoredNodes%> ,

-

for the region: <%=regionName%>

-

<%=error%>

+

Failed to update the favored nodes: <%=favoredNodes%> ,

+

for the region: <%= StringEscapeUtils.escapeHtml(regionName) %>

+

<%=error%>

<% - } else if (regionName != null) { + } else if (regionName != null) { %> -

Succeeded to update the favored nodes: <%=favoredNodes%> ,

-

for the region: <%=regionName%>

+

Succeeded to update the favored nodes: <%=favoredNodes%> ,

+

for the region: <%= StringEscapeUtils.escapeHtml(regionName) %>

<% - } + } %> - - - - +
Region Name Position Primary RS Secondary RS Tertiary RS Actions
+ + + + + + + + <% - for (Map.Entry entry : regionNameToRegionInfoMap.entrySet()) { - HRegionInfo regionInfo = entry.getValue(); - List favoredNodeList = assignmentMap.get(regionInfo); - regionName = regionInfo.getRegionNameAsString(); - HServerAddress currentRS = currentAssignment.get(regionInfo); - String position = "Not Assigned"; - AssignmentPlan.POSITION favoredNodePosition = - AssignmentPlan.getFavoredServerPosition(favoredNodeList, currentRS); - if (favoredNodePosition == null) { - position = "Not on FavoredNode"; - } else { - position = favoredNodePosition.toString(); - } + for (Map.Entry entry : regionNameToRegionInfoMap.entrySet()) { + HRegionInfo regionInfo = entry.getValue(); + List favoredNodeList = assignmentMap.get(regionInfo); + regionName = regionInfo.getRegionNameAsString(); + + String position = "Not Assigned"; + String tdClass = "bad"; + + HServerAddress currentRS = currentAssignment.get(regionInfo); + if (currentRS != null) { + AssignmentPlan.POSITION favoredNodePosition = + AssignmentPlan.getFavoredServerPosition(favoredNodeList, currentRS); + if (favoredNodePosition == null) { + position = "" + currentRS; + } else { + position = favoredNodePosition.toString(); + if (favoredNodePosition == AssignmentPlan.POSITION.PRIMARY) { + tdClass = "good"; + } else { + tdClass = "warn"; + } + } + } %> - - - - - <% - if (position.startsWith("Not")) { - %> - - <% - } else if (position.equalsIgnoreCase(AssignmentPlan.POSITION.PRIMARY.toString())){ - %> - - <% - } else { - %> - - <% - } - %> - - - - - - + + + + + + + + + <% - } + } %>
Region NamePositionPrimary RSSecondary RSTertiary RSActions
<%= StringEscapeUtils.escapeHtml(regionName) %> <%=position%><%=position%><%=position%>"""
<%= StringEscapeUtils.escapeHtml(regionName) %><%= position %>"""
http://git-wip-us.apache.org/repos/asf/hbase/blob/cd54a011/src/main/resources/hbase-webapps/static/hbase.css ---------------------------------------------------------------------- diff --git a/src/main/resources/hbase-webapps/static/hbase.css b/src/main/resources/hbase-webapps/static/hbase.css index 8f2063a..d659e0f 100644 --- a/src/main/resources/hbase-webapps/static/hbase.css +++ b/src/main/resources/hbase-webapps/static/hbase.css @@ -35,3 +35,19 @@ tr.task-monitor-ABORTED td { td.number { text-align: right; } + +td.bad, td.warn, td.good { + font-weight: bold; +} + +td.good { + color: #32CD32; +} + +td.warn { + color: #FFD700; +} + +td.bad { + color: red; +}