-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
base: master
Are you sure you want to change the base?
Conversation
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"; |
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.
Maybe we could just have these constants in MasterStatusUtil
and then we don't need a separate class for this. What do you think?
This comment has been minimized.
This comment has been minimized.
- getUserTables - getFragmentationInfo - getMetaLocationOrNull
as it is one line and not complex.
…tusUtil as they are only static helper classes.
c5216a6
to
e09403a
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Added missing slash.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
so that we test that `/master-status` redirects to `/master.jsp`.
I tested this locally in standalone mode after building with maven ( I will still have to test these special cases as these have special UI parts:
I will also test with Pseudo-Distributed mode. |
This comment has been minimized.
This comment has been minimized.
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@@ -1,152 +0,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.
Since this test class is removed, how do we test the new jsp page?
Let me see if the copilot can give some feedbacks since this is a very big change... |
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.
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
<td><%= peerConfig.getRemoteWALDir() == null ? "" : peerConfig.getRemoteWALDir() %> | ||
<td><%= peer.getSyncReplicationState() %> |
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 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.
<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" |
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.
There is a spelling error: 'availbility' should be corrected to 'availability'.
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.
rsGroupName = server2GroupMap.get(serverName.getAddress()).getName(); | ||
} |
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 line assumes that server2GroupMap.get(serverName.getAddress()) is non-null. Add a null check before calling getName() to avoid a possible NullPointerException.
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.
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:
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 inMasterStatusUtil
.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.