Skip to content

HBASE-29596 Migrate Canary Status Jamon page back to JSP - #7390

Merged
PDavid merged 7 commits into
apache:masterfrom
PDavid:HBASE-29596-jamon-jsp-canary
Nov 18, 2025
Merged

HBASE-29596 Migrate Canary Status Jamon page back to JSP#7390
PDavid merged 7 commits into
apache:masterfrom
PDavid:HBASE-29596-jamon-jsp-canary

Conversation

@PDavid

@PDavidPDavid commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

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.

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

This comment has been minimized.

@PDavid

PDavid commented Oct 16, 2025

Copy link
Copy Markdown
ContributorAuthor

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 at http://localhost:16019/canary.jsp :

image

@Apache-HBase

This comment has been minimized.

@PDavid

Copy link
Copy Markdown
ContributorAuthor

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 CopilotNovember 1, 2025 14:37

CopilotAI left a comment

Copy link
Copy Markdown

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
FileDescription
pom.xmlRemoves Jamon dependency and plugin version properties from parent POM
hbase-server/pom.xmlRemoves 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.jamonDeletes the Jamon template file
hbase-server/src/main/resources/hbase-webapps/canary/canary.jspReplaces redirect with full JSP implementation of Canary status page
hbase-server/src/main/java/org/apache/hadoop/hbase/tool/CanaryStatusServlet.javaSimplifies servlet to only redirect to canary.jsp instead of rendering Jamon template
hbase-server/src/main/java/org/apache/hadoop/hbase/util/CanaryStatusUtil.javaAdds new utility class for generating server name links
hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestCanaryStatusUtil.javaAdds tests for the new utility class
hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryStatusServlet.javaRemoves tests for Jamon-based servlet
hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.javaAdds comprehensive integration tests for the new JSP-based web UI
hbase-zookeeper/pom.xmlRemoves Jamon Eclipse plugin configuration
hbase-shaded/pom.xmlRemoves Jamon package relocation configuration
hbase-resource-bundle/src/main/resources/supplemental-models.xmlRemoves Jamon license information
hbase-checkstyle/src/main/resources/hbase/checkstyle-suppressions.xmlRemoves checkstyle suppression for generated Jamon files
src/main/asciidoc/_chapters/developer.adocUpdates documentation to remove reference to generated-jamon folder

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

Comment threadhbase-server/src/main/resources/hbase-webapps/canary/canary.jsp Outdated
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();
}

CopilotAINov 1, 2025

Copy link

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
Copy Markdown
ContributorAuthor

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.

Comment threadhbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java Outdated
@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@PDavid
PDavidforce-pushed the HBASE-29596-jamon-jsp-canary branch from 502510a to 0244319CompareNovember 4, 2025 07:24
@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 38sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗codespell0m 0scodespell was not available.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
_ master Compile Tests _
+0 🆗mvndep0m 28sMaven dependency ordering for branch
+1 💚mvninstall3m 43smaster passed
+1 💚compile8m 58smaster passed
+1 💚checkstyle2m 20smaster passed
+1 💚spotbugs9m 16smaster passed
+0 🆗refguide2m 29sbranch has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect.
+1 💚spotless0m 49sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+0 🆗mvndep0m 16sMaven dependency ordering for patch
+1 💚mvninstall2m 56sthe patch passed
+1 💚compile8m 23sthe patch passed
+1 💚javac8m 23sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle2m 12sthe patch passed
+1 💚xmllint0m 0sNo new issues.
+1 💚spotbugs9m 42sthe patch passed
+0 🆗refguide2m 5spatch has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect.
+1 💚hadoopcheck11m 28sPatch does not cause any errors with Hadoop 3.3.6 3.4.1.
+1 💚spotless0m 44spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 58sThe patch does not generate ASF License warnings.
75m 39s
SubsystemReport/Notes
DockerClientAPI=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 Testsdupname asflicense checkstyle javac codespell detsecrets xmllint spotless hadoopcheck compile spotbugs hbaseanti refguide
unameLinux 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 0244319
Default JavaEclipse Adoptium-17.0.11+9
refguidehttps://nightlies.apache.org/hbase/HBase-PreCommit-GitHub-PR/PR-7390/4/yetus-general-check/output/branch-site/book.html
refguidehttps://nightlies.apache.org/hbase/HBase-PreCommit-GitHub-PR/PR-7390/4/yetus-general-check/output/patch-site/book.html
Max. process+thread count191 (vs. ulimit of 30000)
modulesC: hbase-checkstyle hbase-zookeeper hbase-resource-bundle hbase-server hbase-shaded . U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7390/4/console
versionsgit=2.34.1 maven=3.9.8 spotbugs=4.7.3 xmllint=20913
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 45sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed 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 🆗mvndep0m 23sMaven dependency ordering for branch
+1 💚mvninstall4m 36smaster passed
+1 💚compile2m 45smaster passed
+1 💚javadoc3m 29smaster passed
+1 💚shadedjars7m 31sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+0 🆗mvndep0m 17sMaven dependency ordering for patch
+1 💚mvninstall3m 32sthe patch passed
+1 💚compile2m 51sthe patch passed
+1 💚javac2m 51sthe patch passed
+1 💚javadoc5m 36sthe patch passed
+1 💚shadedjars8m 48spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit354m 54sroot in the patch passed.
404m 26s
SubsystemReport/Notes
DockerClientAPI=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 Testsjavac javadoc unit shadedjars compile
unameLinux 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 0244319
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7390/4/testReport/
Max. process+thread count7187 (vs. ulimit of 30000)
modulesC: hbase-checkstyle hbase-zookeeper hbase-resource-bundle hbase-server hbase-shaded . U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-7390/4/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

HConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT);
verify(sink, atLeastOnce()).publishReadTiming(eq(baseZnode), eq(hostPort), anyLong());
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a specifc reason for merging the status tests here ?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I deleted TestCanaryStatusServlet because it only rendered the Canary Status Jamon page with mock objects and asserted the results. The servlet only has the redirect logic, and that is tested by these new tests.

These new tests are testing the Canary Status web UI page (which is rendered by JSP) with some mock objects and I did not created a separate test class for these as these require a mini cluster and this way we can use what this test spins up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

But if needed, I can move out these new tests to a separate test class.

@stotystoty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 LGTM

HConstants.DEFAULT_ZOOKEEPER_ZNODE_PARENT);
verify(sink, atLeastOnce()).publishReadTiming(eq(baseZnode), eq(hostPort), anyLong());
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks

@NihalJainNihalJain left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work, so now we are completely on JSP. 🥳

@PDavid

Copy link
Copy Markdown
ContributorAuthor

Great work, so now we are completely on JSP. 🥳

Many thanks! 👍 Exactly. 😺

Next is to start backporting these patches to older supported branches. 😄

@PDavid
PDavid merged commit 4ba9b46 into apache:masterNov 18, 2025
1 check passed
@PDavid
PDavid deleted the HBASE-29596-jamon-jsp-canary branch November 18, 2025 07:33
PDavid added a commit to PDavid/hbase that referenced this pull request Dec 2, 2025
This is the last step of the Jamon to JSP migration: the Canary Status page.
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.
Signed-off-by: Istvan Toth <stoty@apache.org>
Signed-off-by: Nihal Jain <nihaljain@apache.org>
(cherry picked from commit 4ba9b46)
PDavid added a commit that referenced this pull request Dec 3, 2025
This is the last step of the Jamon to JSP migration: the Canary Status page.
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.
(cherry picked from commit 4ba9b46)
Signed-off-by: Istvan Toth <stoty@apache.org>
Signed-off-by: Nihal Jain <nihaljain@apache.org>
PDavid added a commit to PDavid/hbase that referenced this pull request Dec 3, 2025
This is the last step of the Jamon to JSP migration: the Canary Status page.
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.
Signed-off-by: Istvan Toth <stoty@apache.org>
Signed-off-by: Nihal Jain <nihaljain@apache.org>
(cherry picked from commit 4ba9b46)
PDavid added a commit that referenced this pull request Dec 5, 2025
This is the last step of the Jamon to JSP migration: the Canary Status page.
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.
(cherry picked from commit 4ba9b46)
Signed-off-by: Istvan Toth <stoty@apache.org>
Signed-off-by: Nihal Jain <nihaljain@apache.org>
PDavid added a commit to PDavid/hbase that referenced this pull request Dec 8, 2025
This is the last step of the Jamon to JSP migration: the Canary Status page.
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.
Signed-off-by: Istvan Toth <stoty@apache.org>
Signed-off-by: Nihal Jain <nihaljain@apache.org>
(cherry picked from commit 4ba9b46)
PDavid added a commit that referenced this pull request Dec 9, 2025
This is the last step of the Jamon to JSP migration: the Canary Status page.
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.
(cherry picked from commit 4ba9b46)
Signed-off-by: Istvan Toth <stoty@apache.org>
Signed-off-by: Nihal Jain <nihaljain@apache.org>
PDavid added a commit to PDavid/hbase that referenced this pull request Jan 6, 2026
This is the last step of the Jamon to JSP migration: the Canary Status page.
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.
Signed-off-by: Istvan Toth <stoty@apache.org>
Signed-off-by: Nihal Jain <nihaljain@apache.org>
(cherry picked from commit 4ba9b46)
Sign up for freeto 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.

5 participants

@PDavid@Apache-HBase@stoty@NihalJain