diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon index f48a998a055..59e77ac9edb 100644 --- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon +++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/MasterStatusTmpl.jamon @@ -396,8 +396,22 @@ AssignmentManager assignmentManager = master.getAssignmentManager(); + + @@ -462,7 +476,8 @@ AssignmentManager assignmentManager = master.getAssignmentManager(); <%if (tables != null && tables.size() > 0)%> - +
+ @@ -477,6 +492,8 @@ AssignmentManager assignmentManager = master.getAssignmentManager(); + + <%for TableDescriptor desc : tables%> <%java> HTableDescriptor htDesc = new HTableDescriptor(desc); @@ -515,6 +532,7 @@ AssignmentManager assignmentManager = master.getAssignmentManager();

<% tables.size() %> table(s) in set. [Details]

+
Namespace NameOther (CLOSED, etc.) Description
diff --git a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon index 67d330584bc..0afc705c9ed 100644 --- a/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon +++ b/hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionServerListTmpl.jamon @@ -82,7 +82,8 @@ Arrays.sort(serverNames); <%args> ServerName [] serverNames; - +
+ @@ -91,6 +92,8 @@ Arrays.sort(serverNames); + + <%java> int totalRegions = 0; int totalRequestsPerSecond = 0; @@ -128,6 +131,7 @@ Arrays.sort(serverNames); <%java> } + @@ -146,7 +150,8 @@ Arrays.sort(serverNames); <%args> ServerName [] serverNames; -
ServerName Start timeRequests Per Second Num. Regions
Total:<% servers.size() %>
+
+ @@ -154,6 +159,8 @@ Arrays.sort(serverNames); + + <%java> for (ServerName serverName: serverNames) { @@ -182,6 +189,7 @@ for (ServerName serverName: serverNames) { } } +
ServerName Used HeapMemstore Size
@@ -190,7 +198,8 @@ for (ServerName serverName: serverNames) { <%args> ServerName [] serverNames; - +
+ @@ -198,6 +207,8 @@ for (ServerName serverName: serverNames) { + + <%java> for (ServerName serverName: serverNames) { @@ -227,6 +238,7 @@ if (sl != null) { } } +
ServerName Request Per SecondFiltered Read Request Count Write Request Count
@@ -235,7 +247,8 @@ if (sl != null) { <%args> ServerName [] serverNames; - +
+ @@ -245,6 +258,8 @@ if (sl != null) { + + <%java> for (ServerName serverName: serverNames) { @@ -286,6 +301,7 @@ if (sl != null) { } } +
ServerName Num. StoresIndex Size Bloom Size
@@ -293,7 +309,8 @@ if (sl != null) { <%args> ServerName [] serverNames; - +
+ @@ -301,6 +318,8 @@ if (sl != null) { + + <%java> for (ServerName serverName: serverNames) { @@ -333,6 +352,7 @@ if (totalCompactingCells > 0) { } } +
ServerName Num. Compacting CellsRemaining Cells Compaction Progress
diff --git a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp index ea81cf60109..372e5ca35b8 100644 --- a/hbase-server/src/main/resources/hbase-webapps/master/table.jsp +++ b/hbase-server/src/main/resources/hbase-webapps/master/table.jsp @@ -23,7 +23,6 @@ import="java.util.ArrayList" import="java.util.Collection" import="java.util.Collections" - import="java.util.Comparator" import="java.util.HashMap" import="java.util.LinkedHashMap" import="java.util.List" @@ -82,11 +81,6 @@ MetaTableLocator metaTableLocator = new MetaTableLocator(); String fqtn = request.getParameter("name"); final String escaped_fqtn = StringEscapeUtils.escapeHtml4(fqtn); - String sortKey = request.getParameter("sort"); - String reverse = request.getParameter("reverse"); - final boolean reverseOrder = (reverse != null && reverse.equals("true")); - String showWholeKey = request.getParameter("showwhole"); - final boolean showWhole = (showWholeKey!=null && showWholeKey.equals("true")); Table table; String tableHeader; boolean withReplica = false; @@ -140,10 +134,10 @@ if ( fqtn != null ) { try { table = master.getConnection().getTable(TableName.valueOf(fqtn)); if (table.getTableDescriptor().getRegionReplication() > 1) { - tableHeader = "

Table Regions

"; + tableHeader = "

Table Regions

NameRegion ServerReadRequestsWriteRequestsStorefileSizeNum.StorefilesMemSizeLocalityStart KeyEnd KeyReplicaID
"; withReplica = true; } else { - tableHeader = "

Table Regions

NameRegion ServerReadRequestsWriteRequestsStorefileSizeNum.StorefilesMemSizeLocalityStart KeyEnd KeyReplicaID
"; + tableHeader = "

Table Regions

NameRegion ServerReadRequestsWriteRequestsStorefileSizeNum.StorefilesMemSizeLocalityStart KeyEnd Key
"; } if ( !readOnly && action != null ) { %> @@ -202,6 +196,7 @@ if ( fqtn != null ) { if(fqtn.equals(TableName.META_TABLE_NAME.getNameAsString())) { %> <%= tableHeader %> + <% // NOTE: Presumes meta with one or more replicas for (int j = 0; j < numMetaReplicas; j++) { @@ -256,6 +251,7 @@ if ( fqtn != null ) { <% } %> <%} %> +
NameRegion ServerReadRequestsWriteRequestsStorefileSizeNum.StorefilesMemSizeLocalityStart KeyEnd Key
<%} else { Admin admin = master.getConnection().getAdmin(); @@ -444,22 +440,8 @@ if ( fqtn != null ) { if(regions != null && regions.size() > 0) { %>

Table Regions

-Sort As - -Ascending -ShowDetailName - -

- - +
+ @@ -479,91 +461,12 @@ ShowDetailName <% } %> + + <% List> entryList = new ArrayList<>(regionsToLoad.entrySet()); - if (Objects.equals(sortKey, "regionname")) { - Collections.sort(entryList, (entry1, entry2) -> { - if (entry1 == null || entry1.getValue() == null) { - return -1; - } else if (entry2 == null || entry2.getValue() == null) { - return 1; - } - RegionInfo regionInfo1 = entry1.getKey(); - RegionInfo regionInfo2 = entry2.getKey(); - String name1 = showWhole ? Bytes.toStringBinary(regionInfo1.getRegionName()) - : regionInfo1.getEncodedName(); - String name2 = showWhole ? Bytes.toStringBinary(regionInfo2.getRegionName()) - : regionInfo2.getEncodedName(); - return name1.compareTo(name2); - }); - } else if (Objects.equals(sortKey, "readrequest")) { - Collections.sort(entryList, (entry1, entry2) -> { - if (entry1 == null || entry1.getValue() == null) { - return -1; - } else if (entry2 == null || entry2.getValue() == null) { - return 1; - } - return Long.compare(entry1.getValue().getReadRequestCount(), - entry2.getValue().getReadRequestCount()); - }); - } else if (Objects.equals(sortKey, "writerequest")) { - Collections.sort(entryList, (entry1, entry2) -> { - if (entry1 == null || entry1.getValue() == null) { - return -1; - } else if (entry2 == null || entry2.getValue() == null) { - return 1; - } - return Long.compare(entry1.getValue().getWriteRequestCount(), - entry2.getValue().getWriteRequestCount()); - }); - } else if (Objects.equals(sortKey, "size")) { - Collections.sort(entryList, (entry1, entry2) -> { - if (entry1 == null || entry1.getValue() == null) { - return -1; - } else if (entry2 == null || entry2.getValue() == null) { - return 1; - } - return Double.compare(entry1.getValue().getStoreFileSize().get(), - entry2.getValue().getStoreFileSize().get()); - }); - } else if (Objects.equals(sortKey, "filecount")) { - Collections.sort(entryList, (entry1, entry2) -> { - if (entry1 == null || entry1.getValue() == null) { - return -1; - } else if (entry2 == null || entry2.getValue() == null) { - return 1; - } - return Integer.compare(entry1.getValue().getStoreCount(), - entry2.getValue().getStoreCount()); - }); - } else if (Objects.equals(sortKey, "memstore")) { - Collections.sort(entryList, (entry1, entry2) -> { - if (entry1 == null || entry1.getValue() == null) { - return -1; - } else if (entry2 == null || entry2.getValue() == null) { - return 1; - } - return Double.compare(entry1.getValue().getMemStoreSize().get(), - entry2.getValue().getMemStoreSize().get()); - }); - } else if (Objects.equals(sortKey, "locality")) { - Collections.sort(entryList, (entry1, entry2) -> { - if (entry1 == null || entry1.getValue() == null) { - return -1; - } else if (entry2 == null || entry2.getValue() == null) { - return 1; - } - return Double.compare(entry1.getValue().getDataLocality(), - entry2.getValue().getDataLocality()); - }); - } - - if (reverseOrder) { - Collections.reverse(entryList); - } - numRegions = regions.size(); int numRegionsRendered = 0; // render all regions @@ -614,7 +517,7 @@ ShowDetailName numRegionsRendered++; %> - + <% if (urlRegionServer != null) { %> @@ -647,6 +550,7 @@ ShowDetailName <% } %> <% } %> +
Name(<%= String.format("%,1d", regions.size())%>) Region Server
<%= escapeXml(showWhole?Bytes.toStringBinary(regionInfo.getRegionName()):regionInfo.getEncodedName()) %><%= escapeXml(Bytes.toStringBinary(regionInfo.getRegionName())) %>
<% if (numRegions > numRegionsRendered) { String allRegionsUrl = "?name=" + URLEncoder.encode(fqtn,"UTF-8") + "&numRegions=all"; @@ -659,11 +563,12 @@ ShowDetailName <% if (withReplica) { %> - +
Region ServerRegion CountPrimary Region Count
<% } else { %> -
Region ServerRegion CountPrimary Region Count
+
Region ServerRegion Count
+ <% } %> @@ -684,6 +589,7 @@ if (withReplica) { %> <% } %> +
Region ServerRegion Count
<% } } catch(Exception ex) { @@ -811,37 +717,16 @@ Actions: <% } %> + + + diff --git a/hbase-server/src/main/resources/hbase-webapps/static/css/asc.gif b/hbase-server/src/main/resources/hbase-webapps/static/css/asc.gif new file mode 100644 index 00000000000..74157867f25 Binary files /dev/null and b/hbase-server/src/main/resources/hbase-webapps/static/css/asc.gif differ diff --git a/hbase-server/src/main/resources/hbase-webapps/static/css/bg.gif b/hbase-server/src/main/resources/hbase-webapps/static/css/bg.gif new file mode 100644 index 00000000000..fac668fcf42 Binary files /dev/null and b/hbase-server/src/main/resources/hbase-webapps/static/css/bg.gif differ diff --git a/hbase-server/src/main/resources/hbase-webapps/static/css/desc.gif b/hbase-server/src/main/resources/hbase-webapps/static/css/desc.gif new file mode 100644 index 00000000000..3b30b3c58ea Binary files /dev/null and b/hbase-server/src/main/resources/hbase-webapps/static/css/desc.gif differ diff --git a/hbase-server/src/main/resources/hbase-webapps/static/css/hbase.css b/hbase-server/src/main/resources/hbase-webapps/static/css/hbase.css index 03d8ff4f266..04eb49625aa 100644 --- a/hbase-server/src/main/resources/hbase-webapps/static/css/hbase.css +++ b/hbase-server/src/main/resources/hbase-webapps/static/css/hbase.css @@ -39,4 +39,18 @@ section { margin-bottom: 3em; } margin-top: 1.2em; } -/* Region Server page styling */ \ No newline at end of file +/* Region Server page styling */ + +/* sortable tables styling */ +table.tablesorter thead tr .header { + background-image: url(bg.gif); + background-repeat: no-repeat; + background-position: center right; + cursor: pointer; +} +table.tablesorter thead tr .headerSortUp { + background-image: url(asc.gif); +} +table.tablesorter thead tr .headerSortDown { + background-image: url(desc.gif); +} diff --git a/hbase-server/src/main/resources/hbase-webapps/static/js/jquery.tablesorter.min.js b/hbase-server/src/main/resources/hbase-webapps/static/js/jquery.tablesorter.min.js new file mode 100644 index 00000000000..ad84db6182d --- /dev/null +++ b/hbase-server/src/main/resources/hbase-webapps/static/js/jquery.tablesorter.min.js @@ -0,0 +1,4 @@ +/*! jQuery jquery.com | jquery.org/license */ +(function($){$.extend({tablesorter:new +function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:true,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'/\.|\,/g',onRenderHeader:null,selectorHeaders:'thead th',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}if(table.tBodies.length==0)return;var rows=table.tBodies[0].rows;if(rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function checkHeaderOptionsSortingLocked(table,i){if((table.config.headers[i])&&(table.config.headers[i].lockedOrder))return table.config.headers[i].lockedOrder;return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i b["+i+"]) ? 1 : 0));";};function makeSortTextDesc(i){return"((b["+i+"] < a["+i+"]) ? -1 : ((b["+i+"] > a["+i+"]) ? 1 : 0));";};function makeSortNumeric(i){return"a["+i+"]-b["+i+"];";};function makeSortNumericDesc(i){return"b["+i+"]-a["+i+"];";};function sortText(a,b){if(table.config.sortLocaleCompare)return a.localeCompare(b);return((ab)?1:0));};function sortTextDesc(a,b){if(table.config.sortLocaleCompare)return b.localeCompare(a);return((ba)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$.data(this,"tablesorter",config);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){$this.trigger("sortStart");var $cell=$(this);var i=this.column;this.order=this.count++%2;if(this.lockedOrder)this.order=this.lockedOrder;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i**/src/main/asciidoc/hbase.css **/jquery.min.js + **/jquery.tablesorter.min.js **/*.vm