Skip to content

Conversation

@PDavid
Copy link
Contributor

@PDavid PDavid commented Oct 16, 2025

This is the last step of the Jamon to JSP migration: the Canary Status page.

Did the migration the same way as for the:

Migrated the Jamon code to JSP as close as possible. Extracted some duplicated server link code to new java class: CanaryStatusUtil and added unit tests.

Changed the Canary Server Status page back to /canary.jsp. Made sure that /canary-status redirects to /canary.jsp.

Introduced a src/main/resources/hbase-webapps/common directory where we can place common JSP files which are used by both Master and RegionServer JSP pages. This required to adjust the JSP compiler Maven Antrun plugin a bit.

Made sure to compile Canary JSP files the same way as we do for Master and Region server JSP pages.

Removed the Jamon Maven dependencies and references to Jamon code.

@PDavid PDavid self-assigned this Oct 16, 2025
@Apache-HBase

This comment has been minimized.

@PDavid
Copy link
Contributor Author

PDavid commented Oct 16, 2025

Testing

Tested this by starting HBase in standalone mode with mvn clean install -DskipTests && bin/start-hbase.sh.

Configured Canary tool info port in conf/hbase-site.xml:

...
  <property>
    <name>hbase.canary.info.port</name>
    <value>16019</value>
  </property>
...

Started the Canary tool in daemon mode (this provides the Canary Status page web UI) with ./bin/hbase canary -daemon -interval 5 -f false

Checked the Canary Status web UI page:

image

@Apache-HBase

This comment has been minimized.

@PDavid
Copy link
Contributor Author

PDavid commented Oct 16, 2025

TestRSGroupsWithACL failed in the PR build. I think it is not related.

@PDavid PDavid marked this pull request as ready for review October 16, 2025 17:37
@Apache9 Apache9 requested a review from Copilot November 1, 2025 14:37
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the Jamon template dependency from HBase and replaces the Jamon-based Canary status page with a native JSP implementation. The key changes include removing Jamon dependencies, converting the Jamon template to JSP, creating a utility class for shared functionality, and adding comprehensive test coverage for the new JSP-based web UI.

  • Removes all Jamon dependencies and build configurations across multiple modules
  • Replaces Jamon template (CanaryStatusTmpl.jamon) with a native JSP implementation (canary.jsp)
  • Creates a new utility class CanaryStatusUtil for generating server name links
  • Adds comprehensive test coverage for the Canary web UI functionality

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pom.xml Removes Jamon dependency and plugin version properties from parent POM
hbase-server/pom.xml Removes Jamon runtime dependency, plugin configuration, and Eclipse plugin settings for Jamon; adds JSP compilation for canary webapp
hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/tool/CanaryStatusTmpl.jamon Deletes the Jamon template file
hbase-server/src/main/resources/hbase-webapps/canary/canary.jsp Replaces redirect with full JSP implementation of Canary status page
hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryStatusServlet.java Simplifies servlet to only redirect to canary.jsp instead of rendering Jamon template
hbase-server/src/main/java/org/apache/hadoop/hbase/util/CanaryStatusUtil.java Adds new utility class for generating server name links
hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestCanaryStatusUtil.java Adds tests for the new utility class
hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryStatusServlet.java Removes tests for Jamon-based servlet
hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java Adds comprehensive integration tests for the new JSP-based web UI
hbase-zookeeper/pom.xml Removes Jamon Eclipse plugin configuration
hbase-shaded/pom.xml Removes Jamon package relocation configuration
hbase-resource-bundle/src/main/resources/supplemental-models.xml Removes Jamon license information
hbase-checkstyle/src/main/resources/hbase/checkstyle-suppressions.xml Removes checkstyle suppression for generated Jamon files
src/main/asciidoc/_chapters/developer.adoc Updates documentation to remove reference to generated-jamon folder

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +34 to +40
int infoPort = serverName.getPort() + 1;
String url = "//" + serverName.getHostname() + ":" + infoPort + "/";
if (infoPort > 0) {
return "<a href=\"" + url + "\">" + serverName.getServerName() + "</a>";
} else {
return serverName.getServerName();
}
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic is incorrect: when serverName.getPort() returns -1, infoPort becomes 0, but the condition checks if (infoPort > 0). This means when the port is -1, infoPort is 0, which fails the > 0 check correctly. However, when the port is valid (e.g., 12345), infoPort is 12346 (always > 0), so the link is always returned. The condition should check if the original port is valid (>= 0) before creating the link, not if infoPort > 0. The correct check should be if (serverName.getPort() >= 0) or if (infoPort > 0) should be if (serverName.getPort() >= 0).

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method was actually a Jamon sub-template which I converted to Java (as close as possible) and added unit tests.

I think it is correct as is because when serverName.getPort() returns -1 (invalid port), infoPort becomes 0 and then we only return serverName.getServerName(). Otherwise we use the the port to build the URL.

But please correct me if I'm wrong.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@PDavid PDavid force-pushed the HBASE-29596-jamon-jsp-canary branch from 502510a to 0244319 Compare November 4, 2025 07:24
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 38s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ master Compile Tests _
+0 🆗 mvndep 0m 28s Maven dependency ordering for branch
+1 💚 mvninstall 3m 43s master passed
+1 💚 compile 8m 58s master passed
+1 💚 checkstyle 2m 20s master passed
+1 💚 spotbugs 9m 16s master passed
+0 🆗 refguide 2m 29s branch has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect.
+1 💚 spotless 0m 49s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 16s Maven dependency ordering for patch
+1 💚 mvninstall 2m 56s the patch passed
+1 💚 compile 8m 23s the patch passed
+1 💚 javac 8m 23s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 2m 12s the patch passed
+1 💚 xmllint 0m 0s No new issues.
+1 💚 spotbugs 9m 42s the patch passed
+0 🆗 refguide 2m 5s patch has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect.
+1 💚 hadoopcheck 11m 28s Patch does not cause any errors with Hadoop 3.3.6 3.4.1.
+1 💚 spotless 0m 44s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 58s The patch does not generate ASF License warnings.
75m 39s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7390/4/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #7390
Optional Tests dupname asflicense checkstyle javac codespell detsecrets xmllint spotless hadoopcheck compile spotbugs hbaseanti refguide
uname Linux 12d0e3499e60 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 / 0244319
Default Java Eclipse Adoptium-17.0.11+9
refguide https://nightlies.apache.org/hbase/HBase-PreCommit-GitHub-PR/PR-7390/4/yetus-general-check/output/branch-site/book.html
refguide https://nightlies.apache.org/hbase/HBase-PreCommit-GitHub-PR/PR-7390/4/yetus-general-check/output/patch-site/book.html
Max. process+thread count 191 (vs. ulimit of 30000)
modules C: hbase-checkstyle hbase-zookeeper hbase-resource-bundle hbase-server hbase-shaded . U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7390/4/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3 xmllint=20913
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 45s Docker mode activated.
-0 ⚠️ 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 🆗 mvndep 0m 23s Maven dependency ordering for branch
+1 💚 mvninstall 4m 36s master passed
+1 💚 compile 2m 45s master passed
+1 💚 javadoc 3m 29s master passed
+1 💚 shadedjars 7m 31s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 17s Maven dependency ordering for patch
+1 💚 mvninstall 3m 32s the patch passed
+1 💚 compile 2m 51s the patch passed
+1 💚 javac 2m 51s the patch passed
+1 💚 javadoc 5m 36s the patch passed
+1 💚 shadedjars 8m 48s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 354m 54s root in the patch passed.
404m 26s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7390/4/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #7390
Optional Tests javac javadoc unit shadedjars compile
uname Linux d592d930d21f 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 / 0244319
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7390/4/testReport/
Max. process+thread count 7187 (vs. ulimit of 30000)
modules C: hbase-checkstyle hbase-zookeeper hbase-resource-bundle hbase-server hbase-shaded . U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7390/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.

@PDavid PDavid requested review from NihalJain and ndimiduk November 5, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants