You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "PDavid (via GitHub)" <gi...@apache.org> on 2025/01/08 13:35:25 UTC

[PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

PDavid opened a new pull request, #6585:
URL: https://github.com/apache/hbase/pull/6585

   Replaced the following deprecated methods in JSP files:
   
   - java.net.URLEncoder.encode(String) -> java.net.URLEncoder.encode(String, Charset)
   - org.apache.commons.lang3.StringEscapeUtils -> org.apache.commons.text.StringEscapeUtils
   - org.apache.commons.lang3.StringEscapeUtils.escapeXml -> org.apache.commons.text.StringEscapeUtils.escapeXml10
   - StringUtils.humanReadableInt(long) -> StringUtils.TraditionalBinaryPrefix.long2String(long, "", 1)
   - org.apache.hadoop.fs.FileSystem.getLength(Path) -> getFileStatus(Path).getLen()
   - org.apache.hadoop.hbase.ServerName.getStartcode() -> org.apache.hadoop.hbase.ServerName.getStartCode()


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "stoty (via GitHub)" <gi...@apache.org>.
stoty commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2601913000

   Let's skip the commons-text dependency for now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908928525


##########
hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp:
##########
@@ -95,7 +95,7 @@
             count ++; %>
          <tr>
            <td><a href="storeFile.jsp?name=<%= sf.getEncodedPath() %>"><%= sf.getPath() %></a></td>
-           <td><%= (int) (fs.getLength(sf.getPath()) / 1024 / 1024) %></td>
+           <td><%= (int) (fs.getFileStatus(sf.getPath()).getLen() / 1024 / 1024) %></td>

Review Comment:
   i hope this would never return null



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace some deprecated calls [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain merged PR #6585:
URL: https://github.com/apache/hbase/pull/6585


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace some deprecated calls [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2632911777

   > Should I also raise backports for other active branches?
   
   If the patch applies cleanly to older 2.x branches, thn not needed; else you may have to raise for each affected branch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908709822


##########
hbase-server/src/main/resources/hbase-webapps/master/snapshot.jsp:
##########
@@ -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) %>

Review Comment:
   I am not sure we have any tests for these. Please verify both functions work in same way. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1907198255


##########
hbase-server/src/main/resources/hbase-webapps/master/table.jsp:
##########
@@ -1146,11 +1168,11 @@
   <%
     for (Map.Entry<ServerName, Integer> rdEntry : regDistribution.entrySet()) {
       ServerName addr = rdEntry.getKey();
-      String url = "//" + URLEncoder.encode(addr.getHostname()) + ":"
+      String url = "//" + URLEncoder.encode(addr.getHostname(), StandardCharsets.UTF_8) + ":"
         + master.getRegionServerInfoPort(addr) + "/rs-status";
   %>
       <tr>
-        <td><a href="<%= url %>"><%= StringEscapeUtils.escapeHtml4(addr.getHostname().toString())

Review Comment:
   A bit unrelated, but this `toString()` call was not required so removed it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "Apache-HBase (via GitHub)" <gi...@apache.org>.
Apache-HBase commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2578835354

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 37s |  |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m  2s |  |  Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck  |
   |||| _ Prechecks _ |
   |||| _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m 48s |  |  master passed  |
   | +1 :green_heart: |  javadoc  |   0m 43s |  |  master passed  |
   |||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m 50s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   0m 33s |  |  the patch passed  |
   |||| _ Other Tests _ |
   | -1 :x: |  unit  |  15m 35s | [/patch-unit-hbase-server.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/1/artifact/yetus-jdk17-hadoop3-check/output/patch-unit-hbase-server.txt) |  hbase-server in the patch failed.  |
   |  |   |  26m 53s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/1/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/6585 |
   | Optional Tests | javac javadoc unit |
   | uname | Linux 542e3608a5b6 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / 5f5485ca4c8356a00f3d20289ee23ae2924c8571 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/1/testReport/ |
   | Max. process+thread count | 1493 (vs. ulimit of 30000) |
   | modules | C: hbase-server U: hbase-server |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/1/console |
   | versions | git=2.34.1 maven=3.9.8 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "stoty (via GitHub)" <gi...@apache.org>.
stoty commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2594653755

   IMO HBase already has more than enough dependencies, we should try to avoid adding more if we can.
   
   Is there a known security issue with the current xmlEscape ? 
   Is there something in another existing dependency that we could use ? 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "stoty (via GitHub)" <gi...@apache.org>.
stoty commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2594655912

   Even if it's already coming from Hadoop, it still bloats the Hadoop-less HBase assembly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1922187989


##########
hbase-server/src/main/resources/hbase-webapps/master/snapshotsStats.jsp:
##########
@@ -32,6 +32,18 @@
   import="org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription"
 %>
 <%@ page import="org.apache.hadoop.hbase.util.PrettyPrinter" %>
+<%!
+  /**
+   * Note: This method was taken from org.apache.hadoop.util.StringUtils.humanReadableInt(long).
+   * Given an integer, return a string that is in an approximate, but human
+   * readable format.
+   * @param number the number to format
+   * @return a human readable form of the integer
+   */
+  private static String humanReadableInt(long number) {
+    return StringUtils.TraditionalBinaryPrefix.long2String(number, "", 1);
+  }

Review Comment:
   Should I maybe rather extract this method to a util class as it is now duplicated in these 2 JSP files?
   Maybe it can be extracted to `org.apache.hadoop.hbase.util.Strings` util class.
   What do you think?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2580186380

   > replace org.apache.commons.lang3.StringEscapeUtils.escapeXml -> org.apache.commons.lang3.StringEscapeUtils.escapeXml10
   
   @NihalJain thanks for the review and the proposal. :+1:  As I mentioned above - since the whole `org.apache.commons.lang3.StringEscapeUtils` class is deprecated I would rather replace it with the commons-text class.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908751337


##########
hbase-server/src/main/resources/hbase-webapps/master/snapshotsStats.jsp:
##########
@@ -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>

Review Comment:
   NIT: Somehow I don't like the new method / its name. It is very cryptic. May be just add a wrapper method in this class? It's upto you though. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "stoty (via GitHub)" <gi...@apache.org>.
stoty commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2597778117

   I suggest reverting the change that requires the new commons-text dependency, and keeping the rest of the cleanups, @PDavid .


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace some deprecated calls [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2633651129

   @NihalJain since the patch does not apply cleanly, I prepared the backports here:
   - branch-2.5: https://github.com/apache/hbase/pull/6662
   - branch-2.6: https://github.com/apache/hbase/pull/6663


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "stoty (via GitHub)" <gi...@apache.org>.
stoty commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1922278151


##########
hbase-server/src/main/resources/hbase-webapps/master/snapshotsStats.jsp:
##########
@@ -32,6 +32,18 @@
   import="org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription"
 %>
 <%@ page import="org.apache.hadoop.hbase.util.PrettyPrinter" %>
+<%!
+  /**
+   * Note: This method was taken from org.apache.hadoop.util.StringUtils.humanReadableInt(long).
+   * Given an integer, return a string that is in an approximate, but human
+   * readable format.
+   * @param number the number to format
+   * @return a human readable form of the integer
+   */
+  private static String humanReadableInt(long number) {
+    return StringUtils.TraditionalBinaryPrefix.long2String(number, "", 1);
+  }

Review Comment:
   Agree



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1922189063


##########
hbase-server/src/main/resources/hbase-webapps/master/rits.jsp:
##########
@@ -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"

Review Comment:
   I'll resolve this without adding a ban as I now did not added the commons text dependency so lang3 will still be used.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1907196313


##########
hbase-server/src/main/resources/hbase-webapps/master/procedures.jsp:
##########
@@ -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,

Review Comment:
   This is a bit unrelated, just fixed this typo.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace some deprecated calls [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2615369057

   Hi @PDavid can you raise a backport for branch-2? Is this dependent on bootstrap upgrade? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2580199732

   > StringEscapeUtils
   
   Oh ok, in that case we may need to add commons text as a dependency right? Until now we have only uses commons text in 2 test classes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908942220


##########
pom.xml:
##########
@@ -849,6 +849,7 @@
     <commons-validator.version>1.7</commons-validator.version>
     <commons-io.version>2.14.0</commons-io.version>
     <commons-lang3.version>3.9</commons-lang3.version>
+    <commons-text.version>1.10.0</commons-text.version>

Review Comment:
   This is actually not the latest version (latest is 1.13.0) but this is the version which we HBase had transitively via `org.apache.hadoop:hadoop-common:jar:3.4.1`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "stoty (via GitHub)" <gi...@apache.org>.
stoty commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2597778690

   Unless it fixes a known security issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace some deprecated calls [hbase]

Posted by "Apache-HBase (via GitHub)" <gi...@apache.org>.
Apache-HBase commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2607728281

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 29s |  |  Docker mode activated.  |
   |||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any anti-patterns.  |
   |||| _ master Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 11s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   2m 52s |  |  master passed  |
   | +1 :green_heart: |  compile  |   4m 43s |  |  master passed  |
   | +1 :green_heart: |  checkstyle  |   1m  5s |  |  master passed  |
   | +1 :green_heart: |  spotbugs  |   2m 50s |  |  master passed  |
   | +1 :green_heart: |  spotless  |   0m 41s |  |  branch has no errors when running spotless:check.  |
   |||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 11s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   2m 49s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   4m 46s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   4m 46s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks issues.  |
   | +1 :green_heart: |  checkstyle  |   1m  8s |  |  the patch passed  |
   | +1 :green_heart: |  spotbugs  |   3m 27s |  |  the patch passed  |
   | +1 :green_heart: |  hadoopcheck  |  11m  0s |  |  Patch does not cause any errors with Hadoop 3.3.6 3.4.0.  |
   | +1 :green_heart: |  spotless  |   0m 43s |  |  patch has no errors when running spotless:check.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 33s |  |  The patch does not generate ASF License warnings.  |
   |  |   |  45m  7s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/6/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/6585 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless |
   | uname | Linux 50ae3af7d97e 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / cc52e795a2689aa6153c07fb37891b4bae7e0536 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 85 (vs. ulimit of 30000) |
   | modules | C: hbase-common hbase-server hbase-mapreduce hbase-diagnostics U: . |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/6/console |
   | versions | git=2.34.1 maven=3.9.8 spotbugs=4.7.3 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "stoty (via GitHub)" <gi...@apache.org>.
stoty commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2606606085

   Update the ticket and commit description.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace some deprecated calls [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2630352378

   > Hi @PDavid can you raise a backport for branch-2? Is this dependent on bootstrap upgrade?
   
   Hi @NihalJain,
   Many thanks for merging this PR. :pray: 
   
   As far as I see, this is not dependent on the Bootstrap upgrade.
   Here I prepared the backport for branch-2: https://github.com/apache/hbase/pull/6658
   
   
   Should I also raise backports for other active branches?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "Apache-HBase (via GitHub)" <gi...@apache.org>.
Apache-HBase commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2578812978

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 28s |  |  Docker mode activated.  |
   |||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files found.  |
   | +0 :ok: |  codespell  |   0m  1s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  1s |  |  detect-secrets was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain any @author tags.  |
   |||| _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m 16s |  |  master passed  |
   | +1 :green_heart: |  spotless  |   0m 50s |  |  branch has no errors when running spotless:check.  |
   |||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m  8s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks issues.  |
   | +1 :green_heart: |  spotless  |   0m 45s |  |  patch has no errors when running spotless:check.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 10s |  |  The patch does not generate ASF License warnings.  |
   |  |   |   9m 57s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/1/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/6585 |
   | Optional Tests | dupname asflicense javac codespell detsecrets spotless |
   | uname | Linux 166c38e1fa8d 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / 5f5485ca4c8356a00f3d20289ee23ae2924c8571 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 83 (vs. ulimit of 30000) |
   | modules | C: hbase-server U: hbase-server |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/1/console |
   | versions | git=2.34.1 maven=3.9.8 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "Apache-HBase (via GitHub)" <gi...@apache.org>.
Apache-HBase commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2602074579

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m  0s |  |  Docker mode activated.  |
   | -1 :x: |  docker  |   0m  3s |  |  Docker failed to build run-specific yetus/hbase:tp-19379}.  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | GITHUB PR | https://github.com/apache/hbase/pull/6585 |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/3/console |
   | versions | git=2.17.1 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1922204309


##########
hbase-server/src/main/resources/hbase-webapps/master/snapshotsStats.jsp:
##########
@@ -32,6 +32,18 @@
   import="org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription"
 %>
 <%@ page import="org.apache.hadoop.hbase.util.PrettyPrinter" %>
+<%!
+  /**
+   * Note: This method was taken from org.apache.hadoop.util.StringUtils.humanReadableInt(long).
+   * Given an integer, return a string that is in an approximate, but human
+   * readable format.
+   * @param number the number to format
+   * @return a human readable form of the integer
+   */
+  private static String humanReadableInt(long number) {
+    return StringUtils.TraditionalBinaryPrefix.long2String(number, "", 1);
+  }

Review Comment:
   Yes please. We have several instances of the deprecated method all over the code, we can re-use it for those case as well. See https://github.com/search?q=repo%3Aapache%2Fhbase+StringUtils.humanReadableInt&type=code



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "stoty (via GitHub)" <gi...@apache.org>.
stoty commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2606420321

   This looks mostly good to me, my only problem that this does not match the JIRA description.
   At least half of the changes are not in JSPs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace some deprecated calls [hbase]

Posted by "Apache-HBase (via GitHub)" <gi...@apache.org>.
Apache-HBase commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2607608016

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 42s |  |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m  3s |  |  Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck  |
   |||| _ Prechecks _ |
   |||| _ master Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 11s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   3m 20s |  |  master passed  |
   | +1 :green_heart: |  compile  |   1m 53s |  |  master passed  |
   | +1 :green_heart: |  javadoc  |   1m  9s |  |  master passed  |
   | +1 :green_heart: |  shadedjars  |   5m 44s |  |  branch has no errors when building our shaded downstream artifacts.  |
   |||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 12s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   2m 54s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   1m 49s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   1m 49s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   1m  8s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   7m 22s |  |  patch has no errors when building our shaded downstream artifacts.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |   2m 26s |  |  hbase-common in the patch passed.  |
   | +1 :green_heart: |  unit  | 212m 10s |  |  hbase-server in the patch passed.  |
   | +1 :green_heart: |  unit  |  20m 10s |  |  hbase-mapreduce in the patch passed.  |
   | +1 :green_heart: |  unit  |   6m 33s |  |  hbase-diagnostics in the patch passed.  |
   |  |   | 273m 46s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/5/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/6585 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux c61021d05784 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / e230e417dd3f12bac53a78f70873067bbe0b109f |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/5/testReport/ |
   | Max. process+thread count | 5173 (vs. ulimit of 30000) |
   | modules | C: hbase-common hbase-server hbase-mapreduce hbase-diagnostics U: . |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/5/console |
   | versions | git=2.34.1 maven=3.9.8 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908751337


##########
hbase-server/src/main/resources/hbase-webapps/master/snapshotsStats.jsp:
##########
@@ -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>

Review Comment:
   NIT: Somehow I don't like the new method / its name / params. It is very cryptic. May be just add a wrapper method in this class? It's upto you though. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908812432


##########
hbase-server/src/main/resources/hbase-webapps/master/table.jsp:
##########
@@ -104,35 +105,65 @@
   }
 
   /**
-   * Render an <td> tag contents server name which the given region deploys.
-   * Links to the server rs-status page.
-   * <td class="undeployed-region">not deployed</td> instead if can not find the deploy message.
-   * @return an <td> tag contents server name links to server rs-status page.
+   * Returns the socket address (host and port delimited with a colon - for example: server-01:16030) of the region server wrapped in an Optional.
+   * When ServerName is null, it returns an empty Optional.
+   *
+   * @param master not null HMaster instance used to get the region server info port.
+   * @param serverName not null ServerName instance, for figuring our the host name.
+   *
+   * @return the socket address of the region server in an Optional or empty Optional.
    */
-  private static String buildRegionDeployedServerTag(RegionInfo regionInfo, HMaster master,
-    Map<RegionInfo, ServerName> regionsToServer) {
-    ServerName serverName = regionsToServer.get(regionInfo);
-
+  private static Optional<String> buildRegionServerSocketAddress(HMaster master, ServerName serverName) {
     if (serverName == null) {
-      return "<td class=\"undeployed-region\">not deployed</td>";
+      return Optional.empty();
     }
 
+    // The host name portion should be safe, but I don't know how we handle IDNs so err on the side of failing safely.
     String hostName = serverName.getHostname();
-    String hostNameEncoded = URLEncoder.encode(hostName);
-    // This port might be wrong if RS actually ended up using something else.
-    int serverInfoPort = master.getRegionServerInfoPort(serverName);
-    String urlRegionServer = "//" + hostNameEncoded + ":" + serverInfoPort + "/rs-status";
+    String hostNameEncoded = URLEncoder.encode(hostName, StandardCharsets.UTF_8);

Review Comment:
   Yeah maybe I went a bit too far with this refactoring here. :sweat_smile: 
   
   When I fixed the deprecation, I noticed that the same code is duplicated in 3 places in the JSP so I extracted it and also noticed that `buildRegionDeployedServerTag()` is basically the same, just the default value is different if `serverName` is null.
   
   I tested this locally a bit and ti looked fine but to be on the safe side I can undo the refactor and just fix the deprecation (`URLEncoder.encode()`).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908806229


##########
hbase-server/src/main/resources/hbase-webapps/master/snapshot.jsp:
##########
@@ -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) %>

Review Comment:
   > I am not sure we have any tests for these. 
   
   Yeah I think this is the problem with the JSP UI that we don't have tests for it and I'm not sure how to add tests.
   
   Maybe we could extract the inline Java code from the JSP-s to "backing beans" (some Java classes) which is then called by JSP-s. But this is not a small task.
   
   > Please verify both functions work in same way.
   
   This is actually the implementation of the `org.apache.hadoop.util.StringUtils.humanReadableInt(long)` method:
   
   ```java
     /**
      * Given an integer, return a string that is in an approximate, but human 
      * readable format. 
      * @param number the number to format
      * @return a human readable form of the integer
      *
      * @deprecated use {@link TraditionalBinaryPrefix#long2String(long, String, int)}.
      */
     @Deprecated
     public static String humanReadableInt(long number) {
       return TraditionalBinaryPrefix.long2String(number, "", 1);
     }
   ```
   
   See: https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/StringUtils.java#L133
   
   Of course to make this a bit nicer we could introduce a utility method in Java code and call that from the JSP. What do you think?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908816781


##########
hbase-server/src/main/resources/hbase-webapps/master/snapshot.jsp:
##########
@@ -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) %>

Review Comment:
   Yes I went into hadoop code to see the cryptic params. Hence put up the NIT comment. I think I am good with this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908934885


##########
hbase-server/src/main/resources/hbase-webapps/master/rits.jsp:
##########
@@ -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"

Review Comment:
   nit: we could add a ban for org.apache.commons.lang3.StringEscapeUtils in pom.xml



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908942937


##########
hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp:
##########
@@ -95,7 +95,7 @@
             count ++; %>
          <tr>
            <td><a href="storeFile.jsp?name=<%= sf.getEncodedPath() %>"><%= sf.getPath() %></a></td>
-           <td><%= (int) (fs.getLength(sf.getPath()) / 1024 / 1024) %></td>
+           <td><%= (int) (fs.getFileStatus(sf.getPath()).getLen() / 1024 / 1024) %></td>

Review Comment:
   Yeah, me too. :see_no_evil: 
   
   Actually `org.apache.hadoop.fs.FileSystem.getLength()` also has the same implementation:
   
   ```java
     public long getLength(Path f) throws IOException {
       return getFileStatus(f).getLen();
     }
   ```
   See: https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java#L1913



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1922363772


##########
hbase-server/src/main/resources/hbase-webapps/master/snapshotsStats.jsp:
##########
@@ -32,6 +32,18 @@
   import="org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription"
 %>
 <%@ page import="org.apache.hadoop.hbase.util.PrettyPrinter" %>
+<%!
+  /**
+   * Note: This method was taken from org.apache.hadoop.util.StringUtils.humanReadableInt(long).
+   * Given an integer, return a string that is in an approximate, but human
+   * readable format.
+   * @param number the number to format
+   * @return a human readable form of the integer
+   */
+  private static String humanReadableInt(long number) {
+    return StringUtils.TraditionalBinaryPrefix.long2String(number, "", 1);
+  }

Review Comment:
   Thanks, this should be done now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "Apache-HBase (via GitHub)" <gi...@apache.org>.
Apache-HBase commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2602095537

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 28s |  |  Docker mode activated.  |
   |||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain any @author tags.  |
   |||| _ master Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   3m  8s |  |  master passed  |
   | +1 :green_heart: |  spotless  |   0m 46s |  |  branch has no errors when running spotless:check.  |
   |||| _ Patch Compile Tests _ |
   | +1 :green_heart: |  mvninstall  |   2m 51s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks issues.  |
   | +1 :green_heart: |  spotless  |   0m 41s |  |  patch has no errors when running spotless:check.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 10s |  |  The patch does not generate ASF License warnings.  |
   |  |   |   9m 23s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/3/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/6585 |
   | Optional Tests | dupname asflicense javac codespell detsecrets spotless |
   | uname | Linux 08e0188f35af 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / 09cf7db8631f73dd17ce04dc48ba14aa213809bf |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 81 (vs. ulimit of 30000) |
   | modules | C: hbase-server U: hbase-server |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/3/console |
   | versions | git=2.34.1 maven=3.9.8 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace some deprecated calls [hbase]

Posted by "Apache-HBase (via GitHub)" <gi...@apache.org>.
Apache-HBase commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2608189145

   :broken_heart: **-1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 35s |  |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m  3s |  |  Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck  |
   |||| _ Prechecks _ |
   |||| _ master Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 15s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   3m 33s |  |  master passed  |
   | +1 :green_heart: |  compile  |   2m 11s |  |  master passed  |
   | +1 :green_heart: |  javadoc  |   1m 21s |  |  master passed  |
   | +1 :green_heart: |  shadedjars  |   6m  5s |  |  branch has no errors when building our shaded downstream artifacts.  |
   |||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 13s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   2m 53s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   1m 50s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   1m 50s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   1m  8s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   5m 45s |  |  patch has no errors when building our shaded downstream artifacts.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |   2m 15s |  |  hbase-common in the patch passed.  |
   | -1 :x: |  unit  | 210m 57s | [/patch-unit-hbase-server.txt](https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/6/artifact/yetus-jdk17-hadoop3-check/output/patch-unit-hbase-server.txt) |  hbase-server in the patch failed.  |
   | +1 :green_heart: |  unit  |  19m 51s |  |  hbase-mapreduce in the patch passed.  |
   | +1 :green_heart: |  unit  |   4m 49s |  |  hbase-diagnostics in the patch passed.  |
   |  |   | 269m  2s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/6/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/6585 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux 7d1224dd353b 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / cc52e795a2689aa6153c07fb37891b4bae7e0536 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/6/testReport/ |
   | Max. process+thread count | 5215 (vs. ulimit of 30000) |
   | modules | C: hbase-common hbase-server hbase-mapreduce hbase-diagnostics U: . |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/6/console |
   | versions | git=2.34.1 maven=3.9.8 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2601903698

   Hi @NihalJain and @stotyű!
   
   Many thanks for your feedback. :+1: 
   
   My motivation of adding commons text was that the used API (`org.apache.commons.lang3.StringEscapeUtils`) was moved to commons text and it is marked as deprecated in commons lang.  I think in a future version the deprecated API will be removed. That's why it is better to not depend on it in my opinion. Commons text is a small Apache library which does not have any other dependencies.
   
   But of course if you wish, we can keep using the deprecated API as today it is still there.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2579356818

   In the PR build there were some failed tests but to me they look unrelated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908745853


##########
hbase-server/src/main/resources/hbase-webapps/master/table.jsp:
##########
@@ -104,35 +105,65 @@
   }
 
   /**
-   * Render an <td> tag contents server name which the given region deploys.
-   * Links to the server rs-status page.
-   * <td class="undeployed-region">not deployed</td> instead if can not find the deploy message.
-   * @return an <td> tag contents server name links to server rs-status page.
+   * Returns the socket address (host and port delimited with a colon - for example: server-01:16030) of the region server wrapped in an Optional.
+   * When ServerName is null, it returns an empty Optional.
+   *
+   * @param master not null HMaster instance used to get the region server info port.
+   * @param serverName not null ServerName instance, for figuring our the host name.
+   *
+   * @return the socket address of the region server in an Optional or empty Optional.
    */
-  private static String buildRegionDeployedServerTag(RegionInfo regionInfo, HMaster master,
-    Map<RegionInfo, ServerName> regionsToServer) {
-    ServerName serverName = regionsToServer.get(regionInfo);
-
+  private static Optional<String> buildRegionServerSocketAddress(HMaster master, ServerName serverName) {
     if (serverName == null) {
-      return "<td class=\"undeployed-region\">not deployed</td>";
+      return Optional.empty();
     }
 
+    // The host name portion should be safe, but I don't know how we handle IDNs so err on the side of failing safely.
     String hostName = serverName.getHostname();
-    String hostNameEncoded = URLEncoder.encode(hostName);
-    // This port might be wrong if RS actually ended up using something else.
-    int serverInfoPort = master.getRegionServerInfoPort(serverName);
-    String urlRegionServer = "//" + hostNameEncoded + ":" + serverInfoPort + "/rs-status";
+    String hostNameEncoded = URLEncoder.encode(hostName, StandardCharsets.UTF_8);

Review Comment:
   This refactoring was not really necessary right? Not sure, this could break something? Please ensure the code behaves same way before and after.
   
   Also would leave this for a 2nd eyes before we merge this!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908761825


##########
hbase-server/src/main/resources/hbase-webapps/master/procedures.jsp:
##########
@@ -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"

Review Comment:
   @NihalJain Sorry, can I ask why shouldn't we use commons-text here?
   
   > I don't even see commons-text as a direct dependency to hbase.
   
   That's a good point, thanks. :+1: I guess commons-text is not a direct dependency to hbase but a transitive one. If required we can add it as a direct dependency.
   
   > We should replace with org.apache.commons.lang3.StringEscapeUtils.escapeXml10, isn't it?[apache/commons-lang@`29ccc76`/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java#L618](https://github.com/apache/commons-lang/blob/29ccc7665f3bc5d84155a3092ab2209a053324e6/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java#L618)
   
   As you may see in the JavaDoc of [org.apache.commons.lang3.StringEscapeUtils](https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringEscapeUtils.html), it says:
   
   > As of 3.6, use Apache Commons Text [StringEscapeUtils](https://commons.apache.org/proper/commons-text/javadocs/api-release/org/apache/commons/text/StringEscapeUtils.html) instead
   
   So the whole `org.apache.commons.lang3.StringEscapeUtils` class is deprecated.
   
   Also according to [this StackOverflow answer](https://stackoverflow.com/a/49647538/9369409), this `StringEscapeUtils` class was moved over to commons-text but still kept as deprecated in commons-lang3.
   
   
   
   
   
   
   
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908959884


##########
hbase-server/src/main/resources/hbase-webapps/regionserver/region.jsp:
##########
@@ -95,7 +95,7 @@
             count ++; %>
          <tr>
            <td><a href="storeFile.jsp?name=<%= sf.getEncodedPath() %>"><%= sf.getPath() %></a></td>
-           <td><%= (int) (fs.getLength(sf.getPath()) / 1024 / 1024) %></td>
+           <td><%= (int) (fs.getFileStatus(sf.getPath()).getLen() / 1024 / 1024) %></td>

Review Comment:
   Then we are safe 😂



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908707128


##########
hbase-server/src/main/resources/hbase-webapps/master/procedures.jsp:
##########
@@ -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"

Review Comment:
   We should not use commons-text here, I don't even see commons-text as a direct dependency to hbase.
   
   We should replace with org.apache.commons.lang3.StringEscapeUtils.escapeXml10, isn't it?https://github.com/apache/commons-lang/blob/29ccc7665f3bc5d84155a3092ab2209a053324e6/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java#L618



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908818264


##########
hbase-server/src/main/resources/hbase-webapps/master/table.jsp:
##########
@@ -104,35 +105,65 @@
   }
 
   /**
-   * Render an <td> tag contents server name which the given region deploys.
-   * Links to the server rs-status page.
-   * <td class="undeployed-region">not deployed</td> instead if can not find the deploy message.
-   * @return an <td> tag contents server name links to server rs-status page.
+   * Returns the socket address (host and port delimited with a colon - for example: server-01:16030) of the region server wrapped in an Optional.
+   * When ServerName is null, it returns an empty Optional.
+   *
+   * @param master not null HMaster instance used to get the region server info port.
+   * @param serverName not null ServerName instance, for figuring our the host name.
+   *
+   * @return the socket address of the region server in an Optional or empty Optional.
    */
-  private static String buildRegionDeployedServerTag(RegionInfo regionInfo, HMaster master,
-    Map<RegionInfo, ServerName> regionsToServer) {
-    ServerName serverName = regionsToServer.get(regionInfo);
-
+  private static Optional<String> buildRegionServerSocketAddress(HMaster master, ServerName serverName) {
     if (serverName == null) {
-      return "<td class=\"undeployed-region\">not deployed</td>";
+      return Optional.empty();
     }
 
+    // The host name portion should be safe, but I don't know how we handle IDNs so err on the side of failing safely.
     String hostName = serverName.getHostname();
-    String hostNameEncoded = URLEncoder.encode(hostName);
-    // This port might be wrong if RS actually ended up using something else.
-    int serverInfoPort = master.getRegionServerInfoPort(serverName);
-    String urlRegionServer = "//" + hostNameEncoded + ":" + serverInfoPort + "/rs-status";
+    String hostNameEncoded = URLEncoder.encode(hostName, StandardCharsets.UTF_8);

Review Comment:
   Yes we can fix the refactor as another ticket as well



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1908922222


##########
hbase-server/src/main/resources/hbase-webapps/master/table.jsp:
##########
@@ -104,35 +105,65 @@
   }
 
   /**
-   * Render an <td> tag contents server name which the given region deploys.
-   * Links to the server rs-status page.
-   * <td class="undeployed-region">not deployed</td> instead if can not find the deploy message.
-   * @return an <td> tag contents server name links to server rs-status page.
+   * Returns the socket address (host and port delimited with a colon - for example: server-01:16030) of the region server wrapped in an Optional.
+   * When ServerName is null, it returns an empty Optional.
+   *
+   * @param master not null HMaster instance used to get the region server info port.
+   * @param serverName not null ServerName instance, for figuring our the host name.
+   *
+   * @return the socket address of the region server in an Optional or empty Optional.
    */
-  private static String buildRegionDeployedServerTag(RegionInfo regionInfo, HMaster master,
-    Map<RegionInfo, ServerName> regionsToServer) {
-    ServerName serverName = regionsToServer.get(regionInfo);
-
+  private static Optional<String> buildRegionServerSocketAddress(HMaster master, ServerName serverName) {
     if (serverName == null) {
-      return "<td class=\"undeployed-region\">not deployed</td>";
+      return Optional.empty();
     }
 
+    // The host name portion should be safe, but I don't know how we handle IDNs so err on the side of failing safely.
     String hostName = serverName.getHostname();
-    String hostNameEncoded = URLEncoder.encode(hostName);
-    // This port might be wrong if RS actually ended up using something else.
-    int serverInfoPort = master.getRegionServerInfoPort(serverName);
-    String urlRegionServer = "//" + hostNameEncoded + ":" + serverInfoPort + "/rs-status";
+    String hostNameEncoded = URLEncoder.encode(hostName, StandardCharsets.UTF_8);

Review Comment:
   OK, I reverted this refactoring for now.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2594661076

   > IMO HBase already has more than enough dependencies, we should try to avoid adding more if we can.
   > 
   > Is there a known security issue with the current xmlEscape ? Is there something in another existing dependency that we could use ?
   
   +1 on idea of avoiding new dependency. I too am skeptical about this new addition and needed another set of eyes to approve of this. Thanks for chiming in @stoty !


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "NihalJain (via GitHub)" <gi...@apache.org>.
NihalJain commented on code in PR #6585:
URL: https://github.com/apache/hbase/pull/6585#discussion_r1922204309


##########
hbase-server/src/main/resources/hbase-webapps/master/snapshotsStats.jsp:
##########
@@ -32,6 +32,18 @@
   import="org.apache.hadoop.hbase.shaded.protobuf.generated.SnapshotProtos.SnapshotDescription"
 %>
 <%@ page import="org.apache.hadoop.hbase.util.PrettyPrinter" %>
+<%!
+  /**
+   * Note: This method was taken from org.apache.hadoop.util.StringUtils.humanReadableInt(long).
+   * Given an integer, return a string that is in an approximate, but human
+   * readable format.
+   * @param number the number to format
+   * @return a human readable form of the integer
+   */
+  private static String humanReadableInt(long number) {
+    return StringUtils.TraditionalBinaryPrefix.long2String(number, "", 1);
+  }

Review Comment:
   Yes please. We have several instances of the deprecated method all over the code, we can re-use it for those cases as well. See https://github.com/search?q=repo%3Aapache%2Fhbase+StringUtils.humanReadableInt&type=code



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2602066246

   OK, now as suggested I reverted the change that requires the new commons-text dependency. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "Apache-HBase (via GitHub)" <gi...@apache.org>.
Apache-HBase commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2602471661

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 46s |  |  Docker mode activated.  |
   |||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any anti-patterns.  |
   |||| _ master Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 11s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   4m 15s |  |  master passed  |
   | +1 :green_heart: |  compile  |   5m 43s |  |  master passed  |
   | +1 :green_heart: |  checkstyle  |   1m 16s |  |  master passed  |
   | +1 :green_heart: |  spotbugs  |   3m 25s |  |  master passed  |
   | +1 :green_heart: |  spotless  |   1m  6s |  |  branch has no errors when running spotless:check.  |
   |||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 10s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m 41s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   5m 27s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   5m 27s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks issues.  |
   | +1 :green_heart: |  checkstyle  |   1m 16s |  |  the patch passed  |
   | +1 :green_heart: |  spotbugs  |   4m 33s |  |  the patch passed  |
   | +1 :green_heart: |  hadoopcheck  |  16m 39s |  |  Patch does not cause any errors with Hadoop 3.3.6 3.4.0.  |
   | +1 :green_heart: |  spotless  |   1m  4s |  |  patch has no errors when running spotless:check.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 48s |  |  The patch does not generate ASF License warnings.  |
   |  |   |  61m  1s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/4/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/6585 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless |
   | uname | Linux bc3ae9e88af9 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / 8fc881e80bf3ae6f3bda81a2c3695e3b6283f302 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 83 (vs. ulimit of 30000) |
   | modules | C: hbase-common hbase-server hbase-mapreduce hbase-diagnostics U: . |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/4/console |
   | versions | git=2.34.1 maven=3.9.8 spotbugs=4.7.3 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "Apache-HBase (via GitHub)" <gi...@apache.org>.
Apache-HBase commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2602939021

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 46s |  |  Docker mode activated.  |
   | -0 :warning: |  yetus  |   0m  3s |  |  Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck  |
   |||| _ Prechecks _ |
   |||| _ master Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 13s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   3m 59s |  |  master passed  |
   | +1 :green_heart: |  compile  |   2m 20s |  |  master passed  |
   | +1 :green_heart: |  javadoc  |   1m 26s |  |  master passed  |
   | +1 :green_heart: |  shadedjars  |   6m 32s |  |  branch has no errors when building our shaded downstream artifacts.  |
   |||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 12s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m 52s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   2m 20s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   2m 20s |  |  the patch passed  |
   | +1 :green_heart: |  javadoc  |   1m 24s |  |  the patch passed  |
   | +1 :green_heart: |  shadedjars  |   6m 28s |  |  patch has no errors when building our shaded downstream artifacts.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  unit  |   2m 54s |  |  hbase-common in the patch passed.  |
   | +1 :green_heart: |  unit  | 211m 16s |  |  hbase-server in the patch passed.  |
   | +1 :green_heart: |  unit  |  19m 19s |  |  hbase-mapreduce in the patch passed.  |
   | +1 :green_heart: |  unit  |   4m 48s |  |  hbase-diagnostics in the patch passed.  |
   |  |   | 273m  1s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/4/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/6585 |
   | Optional Tests | javac javadoc unit compile shadedjars |
   | uname | Linux 2bf9ab4fcab6 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / 8fc881e80bf3ae6f3bda81a2c3695e3b6283f302 |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   |  Test Results | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/4/testReport/ |
   | Max. process+thread count | 4833 (vs. ulimit of 30000) |
   | modules | C: hbase-common hbase-server hbase-mapreduce hbase-diagnostics U: . |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/4/console |
   | versions | git=2.34.1 maven=3.9.8 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace some deprecated calls [hbase]

Posted by "Apache-HBase (via GitHub)" <gi...@apache.org>.
Apache-HBase commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2607097635

   :confetti_ball: **+1 overall**
   
   
   
   
   
   
   | Vote | Subsystem | Runtime |  Logfile | Comment |
   |:----:|----------:|--------:|:--------:|:-------:|
   | +0 :ok: |  reexec  |   0m 44s |  |  Docker mode activated.  |
   |||| _ Prechecks _ |
   | +1 :green_heart: |  dupname  |   0m  0s |  |  No case conflicting files found.  |
   | +0 :ok: |  codespell  |   0m  0s |  |  codespell was not available.  |
   | +0 :ok: |  detsecrets  |   0m  0s |  |  detect-secrets was not available.  |
   | +1 :green_heart: |  @author  |   0m  0s |  |  The patch does not contain any @author tags.  |
   | +1 :green_heart: |  hbaseanti  |   0m  0s |  |  Patch does not have any anti-patterns.  |
   |||| _ master Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 20s |  |  Maven dependency ordering for branch  |
   | +1 :green_heart: |  mvninstall  |   4m 27s |  |  master passed  |
   | +1 :green_heart: |  compile  |   6m 37s |  |  master passed  |
   | +1 :green_heart: |  checkstyle  |   1m 36s |  |  master passed  |
   | +1 :green_heart: |  spotbugs  |   4m  3s |  |  master passed  |
   | +1 :green_heart: |  spotless  |   1m 10s |  |  branch has no errors when running spotless:check.  |
   |||| _ Patch Compile Tests _ |
   | +0 :ok: |  mvndep  |   0m 13s |  |  Maven dependency ordering for patch  |
   | +1 :green_heart: |  mvninstall  |   3m 48s |  |  the patch passed  |
   | +1 :green_heart: |  compile  |   6m 24s |  |  the patch passed  |
   | +1 :green_heart: |  javac  |   6m 24s |  |  the patch passed  |
   | +1 :green_heart: |  blanks  |   0m  0s |  |  The patch has no blanks issues.  |
   | +1 :green_heart: |  checkstyle  |   1m 46s |  |  the patch passed  |
   | +1 :green_heart: |  spotbugs  |   4m 51s |  |  the patch passed  |
   | +1 :green_heart: |  hadoopcheck  |  14m  4s |  |  Patch does not cause any errors with Hadoop 3.3.6 3.4.0.  |
   | +1 :green_heart: |  spotless  |   1m  3s |  |  patch has no errors when running spotless:check.  |
   |||| _ Other Tests _ |
   | +1 :green_heart: |  asflicense  |   0m 47s |  |  The patch does not generate ASF License warnings.  |
   |  |   |  61m 16s |  |  |
   
   
   | Subsystem | Report/Notes |
   |----------:|:-------------|
   | Docker | ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/5/artifact/yetus-general-check/output/Dockerfile |
   | GITHUB PR | https://github.com/apache/hbase/pull/6585 |
   | Optional Tests | dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless |
   | uname | Linux b8b4b1fe3b5e 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux |
   | Build tool | maven |
   | Personality | dev-support/hbase-personality.sh |
   | git revision | master / e230e417dd3f12bac53a78f70873067bbe0b109f |
   | Default Java | Eclipse Adoptium-17.0.11+9 |
   | Max. process+thread count | 84 (vs. ulimit of 30000) |
   | modules | C: hbase-common hbase-server hbase-mapreduce hbase-diagnostics U: . |
   | Console output | https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6585/5/console |
   | versions | git=2.34.1 maven=3.9.8 spotbugs=4.7.3 |
   | Powered by | Apache Yetus 0.15.0 https://yetus.apache.org |
   
   
   This message was automatically generated.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] HBASE-29026 Replace deprecated calls in JSP files [hbase]

Posted by "PDavid (via GitHub)" <gi...@apache.org>.
PDavid commented on PR #6585:
URL: https://github.com/apache/hbase/pull/6585#issuecomment-2606565909

   > This looks mostly good to me, my only problem that this does not match the JIRA description. At least half of the changes are not in JSPs.
   
   @stoty thanks, this is a very good point. I started with the deprecated calls in the JSP-s but then @NihalJain [proposed to also replace the same](https://github.com/apache/hbase/pull/6585#discussion_r1922204309) `org.apache.hadoop.util.StringUtils.humanReadableInt(long)` call in all places.
   So eventually now we have more changes not in the JSP-s. :see_no_evil: 
   
   Should I maybe revert those changes? Or rename the Jira ticket?
   What do you all think?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org