Skip to content

Commit

Permalink
HBASE-29026 Replace deprecated calls in JSP files
Browse files Browse the repository at this point in the history
  • Loading branch information
PDavid committed Jan 8, 2025
1 parent d67d93d commit 5f5485c
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,20 @@
*/
--%>
<%@ page contentType="text/html;charset=UTF-8"
import="static org.apache.commons.lang3.StringEscapeUtils.escapeXml"
import="static org.apache.commons.text.StringEscapeUtils.escapeXml10"
import="java.util.Collections"
import="java.util.Comparator"
import="java.util.ArrayList"
import="java.util.Date"
import="java.util.List"
import="java.util.Set"
import="org.apache.hadoop.hbase.master.HMaster"
import="org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv"
import="org.apache.hadoop.hbase.procedure2.LockedResource"
import="org.apache.hadoop.hbase.procedure2.Procedure"
import="org.apache.hadoop.hbase.procedure2.ProcedureExecutor"
import="org.apache.hadoop.hbase.procedure2.util.StringUtils"
import="org.apache.hadoop.util.StringUtils.TraditionalBinaryPrefix"
%>
<%@ page import="org.apache.hadoop.hbase.master.procedure.ServerCrashProcedure" %>
<%@ page import="org.apache.hadoop.hbase.master.assignment.TransitRegionStateProcedure" %>
<%@ page import="org.apache.hadoop.hbase.master.assignment.OpenRegionProcedure" %>
<%@ page import="org.apache.hadoop.hbase.master.assignment.CloseRegionProcedure" %>
<%@ page import="org.apache.hadoop.hbase.metrics.OperationMetrics" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="org.apache.hadoop.hbase.master.MetricsAssignmentManagerSource" %>
<%@ page import="org.apache.hadoop.hbase.master.MetricsAssignmentManager" %>
<%@ page import="org.apache.hadoop.hbase.procedure2.ProcedureMetrics" %>
<%@ page import="org.apache.hadoop.hbase.metrics.Snapshot" %>
<%@ page import="org.apache.hadoop.hbase.metrics.Histogram" %>
<%@ page import="java.util.TreeMap" %>
<%@ page import="org.apache.hadoop.hbase.metrics.impl.HistogramImpl" %>
Expand Down Expand Up @@ -90,7 +78,7 @@
<h1>Procedure Time Statistics</h1>
</div>
</div>
<p>We list proceduces completed successfully of the following types only: ServerCrashProcedure, TransitRegionStateProcedure,
<p>We list procedures completed successfully of the following types only: ServerCrashProcedure, TransitRegionStateProcedure,
OpenRegionProcedure, CloseRegionProcedure.</p>
<table class="table table-striped" width="90%" >
<tr>
Expand Down Expand Up @@ -164,13 +152,13 @@
<tr>
<td><%= proc.getProcId() %></td>
<td><%= proc.hasParent() ? proc.getParentProcId() : "" %></td>
<td><%= escapeXml(proc.getState().toString() + (proc.isBypass() ? "(Bypass)" : "")) %></td>
<td><%= proc.hasOwner() ? escapeXml(proc.getOwner()) : "" %></td>
<td><%= escapeXml(proc.getProcName()) %></td>
<td><%= escapeXml10(proc.getState().toString() + (proc.isBypass() ? "(Bypass)" : "")) %></td>
<td><%= proc.hasOwner() ? escapeXml10(proc.getOwner()) : "" %></td>
<td><%= escapeXml10(proc.getProcName()) %></td>
<td><%= new Date(proc.getSubmittedTime()) %></td>
<td><%= new Date(proc.getLastUpdate()) %></td>
<td><%= escapeXml(proc.isFailed() ? proc.getException().unwrapRemoteIOException().getMessage() : "") %></td>
<td><%= escapeXml(proc.toString()) %></td>
<td><%= escapeXml10(proc.isFailed() ? proc.getException().unwrapRemoteIOException().getMessage() : "") %></td>
<td><%= escapeXml10(proc.toString()) %></td>
</tr>
<% } %>
<%
Expand Down Expand Up @@ -204,7 +192,7 @@
case EXCLUSIVE:
%>
<p>Lock type: EXCLUSIVE</p>
<p>Owner procedure: <%= escapeXml(lockedResource.getExclusiveLockOwnerProcedure().toStringDetails()) %></p>
<p>Owner procedure: <%= escapeXml10(lockedResource.getExclusiveLockOwnerProcedure().toStringDetails()) %></p>
<%
break;
case SHARED:
Expand All @@ -223,7 +211,7 @@
<table class="table table-striped" width="90%" >
<% for (Procedure<?> proc : procedures) { %>
<tr>
<td><%= escapeXml(proc.toStringDetails()) %></td>
<td><%= escapeXml10(proc.toStringDetails()) %></td>
</tr>
<% } %>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import="java.util.concurrent.TimeUnit"
import="java.util.ArrayList"
import="java.util.List"
import="org.apache.hadoop.conf.Configuration"
import="org.apache.hadoop.hbase.master.HMaster"
import="org.apache.hadoop.hbase.quotas.MasterQuotaManager"
import="org.apache.hadoop.hbase.quotas.QuotaRetriever"
Expand Down
4 changes: 2 additions & 2 deletions hbase-server/src/main/resources/hbase-webapps/master/rits.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
--%>
<%@ page contentType="text/html;charset=UTF-8"
import="static org.apache.commons.lang3.StringEscapeUtils.escapeXml"
import="static org.apache.commons.text.StringEscapeUtils.escapeXml10"
import="java.util.Collections"
import="java.util.Comparator"
import="java.util.ArrayList"
Expand Down Expand Up @@ -107,7 +107,7 @@
<td></td>
<% } else { %>
<td><%= procedure.getProcId() %></td>
<td><%= escapeXml(procedure.getState().toString() + (procedure.isBypass() ? "(Bypassed)" : "")) %></td>
<td><%= escapeXml10(procedure.getState().toString() + (procedure.isBypass() ? "(Bypassed)" : "")) %></td>
<% } %>

<% RegionState rs = regionStateNode.toRegionState(); %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import="java.util.List"
import="java.util.Map"
import="java.util.function.Function"
import="java.util.regex.Pattern"
import="java.util.stream.Stream"
import="java.util.stream.Collectors"
import="org.apache.hadoop.hbase.ServerName"
import="org.apache.hadoop.hbase.TableName"
Expand Down Expand Up @@ -169,7 +167,7 @@
totalRequestsPerSecond += sl.getRequestCountPerSecond();
lastContact = (System.currentTimeMillis() - sl.getReportTimestamp())/1000;
}
long startcode = serverName.getStartcode();
long startcode = serverName.getStartCode();
int infoPort = master.getRegionServerInfoPort(serverName);
String url = "//" + serverName.getHostname() + ":" + infoPort + "/rs-status";%>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,14 @@
<div class="row">
<div class="span12">
<%= stats.getStoreFilesCount() %> HFiles (<%= stats.getArchivedStoreFilesCount() %> in archive),
total size <%= StringUtils.humanReadableInt(stats.getStoreFilesSize()) %>
total size <%= StringUtils.TraditionalBinaryPrefix.long2String(stats.getStoreFilesSize(), "", 1) %>
(<%= stats.getSharedStoreFilePercentage() %>&#37;
<%= StringUtils.humanReadableInt(stats.getSharedStoreFilesSize()) %> shared with the source
<%= StringUtils.TraditionalBinaryPrefix.long2String(stats.getSharedStoreFilesSize(), "", 1) %> shared with the source
table)
</div>
<div class="span12">
<%= stats.getLogsCount() %> Logs, total size
<%= StringUtils.humanReadableInt(stats.getLogsSize()) %>
<%= StringUtils.TraditionalBinaryPrefix.long2String(stats.getLogsSize(), "", 1) %>
</div>
</div>
<% if (stats.isSnapshotCorrupted()) { %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,18 @@
<td>
<%= SnapshotDescriptionUtils.isExpiredSnapshot(snapshotDesc.getTtl(), snapshotDesc.getCreationTime(), System.currentTimeMillis()) ? "Yes" : "No" %>
</td>
<td><%= StringUtils.humanReadableInt(stats.getSharedStoreFilesSize()) %></td>
<td><%= StringUtils.humanReadableInt(stats.getMobStoreFilesSize()) %></td>
<td><%= StringUtils.humanReadableInt(stats.getArchivedStoreFileSize()) %>
(<%= StringUtils.humanReadableInt(stats.getNonSharedArchivedStoreFilesSize()) %>)</td>
<td><%= StringUtils.TraditionalBinaryPrefix.long2String(stats.getSharedStoreFilesSize(), "", 1) %></td>
<td><%= StringUtils.TraditionalBinaryPrefix.long2String(stats.getMobStoreFilesSize(), "", 1) %></td>
<td><%= StringUtils.TraditionalBinaryPrefix.long2String(stats.getArchivedStoreFileSize(), "", 1) %>
(<%= StringUtils.TraditionalBinaryPrefix.long2String(stats.getNonSharedArchivedStoreFilesSize(), "", 1) %>)</td>
</tr>
<% } %>
<p><%= snapshots.size() %> snapshot(s) in set.</p>
<p>Total Storefile Size: <%= StringUtils.humanReadableInt(totalSize) %></p>
<p>Total Shared Storefile Size: <%= StringUtils.humanReadableInt(totalSharedSize.get()) %>,
Total Mob Storefile Size: <%= StringUtils.humanReadableInt(totalMobSize.get()) %>,
Total Archived Storefile Size: <%= StringUtils.humanReadableInt(totalArchivedSize.get()) %>
(<%= StringUtils.humanReadableInt(totalUnsharedArchivedSize) %>)</p>
<p>Total Storefile Size: <%= StringUtils.TraditionalBinaryPrefix.long2String(totalSize, "", 1) %></p>
<p>Total Shared Storefile Size: <%= StringUtils.TraditionalBinaryPrefix.long2String(totalSharedSize.get(), "", 1) %>,
Total Mob Storefile Size: <%= StringUtils.TraditionalBinaryPrefix.long2String(totalMobSize.get(), "", 1) %>,
Total Archived Storefile Size: <%= StringUtils.TraditionalBinaryPrefix.long2String(totalArchivedSize.get(), "", 1) %>
(<%= StringUtils.TraditionalBinaryPrefix.long2String(totalUnsharedArchivedSize, "", 1) %>)</p>
<p>Shared Storefile Size is the Storefile size shared between snapshots and active tables.
Mob Storefile Size is the Mob Storefile size shared between snapshots and active tables.
Archived Storefile Size is the Storefile size in Archive.
Expand Down
Loading

0 comments on commit 5f5485c

Please sign in to comment.