HBASE-22002 Remove the deprecated methods in Admin interface
[hbase.git] / hbase-server / src / main / resources / hbase-webapps / master / table.jsp
blobced5b4463de41f3de45e8fd43107d4ac91661959
1 <%--
2 /**
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 --%>
20 <%@page import="java.net.URLEncoder"%>
21 <%@ page contentType="text/html;charset=UTF-8"
22 import="static org.apache.commons.lang3.StringEscapeUtils.escapeXml"
23 import="java.util.ArrayList"
24 import="java.util.Collection"
25 import="java.util.Collections"
26 import="java.util.HashMap"
27 import="java.util.LinkedHashMap"
28 import="java.util.List"
29 import="java.util.Map"
30 import="java.util.Objects"
31 import="java.util.TreeMap"
32 import="org.apache.commons.lang3.StringEscapeUtils"
33 import="org.apache.hadoop.conf.Configuration"
34 import="org.apache.hadoop.hbase.HColumnDescriptor"
35 import="org.apache.hadoop.hbase.HConstants"
36 import="org.apache.hadoop.hbase.HRegionLocation"
37 import="org.apache.hadoop.hbase.ServerName"
38 import="org.apache.hadoop.hbase.TableName"
39 import="org.apache.hadoop.hbase.TableNotFoundException"
40 import="org.apache.hadoop.hbase.client.Admin"
41 import="org.apache.hadoop.hbase.client.CompactionState"
42 import="org.apache.hadoop.hbase.client.RegionInfo"
43 import="org.apache.hadoop.hbase.client.RegionInfoBuilder"
44 import="org.apache.hadoop.hbase.client.RegionLocator"
45 import="org.apache.hadoop.hbase.client.RegionReplicaUtil"
46 import="org.apache.hadoop.hbase.client.Table"
47 import="org.apache.hadoop.hbase.master.HMaster"
48 import="org.apache.hadoop.hbase.master.assignment.RegionStates"
49 import="org.apache.hadoop.hbase.master.RegionState"
50 import="org.apache.hadoop.hbase.quotas.QuotaTableUtil"
51 import="org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot"
52 import="org.apache.hadoop.hbase.util.Bytes"
53 import="org.apache.hadoop.hbase.util.FSUtils"
54 import="org.apache.hadoop.hbase.zookeeper.MetaTableLocator"
55 import="org.apache.hadoop.util.StringUtils"
56 import="org.apache.hbase.thirdparty.com.google.protobuf.ByteString"%>
57 <%@ page import="org.apache.hadoop.hbase.shaded.protobuf.generated.ClusterStatusProtos" %>
58 <%@ page import="org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos" %>
59 <%@ page import="org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.Quotas" %>
60 <%@ page import="org.apache.hadoop.hbase.shaded.protobuf.generated.QuotaProtos.SpaceQuota" %>
61 <%@ page import="org.apache.hadoop.hbase.ServerMetrics" %>
62 <%@ page import="org.apache.hadoop.hbase.RegionMetrics" %>
63 <%@ page import="org.apache.hadoop.hbase.Size" %>
64 <%@ page import="org.apache.hadoop.hbase.RegionMetricsBuilder" %>
65 <%!
66 /**
67 * @return An empty region load stamped with the passed in <code>regionInfo</code>
68 * region name.
70 private RegionMetrics getEmptyRegionMetrics(final RegionInfo regionInfo) {
71 return RegionMetricsBuilder.toRegionMetrics(ClusterStatusProtos.RegionLoad.newBuilder().
72 setRegionSpecifier(HBaseProtos.RegionSpecifier.newBuilder().
73 setType(HBaseProtos.RegionSpecifier.RegionSpecifierType.REGION_NAME).
74 setValue(ByteString.copyFrom(regionInfo.getRegionName())).build()).build());
78 HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
79 Configuration conf = master.getConfiguration();
80 String fqtn = request.getParameter("name");
81 final String escaped_fqtn = StringEscapeUtils.escapeHtml4(fqtn);
82 Table table;
83 String tableHeader;
84 boolean withReplica = false;
85 boolean showFragmentation = conf.getBoolean("hbase.master.ui.fragmentation.enabled", false);
86 boolean readOnly = conf.getBoolean("hbase.master.ui.readonly", false);
87 int numMetaReplicas = conf.getInt(HConstants.META_REPLICAS_NUM,
88 HConstants.DEFAULT_META_REPLICA_NUM);
89 Map<String, Integer> frags = null;
90 if (showFragmentation) {
91 frags = FSUtils.getTableFragmentation(master);
93 boolean quotasEnabled = conf.getBoolean("hbase.quota.enabled", false);
94 String action = request.getParameter("action");
95 String key = request.getParameter("key");
96 String left = request.getParameter("left");
97 String right = request.getParameter("right");
98 long totalStoreFileSizeMB = 0;
100 final String numRegionsParam = request.getParameter("numRegions");
101 // By default, the page render up to 10000 regions to improve the page load time
102 int numRegionsToRender = 10000;
103 if (numRegionsParam != null) {
104 // either 'all' or a number
105 if (numRegionsParam.equals("all")) {
106 numRegionsToRender = -1;
107 } else {
108 try {
109 numRegionsToRender = Integer.parseInt(numRegionsParam);
110 } catch (NumberFormatException ex) {
111 // ignore
115 int numRegions = 0;
117 String pageTitle;
118 if ( !readOnly && action != null ) {
119 pageTitle = "HBase Master: " + StringEscapeUtils.escapeHtml4(master.getServerName().toString());
120 } else {
121 pageTitle = "Table: " + escaped_fqtn;
123 pageContext.setAttribute("pageTitle", pageTitle);
126 <jsp:include page="header.jsp">
127 <jsp:param name="pageTitle" value="${pageTitle}"/>
128 </jsp:include>
131 if ( fqtn != null ) {
132 try {
133 table = master.getConnection().getTable(TableName.valueOf(fqtn));
134 if (table.getTableDescriptor().getRegionReplication() > 1) {
135 tableHeader = "<h2>Table Regions</h2><table id=\"tableRegionTable\" class=\"tablesorter table table-striped\" style=\"table-layout: fixed; word-wrap: break-word;\"><thead><tr><th>Name</th><th>Region Server</th><th>ReadRequests</th><th>WriteRequests</th><th>StorefileSize</th><th>Num.Storefiles</th><th>MemSize</th><th>Locality</th><th>Start Key</th><th>End Key</th><th>ReplicaID</th></tr></thead>";
136 withReplica = true;
137 } else {
138 tableHeader = "<h2>Table Regions</h2><table id=\"tableRegionTable\" class=\"tablesorter table table-striped\" style=\"table-layout: fixed; word-wrap: break-word;\"><thead><tr><th>Name</th><th>Region Server</th><th>ReadRequests</th><th>WriteRequests</th><th>StorefileSize</th><th>Num.Storefiles</th><th>MemSize</th><th>Locality</th><th>Start Key</th><th>End Key</th></tr></thead>";
140 if ( !readOnly && action != null ) {
142 <div class="container-fluid content">
143 <div class="row inner_header">
144 <div class="page-header">
145 <h1>Table action request accepted</h1>
146 </div>
147 </div>
148 <p><hr><p>
150 try (Admin admin = master.getConnection().getAdmin()) {
151 if (action.equals("split")) {
152 if (key != null && key.length() > 0) {
153 admin.split(TableName.valueOf(fqtn), Bytes.toBytes(key));
154 } else {
155 admin.split(TableName.valueOf(fqtn));
158 %> Split request accepted. <%
159 } else if (action.equals("compact")) {
160 if (key != null && key.length() > 0) {
161 List<RegionInfo> regions = admin.getRegions(TableName.valueOf(fqtn));
162 byte[] row = Bytes.toBytes(key);
164 for (RegionInfo region : regions) {
165 if (region.containsRow(row)) {
166 admin.compactRegion(region.getRegionName());
169 } else {
170 admin.compact(TableName.valueOf(fqtn));
172 %> Compact request accepted. <%
173 } else if (action.equals("merge")) {
174 if (left != null && left.length() > 0 && right != null && right.length() > 0) {
175 admin.mergeRegionsAsync(Bytes.toBytesBinary(left), Bytes.toBytesBinary(right), false);
177 %> Merge request accepted. <%
181 <jsp:include page="redirect.jsp" />
182 </div>
184 } else {
186 <div class="container-fluid content">
187 <div class="row inner_header">
188 <div class="page-header">
189 <h1>Table <small><%= escaped_fqtn %></small></h1>
190 </div>
191 </div>
192 <div class="row">
194 if(fqtn.equals(TableName.META_TABLE_NAME.getNameAsString())) {
196 <%= tableHeader %>
197 <tbody>
199 // NOTE: Presumes meta with one or more replicas
200 for (int j = 0; j < numMetaReplicas; j++) {
201 RegionInfo meta = RegionReplicaUtil.getRegionInfoForReplica(
202 RegionInfoBuilder.FIRST_META_REGIONINFO, j);
203 ServerName metaLocation = MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
204 for (int i = 0; i < 1; i++) {
205 String hostAndPort = "";
206 String readReq = "N/A";
207 String writeReq = "N/A";
208 String fileSize = "N/A";
209 String fileCount = "N/A";
210 String memSize = "N/A";
211 float locality = 0.0f;
213 if (metaLocation != null) {
214 ServerMetrics sl = master.getServerManager().getLoad(metaLocation);
215 // The host name portion should be safe, but I don't know how we handle IDNs so err on the side of failing safely.
216 hostAndPort = URLEncoder.encode(metaLocation.getHostname()) + ":" + master.getRegionServerInfoPort(metaLocation);
217 if (sl != null) {
218 Map<byte[], RegionMetrics> map = sl.getRegionMetrics();
219 if (map.containsKey(meta.getRegionName())) {
220 RegionMetrics load = map.get(meta.getRegionName());
221 readReq = String.format("%,1d", load.getReadRequestCount());
222 writeReq = String.format("%,1d", load.getWriteRequestCount());
223 fileSize = StringUtils.byteDesc((long) load.getStoreFileSize().get(Size.Unit.BYTE));
224 fileCount = String.format("%,1d", load.getStoreFileCount());
225 memSize = StringUtils.byteDesc((long) load.getMemStoreSize().get(Size.Unit.BYTE));
226 locality = load.getDataLocality();
231 <tr>
232 <td><%= escapeXml(meta.getRegionNameAsString()) %></td>
233 <td><a href="http://<%= hostAndPort %>/"><%= StringEscapeUtils.escapeHtml4(hostAndPort) %></a></td>
234 <td><%= readReq%></td>
235 <td><%= writeReq%></td>
236 <td><%= fileSize%></td>
237 <td><%= fileCount%></td>
238 <td><%= memSize%></td>
239 <td><%= locality%></td>
240 <td><%= escapeXml(Bytes.toString(meta.getStartKey())) %></td>
241 <td><%= escapeXml(Bytes.toString(meta.getEndKey())) %></td>
243 if (withReplica) {
245 <td><%= meta.getReplicaId() %></td>
249 </tr>
250 <% } %>
251 <%} %>
252 </tbody>
253 </table>
254 <%} else {
255 Admin admin = master.getConnection().getAdmin();
256 RegionStates states = master.getAssignmentManager().getRegionStates();
257 Map<RegionState.State, List<RegionInfo>> regionStates = states.getRegionByStateOfTable(table.getName());
258 Map<String, RegionState.State> stateMap = new HashMap<>();
259 for (RegionState.State regionState : regionStates.keySet()) {
260 for (RegionInfo regionInfo : regionStates.get(regionState)) {
261 stateMap.put(regionInfo.getEncodedName(), regionState);
264 RegionLocator r = master.getClusterConnection().getRegionLocator(table.getName());
265 try { %>
266 <h2>Table Attributes</h2>
267 <table class="table table-striped">
268 <tr>
269 <th>Attribute Name</th>
270 <th>Value</th>
271 <th>Description</th>
272 </tr>
273 <tr>
274 <td>Enabled</td>
275 <td><%= admin.isTableEnabled(table.getName()) %></td>
276 <td>Is the table enabled</td>
277 </tr>
278 <tr>
279 <td>Compaction</td>
280 <td>
282 try {
283 CompactionState compactionState = admin.getCompactionState(table.getName());
285 <%= compactionState %>
287 } catch (Exception e) {
288 // Nothing really to do here
289 for(StackTraceElement element : e.getStackTrace()) {
290 %><%= StringEscapeUtils.escapeHtml4(element.toString()) %><%
292 %> Unknown <%
295 </td>
296 <td>Is the table compacting</td>
297 </tr>
298 <% if (showFragmentation) { %>
299 <tr>
300 <td>Fragmentation</td>
301 <td><%= frags.get(fqtn) != null ? frags.get(fqtn).intValue() + "%" : "n/a" %></td>
302 <td>How fragmented is the table. After a major compaction it is 0%.</td>
303 </tr>
304 <% } %>
306 if (quotasEnabled) {
307 TableName tn = TableName.valueOf(fqtn);
308 SpaceQuotaSnapshot masterSnapshot = null;
309 Quotas quota = QuotaTableUtil.getTableQuota(master.getConnection(), tn);
310 if (quota == null || !quota.hasSpace()) {
311 quota = QuotaTableUtil.getNamespaceQuota(master.getConnection(), tn.getNamespaceAsString());
312 if (quota != null) {
313 masterSnapshot = master.getQuotaObserverChore().getNamespaceQuotaSnapshots()
314 .get(tn.getNamespaceAsString());
316 } else {
317 masterSnapshot = master.getQuotaObserverChore().getTableQuotaSnapshots().get(tn);
319 if (quota != null && quota.hasSpace()) {
320 SpaceQuota spaceQuota = quota.getSpace();
322 <tr>
323 <td>Space Quota</td>
324 <td>
325 <table>
326 <tr>
327 <th>Property</th>
328 <th>Value</th>
329 </tr>
330 <tr>
331 <td>Limit</td>
332 <td><%= StringUtils.byteDesc(spaceQuota.getSoftLimit()) %></td>
333 </tr>
334 <tr>
335 <td>Policy</td>
336 <td><%= spaceQuota.getViolationPolicy() %></td>
337 </tr>
339 if (masterSnapshot != null) {
341 <tr>
342 <td>Usage</td>
343 <td><%= StringUtils.byteDesc(masterSnapshot.getUsage()) %></td>
344 </tr>
345 <tr>
346 <td>State</td>
347 <td><%= masterSnapshot.getQuotaStatus().isInViolation() ? "In Violation" : "In Observance" %></td>
348 </tr>
352 </table>
353 </td>
354 <td>Information about a Space Quota on this table, if set.</td>
355 </tr>
360 </table>
361 <h2>Table Schema</h2>
362 <table class="table table-striped">
363 <tr>
364 <th>Column Name</th>
365 <th></th>
366 </tr>
368 Collection<HColumnDescriptor> families = table.getTableDescriptor().getFamilies();
369 for (HColumnDescriptor family: families) {
371 <tr>
372 <td><%= StringEscapeUtils.escapeHtml4(family.getNameAsString()) %></td>
373 <td>
374 <table class="table table-striped">
375 <tr>
376 <th>Property</th>
377 <th>Value</th>
378 </tr>
380 Map<Bytes, Bytes> familyValues = family.getValues();
381 for (Bytes familyKey: familyValues.keySet()) {
383 <tr>
384 <td>
385 <%= StringEscapeUtils.escapeHtml4(familyKey.toString()) %>
386 </td>
387 <td>
388 <%= StringEscapeUtils.escapeHtml4(familyValues.get(familyKey).toString()) %>
389 </td>
390 </tr>
391 <% } %>
392 </table>
393 </td>
394 </tr>
395 <% } %>
396 </table>
398 long totalReadReq = 0;
399 long totalWriteReq = 0;
400 long totalSize = 0;
401 long totalStoreFileCount = 0;
402 long totalMemSize = 0;
403 String urlRegionServer = null;
404 Map<ServerName, Integer> regDistribution = new TreeMap<>();
405 Map<ServerName, Integer> primaryRegDistribution = new TreeMap<>();
406 List<HRegionLocation> regions = r.getAllRegionLocations();
407 Map<RegionInfo, RegionMetrics> regionsToLoad = new LinkedHashMap<>();
408 Map<RegionInfo, ServerName> regionsToServer = new LinkedHashMap<>();
409 for (HRegionLocation hriEntry : regions) {
410 RegionInfo regionInfo = hriEntry.getRegionInfo();
411 ServerName addr = hriEntry.getServerName();
412 regionsToServer.put(regionInfo, addr);
414 if (addr != null) {
415 ServerMetrics sl = master.getServerManager().getLoad(addr);
416 if (sl != null) {
417 RegionMetrics regionMetrics = sl.getRegionMetrics().get(regionInfo.getRegionName());
418 regionsToLoad.put(regionInfo, regionMetrics);
419 if(regionMetrics != null) {
420 totalReadReq += regionMetrics.getReadRequestCount();
421 totalWriteReq += regionMetrics.getWriteRequestCount();
422 totalSize += regionMetrics.getStoreFileSize().get(Size.Unit.MEGABYTE);
423 totalStoreFileCount += regionMetrics.getStoreFileCount();
424 totalMemSize += regionMetrics.getMemStoreSize().get(Size.Unit.MEGABYTE);
425 totalStoreFileSizeMB += regionMetrics.getStoreFileSize().get(Size.Unit.MEGABYTE);
426 } else {
427 RegionMetrics load0 = getEmptyRegionMetrics(regionInfo);
428 regionsToLoad.put(regionInfo, load0);
430 } else{
431 RegionMetrics load0 = getEmptyRegionMetrics(regionInfo);
432 regionsToLoad.put(regionInfo, load0);
434 } else {
435 RegionMetrics load0 = getEmptyRegionMetrics(regionInfo);
436 regionsToLoad.put(regionInfo, load0);
440 if(regions != null && regions.size() > 0) { %>
441 <h2>Table Regions</h2>
442 <table id="regionServerDetailsTable" class="tablesorter table table-striped">
443 <thead>
444 <tr>
445 <th>Name(<%= String.format("%,1d", regions.size())%>)</th>
446 <th>Region Server</th>
447 <th>ReadRequests<br>(<%= String.format("%,1d", totalReadReq)%>)</th>
448 <th>WriteRequests<br>(<%= String.format("%,1d", totalWriteReq)%>)</th>
449 <th>StorefileSize<br>(<%= StringUtils.byteDesc(totalSize*1024l*1024)%>)</th>
450 <th>Num.Storefiles<br>(<%= String.format("%,1d", totalStoreFileCount)%>)</th>
451 <th>MemSize<br>(<%= StringUtils.byteDesc(totalMemSize*1024l*1024)%>)</th>
452 <th>Locality</th>
453 <th>Start Key</th>
454 <th>End Key</th>
455 <th>Region State</th>
457 if (withReplica) {
459 <th>ReplicaID</th>
463 </thead>
464 </tr>
465 <tbody>
468 List<Map.Entry<RegionInfo, RegionMetrics>> entryList = new ArrayList<>(regionsToLoad.entrySet());
469 numRegions = regions.size();
470 int numRegionsRendered = 0;
471 // render all regions
472 if (numRegionsToRender < 0) {
473 numRegionsToRender = numRegions;
475 for (Map.Entry<RegionInfo, RegionMetrics> hriEntry : entryList) {
476 RegionInfo regionInfo = hriEntry.getKey();
477 ServerName addr = regionsToServer.get(regionInfo);
478 RegionMetrics load = hriEntry.getValue();
479 String readReq = "N/A";
480 String writeReq = "N/A";
481 String regionSize = "N/A";
482 String fileCount = "N/A";
483 String memSize = "N/A";
484 float locality = 0.0f;
485 String state = "N/A";
486 if(load != null) {
487 readReq = String.format("%,1d", load.getReadRequestCount());
488 writeReq = String.format("%,1d", load.getWriteRequestCount());
489 regionSize = StringUtils.byteDesc((long) load.getStoreFileSize().get(Size.Unit.BYTE));
490 fileCount = String.format("%,1d", load.getStoreFileCount());
491 memSize = StringUtils.byteDesc((long) load.getMemStoreSize().get(Size.Unit.BYTE));
492 locality = load.getDataLocality();
495 if (stateMap.containsKey(regionInfo.getEncodedName())) {
496 state = stateMap.get(regionInfo.getEncodedName()).toString();
499 if (addr != null) {
500 ServerMetrics sl = master.getServerManager().getLoad(addr);
501 // This port might be wrong if RS actually ended up using something else.
502 urlRegionServer =
503 "//" + URLEncoder.encode(addr.getHostname()) + ":" + master.getRegionServerInfoPort(addr) + "/";
504 if(sl != null) {
505 Integer i = regDistribution.get(addr);
506 if (null == i) i = Integer.valueOf(0);
507 regDistribution.put(addr, i + 1);
508 if (withReplica && RegionReplicaUtil.isDefaultReplica(regionInfo.getReplicaId())) {
509 i = primaryRegDistribution.get(addr);
510 if (null == i) i = Integer.valueOf(0);
511 primaryRegDistribution.put(addr, i+1);
515 if (numRegionsRendered < numRegionsToRender) {
516 numRegionsRendered++;
518 <tr>
519 <td><%= escapeXml(Bytes.toStringBinary(regionInfo.getRegionName())) %></td>
521 if (urlRegionServer != null) {
523 <td>
524 <a href="<%= urlRegionServer %>"><%= StringEscapeUtils.escapeHtml4(addr.getHostname().toString()) + ":" + master.getRegionServerInfoPort(addr) %></a>
525 </td>
527 } else {
529 <td class="undeployed-region">not deployed</td>
533 <td><%= readReq%></td>
534 <td><%= writeReq%></td>
535 <td><%= regionSize%></td>
536 <td><%= fileCount%></td>
537 <td><%= memSize%></td>
538 <td><%= locality%></td>
539 <td><%= escapeXml(Bytes.toStringBinary(regionInfo.getStartKey()))%></td>
540 <td><%= escapeXml(Bytes.toStringBinary(regionInfo.getEndKey()))%></td>
541 <td><%= state%></td>
543 if (withReplica) {
545 <td><%= regionInfo.getReplicaId() %></td>
549 </tr>
550 <% } %>
551 <% } %>
552 </tbody>
553 </table>
554 <% if (numRegions > numRegionsRendered) {
555 String allRegionsUrl = "?name=" + URLEncoder.encode(fqtn,"UTF-8") + "&numRegions=all";
557 <p>This table has <b><%= numRegions %></b> regions in total, in order to improve the page load time,
558 only <b><%= numRegionsRendered %></b> regions are displayed here, <a href="<%= allRegionsUrl %>">click
559 here</a> to see all regions.</p>
560 <% } %>
561 <h2>Regions by Region Server</h2>
563 if (withReplica) {
565 <table id="regionServerTable" class="tablesorter table table-striped"><thead><tr><th>Region Server</th><th>Region Count</th><th>Primary Region Count</th></tr></thead>
567 } else {
569 <table id="regionServerTable" class="tablesorter table table-striped"><thead><tr><th>Region Server</th><th>Region Count</th></tr></thead>
570 <tbody>
575 for (Map.Entry<ServerName, Integer> rdEntry : regDistribution.entrySet()) {
576 ServerName addr = rdEntry.getKey();
577 String url = "//" + URLEncoder.encode(addr.getHostname()) + ":" + master.getRegionServerInfoPort(addr) + "/";
579 <tr>
580 <td><a href="<%= url %>"><%= StringEscapeUtils.escapeHtml4(addr.getHostname().toString()) + ":" + master.getRegionServerInfoPort(addr) %></a></td>
581 <td><%= rdEntry.getValue()%></td>
583 if (withReplica) {
585 <td><%= primaryRegDistribution.get(addr)%></td>
589 </tr>
590 <% } %>
591 </tbody>
592 </table>
593 <% }
594 } catch(Exception ex) {
595 for(StackTraceElement element : ex.getStackTrace()) {
596 %><%= StringEscapeUtils.escapeHtml4(element.toString()) %><%
598 } finally {
599 admin.close();
601 } // end else
604 <h2>Table Stats</h2>
605 <table class="table table-striped">
606 <tr>
607 <th>Name</th>
608 <th>Value</th>
609 <th>Description</th>
610 </tr>
611 <tr>
612 <td>Size</td>
613 <td><%= StringUtils.TraditionalBinaryPrefix.long2String(totalStoreFileSizeMB * 1024 * 1024, "B", 2)%></td>
614 <td>Total size of store files</td>
615 </tr>
616 </table>
618 <% if (!readOnly) { %>
619 <p><hr/></p>
620 Actions:
622 <center>
623 <table class="table" style="border: 0;" width="95%" >
624 <tr>
625 <form method="get">
626 <input type="hidden" name="action" value="compact" />
627 <input type="hidden" name="name" value="<%= escaped_fqtn %>" />
628 <td class="centered">
629 <input style="font-size: 12pt; width: 10em" type="submit" value="Compact" class="btn" />
630 </td>
631 <td style="text-align: center;">
632 <input type="text" name="key" size="40" placeholder="Row Key (optional)" />
633 </td>
634 <td>
635 This action will force a compaction of all regions of the table, or,
636 if a key is supplied, only the region containing the
637 given key.
638 </td>
639 </form>
640 </tr>
641 <tr>
642 <form method="get">
643 <input type="hidden" name="action" value="split" />
644 <input type="hidden" name="name" value="<%= escaped_fqtn %>" />
645 <td class="centered">
646 <input style="font-size: 12pt; width: 10em" type="submit" value="Split" class="btn" />
647 </td>
648 <td style="text-align: center;">
649 <input type="text" name="key" size="40" placeholder="Row Key (optional)" />
650 </td>
651 <td>
652 This action will force a split of all eligible
653 regions of the table, or, if a key is supplied, only the region containing the
654 given key. An eligible region is one that does not contain any references to
655 other regions. Split requests for noneligible regions will be ignored.
656 </td>
657 </form>
658 </tr>
659 <tr>
660 <form method="get">
661 <input type="hidden" name="action" value="merge" />
662 <input type="hidden" name="name" value="<%= escaped_fqtn %>" />
663 <td class="centered">
664 <input style="font-size: 12pt; width: 10em" type="submit" value="Merge" class="btn" />
665 </td>
666 <td style="text-align: center;">
667 <input type="text" name="left" size="40" required="required" placeholder="Region Key (required)" />
668 <input type="text" name="right" size="40" required="required" placeholder="Region Key (required)" />
669 </td>
670 <td>
671 This action will merge two regions of the table, Merge requests for
672 noneligible regions will be ignored.
673 </td>
674 </form>
675 </tr>
676 </table>
677 </center>
678 </p>
679 <% } %>
680 </div>
681 </div>
682 <% }
683 } catch(TableNotFoundException e) { %>
684 <div class="container-fluid content">
685 <div class="row inner_header">
686 <div class="page-header">
687 <h1>Table not found</h1>
688 </div>
689 </div>
690 <p><hr><p>
691 <p>Go <a href="javascript:history.back()">Back</a>
692 </div> <%
693 } catch(IllegalArgumentException e) { %>
694 <div class="container-fluid content">
695 <div class="row inner_header">
696 <div class="page-header">
697 <h1>Table qualifier must not be empty</h1>
698 </div>
699 </div>
700 <p><hr><p>
701 <p>Go <a href="javascript:history.back()">Back</a>
702 </div> <%
705 else { // handle the case for fqtn is null with error message + redirect
707 <div class="container-fluid content">
708 <div class="row inner_header">
709 <div class="page-header">
710 <h1>Table not ready</h1>
711 </div>
712 </div>
713 <p><hr><p>
714 <jsp:include page="redirect.jsp" />
715 </div>
716 <% } %>
718 <jsp:include page="footer.jsp" />
719 <script src="/static/js/jquery.min.js" type="text/javascript"></script>
720 <script src="/static/js/jquery.tablesorter.min.js" type="text/javascript"></script>
721 <script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
723 <script>
724 $(document).ready(function()
726 $("#regionServerTable").tablesorter();
727 $("#regionServerDetailsTable").tablesorter();
728 $("#tableRegionTable").tablesorter();
731 </script>