-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-29596 Migrate Canary Status Jamon page back to JSP #7390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
TestRSGroupsWithACL failed in the PR build. I think it is not related. |
There was a problem hiding this 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
CanaryStatusUtilfor 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.
hbase-server/src/main/resources/hbase-webapps/canary/canary.jsp
Outdated
Show resolved
Hide resolved
| int infoPort = serverName.getPort() + 1; | ||
| String url = "//" + serverName.getHostname() + ":" + infoPort + "/"; | ||
| if (infoPort > 0) { | ||
| return "<a href=\"" + url + "\">" + serverName.getServerName() + "</a>"; | ||
| } else { | ||
| return serverName.getServerName(); | ||
| } |
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
hbase-server/src/test/java/org/apache/hadoop/hbase/tool/TestCanaryTool.java
Outdated
Show resolved
Hide resolved
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
502510a to
0244319
Compare
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |

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-statusredirects to/canary.jsp.Introduced a
src/main/resources/hbase-webapps/commondirectory 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.