Skip to content

Commit

Permalink
HBASE-25980 Master table.jsp pointed at meta throws 500 when no all r… (
Browse files Browse the repository at this point in the history
#3374)

Signed-off-by: Duo Zhang <zhangduo@apache.org>
  • Loading branch information
GeorryHuang authored Jun 27, 2021
1 parent fb4af2a commit 22ec681
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions hbase-server/src/main/resources/hbase-webapps/master/table.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
import="org.apache.hadoop.hbase.master.http.MetaBrowser"
import="org.apache.hadoop.hbase.master.http.RegionReplicaInfo"
import="org.apache.hadoop.hbase.quotas.QuotaSettingsFactory"
import="org.apache.hadoop.hbase.quotas.QuotaTableUtil"%>
import="org.apache.hadoop.hbase.quotas.QuotaTableUtil"
import="org.apache.hadoop.hbase.NotAllMetaRegionsOnlineException" %>
<%@ page import="org.apache.hadoop.hbase.quotas.SpaceQuotaSnapshot" %>
<%@ page import="org.apache.hadoop.hbase.quotas.ThrottleSettings" %>
<%@ page import="org.apache.hadoop.hbase.util.Bytes" %>
Expand Down Expand Up @@ -313,8 +314,16 @@
for (int j = 0; j < numMetaReplicas; j++) {
RegionInfo meta = RegionReplicaUtil.getRegionInfoForReplica(
RegionInfoBuilder.FIRST_META_REGIONINFO, j);
ServerName metaLocation = MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
//If a metaLocation is null, All of its info would be empty here to be displayed.
ServerName metaLocation = null;
try {
metaLocation = MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
} catch (NotAllMetaRegionsOnlineException e) {
//Region in transition state here throw a NotAllMetaRegionsOnlineException causes
//the UI crash.
}
for (int i = 0; i < 1; i++) {
//If metaLocation is null, default value below would be displayed in UI.
String hostAndPort = "";
String readReq = "N/A";
String writeReq = "N/A";
Expand Down Expand Up @@ -378,8 +387,16 @@
for (int j = 0; j < numMetaReplicas; j++) {
RegionInfo meta = RegionReplicaUtil.getRegionInfoForReplica(
RegionInfoBuilder.FIRST_META_REGIONINFO, j);
ServerName metaLocation = MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
//If a metaLocation is null, All of its info would be empty here to be displayed.
ServerName metaLocation = null;
try {
metaLocation = MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
} catch (NotAllMetaRegionsOnlineException e) {
//Region in transition state here throw a NotAllMetaRegionsOnlineException causes
//the UI crash.
}
for (int i = 0; i < 1; i++) {
//If metaLocation is null, default value below would be displayed in UI.
String hostAndPort = "";
float locality = 0.0f;
float localityForSsd = 0.0f;
Expand Down Expand Up @@ -426,8 +443,16 @@
for (int j = 0; j < numMetaReplicas; j++) {
RegionInfo meta = RegionReplicaUtil.getRegionInfoForReplica(
RegionInfoBuilder.FIRST_META_REGIONINFO, j);
ServerName metaLocation = MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
//If a metaLocation is null, All of its info would be empty here to be displayed.
ServerName metaLocation = null;
try {
metaLocation = MetaTableLocator.waitMetaRegionLocation(master.getZooKeeper(), j, 1);
} catch (NotAllMetaRegionsOnlineException e) {
//Region in transition state here throw a NotAllMetaRegionsOnlineException causes
//the UI crash.
}
for (int i = 0; i < 1; i++) {
//If metaLocation is null, default value below would be displayed in UI.
String hostAndPort = "";
long compactingCells = 0;
long compactedCells = 0;
Expand Down

0 comments on commit 22ec681

Please sign in to comment.