Skip to content

Commit bf836a9

Browse files
authored
HBASE-26192 Master UI hbck should provide a JSON formatted output option (#5772)
Signed-off-by: Andrew Purtell <apurtell@apache.org>
1 parent 3340d8d commit bf836a9

File tree

16 files changed

+1157
-0
lines changed

16 files changed

+1157
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.hadoop.hbase;
19+
20+
import org.apache.yetus.audience.InterfaceAudience;
21+
22+
/**
23+
* POJO to present Empty Region Info from Catalog Janitor Inconsistencies Report via REST API. These
24+
* inconsistencies are shown on hbck.jsp page on Active HMaster UI as part of Catalog Janitor
25+
* inconsistencies.
26+
*/
27+
@InterfaceAudience.Public
28+
public class HbckEmptyRegionInfo {
29+
private final String regionInfo;
30+
31+
public HbckEmptyRegionInfo(String emptyRegionInfo) {
32+
this.regionInfo = emptyRegionInfo;
33+
}
34+
35+
public String getRegionInfo() {
36+
return regionInfo;
37+
}
38+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.hadoop.hbase;
19+
20+
import java.util.List;
21+
import org.apache.yetus.audience.InterfaceAudience;
22+
23+
/**
24+
* POJO to present HBCK Inconsistent Regions from HBCK Inconsistencies Report via REST API. These
25+
* inconsistencies are shown on hbck.jsp page on Active HMaster UI as part of HBCK inconsistencies.
26+
*/
27+
@InterfaceAudience.Public
28+
public class HbckInconsistentRegions {
29+
private final String regionId;
30+
private final HbckServerName serverNameInMeta;
31+
private final List<HbckServerName> listOfServers;
32+
33+
public HbckInconsistentRegions(String inconsistentRegionId, HbckServerName serverNameInMeta,
34+
List<HbckServerName> listOfServerName) {
35+
this.regionId = inconsistentRegionId;
36+
this.serverNameInMeta = serverNameInMeta;
37+
this.listOfServers = listOfServerName;
38+
}
39+
40+
public String getRegionId() {
41+
return regionId;
42+
}
43+
44+
public HbckServerName getServerNameInMeta() {
45+
return serverNameInMeta;
46+
}
47+
48+
public List<HbckServerName> getListOfServers() {
49+
return listOfServers;
50+
}
51+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.hadoop.hbase;
19+
20+
import org.apache.yetus.audience.InterfaceAudience;
21+
22+
/**
23+
* POJO to present Orphan Region on FS from HBCK Inconsistencies Report via REST API. These
24+
* inconsistencies are shown on hbck.jsp page on Active HMaster UI as part of HBCK Inconsistencies.
25+
*/
26+
@InterfaceAudience.Public
27+
public class HbckOrphanRegionsOnFS {
28+
private final String regionId;
29+
private final String regionHdfsPath;
30+
31+
public HbckOrphanRegionsOnFS(String regionId, String orphanRegionHdfsPath) {
32+
this.regionId = regionId;
33+
this.regionHdfsPath = orphanRegionHdfsPath;
34+
}
35+
36+
public String getRegionId() {
37+
return regionId;
38+
}
39+
40+
public String getRegionHdfsPath() {
41+
return regionHdfsPath;
42+
}
43+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.hadoop.hbase;
19+
20+
import org.apache.yetus.audience.InterfaceAudience;
21+
22+
/**
23+
* POJO to present Orphan Region on RS from HBCK Inconsistencies Report via REST API. These
24+
* inconsistencies are shown on hbck.jsp page on Active HMaster UI as part of HBCK Inconsistencies.
25+
*/
26+
@InterfaceAudience.Public
27+
public class HbckOrphanRegionsOnRS {
28+
private final String regionId;
29+
private final HbckServerName rsName;
30+
31+
public HbckOrphanRegionsOnRS(String orphanRegionId, HbckServerName orphanRegionRsName) {
32+
this.regionId = orphanRegionId;
33+
this.rsName = orphanRegionRsName;
34+
}
35+
36+
public String getRegionId() {
37+
return regionId;
38+
}
39+
40+
public HbckServerName getRsName() {
41+
return rsName;
42+
}
43+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.hadoop.hbase;
19+
20+
import org.apache.yetus.audience.InterfaceAudience;
21+
22+
/**
23+
* POJO to present Region Overlap from Catalog Janitor Inconsistencies Report via REST API. These
24+
* inconsistencies are shown on hbck.jsp page on Active HMaster UI as part of Catalog Janitor
25+
* inconsistencies.
26+
*/
27+
@InterfaceAudience.Public
28+
public class HbckOverlapRegions {
29+
private final HbckRegionDetails region1Info;
30+
private final HbckRegionDetails region2Info;
31+
32+
public HbckOverlapRegions(HbckRegionDetails region1Info, HbckRegionDetails region2Info) {
33+
this.region1Info = region1Info;
34+
this.region2Info = region2Info;
35+
}
36+
37+
public HbckRegionDetails getRegion1Info() {
38+
return region1Info;
39+
}
40+
41+
public HbckRegionDetails getRegion2Info() {
42+
return region2Info;
43+
}
44+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.hadoop.hbase;
19+
20+
import org.apache.yetus.audience.InterfaceAudience;
21+
22+
/**
23+
* POJO class for HBCK RegionInfo in HBCK Inconsistencies report.
24+
*/
25+
@InterfaceAudience.Public
26+
public class HbckRegionDetails {
27+
private final String regionId;
28+
private final String tableName;
29+
private final String startKey;
30+
private final String endKey;
31+
32+
public HbckRegionDetails(String regionId, String tableName, String startKey, String endKey) {
33+
this.regionId = regionId;
34+
this.tableName = tableName;
35+
this.startKey = startKey;
36+
this.endKey = endKey;
37+
}
38+
39+
public String getRegionId() {
40+
return regionId;
41+
}
42+
43+
public String getTableName() {
44+
return tableName;
45+
}
46+
47+
public String getStartKey() {
48+
return startKey;
49+
}
50+
51+
public String getEndKey() {
52+
return endKey;
53+
}
54+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.hadoop.hbase;
19+
20+
import org.apache.yetus.audience.InterfaceAudience;
21+
22+
/**
23+
* POJO to present Region Holes from Catalog Janitor Inconsistencies Report via REST API. These
24+
* inconsistencies are shown on hbck.jsp page on Active HMaster UI as part of Catalog Janitor
25+
* inconsistencies.
26+
*/
27+
@InterfaceAudience.Public
28+
public class HbckRegionHoles {
29+
private final HbckRegionDetails region1Info;
30+
private final HbckRegionDetails region2Info;
31+
32+
public HbckRegionHoles(HbckRegionDetails region1Info, HbckRegionDetails region2Info) {
33+
this.region1Info = region1Info;
34+
this.region2Info = region2Info;
35+
}
36+
37+
public HbckRegionDetails getRegion1Info() {
38+
return region1Info;
39+
}
40+
41+
public HbckRegionDetails getRegion2Info() {
42+
return region2Info;
43+
}
44+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
package org.apache.hadoop.hbase;
19+
20+
import org.apache.yetus.audience.InterfaceAudience;
21+
22+
/**
23+
* POJO class for ServerName in HBCK Inconsistencies report.
24+
*/
25+
@InterfaceAudience.Public
26+
public class HbckServerName {
27+
private final String hostName;
28+
private final int hostPort;
29+
private final long startCode;
30+
31+
public HbckServerName(String hostName, int hostPort, long startCode) {
32+
this.hostName = hostName;
33+
this.hostPort = hostPort;
34+
this.startCode = startCode;
35+
}
36+
37+
public String getHostName() {
38+
return hostName;
39+
}
40+
41+
public int getHostPort() {
42+
return hostPort;
43+
}
44+
45+
public long getStartCode() {
46+
return startCode;
47+
}
48+
}

0 commit comments

Comments
 (0)