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 22 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.

so that we test that `/master-status` redirects to `/master.jsp`.
@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
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 47s 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.
+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 4m 40s master passed
+1 💚 compile 4m 24s master passed
+1 💚 checkstyle 0m 46s master passed
+1 💚 spotbugs 2m 22s master passed
+1 💚 spotless 1m 14s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚 mvninstall 4m 27s the patch passed
+1 💚 compile 4m 37s the patch passed
+1 💚 javac 4m 37s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 1m 7s hbase-server: The patch generated 0 new + 7 unchanged - 2 fixed = 7 total (was 9)
+1 💚 xmllint 0m 0s No new issues.
+1 💚 spotbugs 2m 41s the patch passed
+1 💚 hadoopcheck 15m 35s Patch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚 spotless 1m 9s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 14s The patch does not generate ASF License warnings.
54m 53s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6875/5/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 b12f90b54048 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 / 396d471
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 91 (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/5/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 3s master passed
+1 💚 compile 0m 57s master passed
+1 💚 javadoc 0m 27s master passed
+1 💚 shadedjars 5m 51s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 3s the patch passed
+1 💚 compile 0m 57s the patch passed
+1 💚 javac 0m 57s the patch passed
+1 💚 javadoc 0m 27s the patch passed
+1 💚 shadedjars 5m 51s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 212m 49s hbase-server in the patch passed.
238m 6s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6875/5/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #6875
Optional Tests javac javadoc unit compile shadedjars
uname Linux 924f1c422eee 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 / 396d471
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6875/5/testReport/
Max. process+thread count 4583 (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/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.

@@ -1,152 +0,0 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this test class is removed, how do we test the new jsp page?

@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 +65 to +66
<td><%= peerConfig.getRemoteWALDir() == null ? "" : peerConfig.getRemoteWALDir() %>
<td><%= peer.getSyncReplicationState() %>
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.

The table cell for the Remote WAL column is missing a closing tag, which could break the HTML layout. Add the missing closing tag to ensure proper table structure.

Suggested change
<td><%= peerConfig.getRemoteWALDir() == null ? "" : peerConfig.getRemoteWALDir() %>
<td><%= peer.getSyncReplicationState() %>
<td><%= peerConfig.getRemoteWALDir() == null ? "" : peerConfig.getRemoteWALDir() %></td>
<td><%= peer.getSyncReplicationState() %></td>

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

if (tableName.equals(TableName.META_TABLE_NAME)){
description = "The hbase:meta table holds references to all User Table regions.";
} else if (tableName.equals(CanaryTool.DEFAULT_WRITE_TABLE_NAME)){
description = "The hbase:canary table is used to sniff the write availbility of"
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.

There is a spelling error: 'availbility' should be corrected to 'availability'.

Suggested change
description = "The hbase:canary table is used to sniff the write availbility of"
description = "The hbase:canary table is used to sniff the write availability of"

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

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 is powered by AI, so mistakes are possible. Review output carefully before use.

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