Skip to content

HBASE-29223 Migrate Master Status Jamon page back to JSP #6875

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

Open
wants to merge 29 commits into
base: master
Choose a base branch
from

Conversation

PDavid
Copy link
Contributor

@PDavid PDavid commented Apr 1, 2025

This is the first step of the Jamon to JSP migration is the Master Status page.

Moved the Jamon code back to JSP. Changed the Jamon syntax back to JSP.
To transfer data between JSP pages I used request attributes.
Tried to preserve the code as much as possible but did some changes:

Sub-templates were usually extracted to separate JSP file (and included with <jsp:include), in some case it was extracted as Java method.

Extracted some sections from master page to separate JSP pages:

  • Software Attributes
  • Warnings

Extracted the long JavaScript from the master page which executes on page load to separate JS file.

Extracted some frequently used static methods to a new util class: MasterStatusUtil. Also added unit tests for the static methods in MasterStatusUtil.

Changed the Master Status page back to /master.jsp again. Now made sure that /master-status redirects to /master.jsp.

What do you think about this?

I'll create a new Jira for the rest of the Jamon files.

Comment on lines +28 to +35
public static final String FRAGS = "frags";
public static final String SERVER_NAMES = "serverNames";
public static final String SERVER_NAME = "serverName";
public static final String RS_GROUP_INFOS = "rsGroupInfos";
public static final String COLLECT_SERVERS = "collectServers";
public static final String FILTER = "filter";
public static final String FORMAT = "format";
public static final String PARENT = "parent";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we could just have these constants in MasterStatusUtil and then we don't need a separate class for this. What do you think?

@Apache-HBase

This comment has been minimized.

@PDavid PDavid force-pushed the HBASE-29223-jamon-jsp branch from c5216a6 to e09403a Compare April 1, 2025 13:44
@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@PDavid PDavid marked this pull request as ready for review April 2, 2025 11:51
@Apache-HBase

This comment has been minimized.

@PDavid
Copy link
Contributor Author

PDavid commented Apr 2, 2025

I tested this locally in standalone mode after building with maven (mvn clean install -DskipTests && bin/start-hbase.sh). I created some tables, adding data with the ltt tool (bin/hbase ltt -num_keys 10000 -write 100:100 -num_tables 10 -multiput)

image

I will still have to test these special cases as these have special UI parts:

  • Dead region servers
  • Replication - peers
  • Backup master
  • RS groups

I will also test with Pseudo-Distributed mode.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache9 Apache9 requested a review from Copilot April 9, 2025 14:50
@Apache9
Copy link
Contributor

Apache9 commented Apr 9, 2025

Let me see if the copilot can give some feedbacks since this is a very big change...

Copy link

@Copilot 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.

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

Files not reviewed (6)
  • hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/AssignmentManagerStatusTmpl.jamon: Language not supported
  • hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/BackupMasterStatusTmpl.jamon: Language not supported
  • hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RSGroupListTmpl.jamon: Language not supported
  • hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/master/RegionVisualizerTmpl.jamon: Language not supported
  • hbase-server/src/main/jamon/org/apache/hadoop/hbase/tmpl/regionserver/RSStatusTmpl.jamon: Language not supported
  • hbase-server/src/main/resources/hbase-webapps/master/index.html: Language not supported

Comment on lines 96 to 97
rsGroupName = server2GroupMap.get(serverName.getAddress()).getName();
}
Copy link
Preview

Copilot AI Apr 9, 2025

Choose a reason for hiding this comment

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

This line assumes that server2GroupMap.get(serverName.getAddress()) is non-null. Add a null check before calling getName() to avoid a possible NullPointerException.

Suggested change
rsGroupName = server2GroupMap.get(serverName.getAddress()).getName();
}
RSGroupInfo groupInfo = server2GroupMap.get(serverName.getAddress());
if (groupInfo != null) {
rsGroupName = groupInfo.getName();
} else {
rsGroupName = "default";
}
}

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.

To be honest I'm not sure if this is a good suggestion.
What do you all think?

PDavid added 16 commits May 25, 2025 12:55
- getUserTables
- getFragmentationInfo
- getMetaLocationOrNull
as it is one line and not complex.
…tusUtil

as they are only static helper classes.
Added missing slash.
so that we test that `/master-status` redirects to `/master.jsp`.
…mon after rebase

they were brought back while resolving conflicts.
- HBASE-28388 Avoid index based field sorting in tablesorter apache#6779
- HBASE-27802 Manage static javascript resources programatically apache#6864
@PDavid PDavid force-pushed the HBASE-29223-jamon-jsp branch from 396d471 to 2464b4f Compare May 25, 2025 12:09
@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 27s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 jshint 0m 0s jshint 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 _
+1 💚 mvninstall 3m 15s master passed
+1 💚 compile 3m 13s master passed
+1 💚 checkstyle 0m 37s master passed
+1 💚 spotbugs 1m 35s master passed
+1 💚 spotless 0m 48s branch has no errors when running spotless:check.
-0 ⚠️ patch 0m 55s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 8s the patch passed
+1 💚 compile 3m 13s the patch passed
+1 💚 javac 3m 13s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 36s /results-checkstyle-hbase-server.txt hbase-server: The patch generated 3 new + 0 unchanged - 2 fixed = 3 total (was 2)
+1 💚 xmllint 0m 0s No new issues.
+1 💚 spotbugs 1m 40s the patch passed
+1 💚 hadoopcheck 12m 8s Patch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚 spotless 0m 44s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 10s The patch does not generate ASF License warnings.
39m 15s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6875/7/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #6875
Optional Tests dupname asflicense javac codespell detsecrets spotless spotbugs checkstyle compile hadoopcheck hbaseanti xmllint jshint
uname Linux 853cc6478bd6 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 / ad03910
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 86 (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-6875/7/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 29s 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 _
+1 💚 mvninstall 3m 24s master passed
+1 💚 compile 0m 58s master passed
+1 💚 javadoc 0m 29s master passed
+1 💚 shadedjars 6m 11s branch has no errors when building our shaded downstream artifacts.
-0 ⚠️ patch 6m 20s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 11s the patch passed
+1 💚 compile 0m 59s the patch passed
+1 💚 javac 0m 59s the patch passed
+1 💚 javadoc 0m 26s the patch passed
+1 💚 shadedjars 6m 8s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 213m 43s hbase-server in the patch passed.
240m 2s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6875/7/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #6875
Optional Tests javac javadoc unit compile shadedjars
uname Linux 7b8810399e5a 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 / ad03910
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6875/7/testReport/
Max. process+thread count 4933 (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-6875/7/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.

Comment on lines +103 to +117
String hostname = master.getServerName().getHostname();
assertTrue(page.contains("<h1>Master <small>" + hostname + "</small></h1>"));
assertTrue(page.contains("<h2><a name=\"regionservers\">Region Servers</a></h2>"));
assertRegionServerLinks(master, page);

assertTrue(page.contains("<h2>Backup Masters</h2>"));
assertTrue(page.contains("<h2><a name=\"tables\">Tables</a></h2>"));
assertTableLinks(master, page);

assertTrue(page.contains("<h2><a name=\"region_visualizer\"></a>Region Visualizer</h2>"));
assertTrue(page.contains("<h2><a name=\"peers\">Peers</a></h2>"));
assertTrue(page.contains("<h2><a name=\"tasks\">Tasks</a></h2>"));
assertTrue(page.contains("<h2><a name=\"attributes\">Software Attributes</a></h2>"));

assertTrue(page.contains(VersionInfo.getVersion()));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now I only added these assertions on the HTML content of the Master Status page. But we can add more sophisticated asserts in the future.

@PDavid PDavid requested a review from Apache9 May 26, 2025 05:13
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.

3 participants