-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-26192 Master UI hbck should provide a JSON formatted output option #5772
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
51da00a
HBASE-26192 Master UI hbck should provide a JSON formatted output option
0529d50
Remove extra test method
919d49c
Updated variable names for better JSON Reponse
c449580
PR review comments
caaee3d
Test fix after changes in resources naming changes
8177556
Mocked hbck and catalog janitor report object and variable name updates
e259354
build fix for Checkstyle checks
f077685
Move POJO classes to hbck-client package and adding Class description…
0a6e1f6
mvn spotless:apply changes
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
hbase-server/src/main/java/org/apache/hadoop/hbase/master/http/hbck/HbckConfigFactory.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.hadoop.hbase.master.http.hbck; | ||
|
|
||
| import org.apache.hadoop.conf.Configuration; | ||
| import org.apache.hadoop.hbase.http.jersey.ResponseEntityMapper; | ||
| import org.apache.hadoop.hbase.master.HMaster; | ||
| import org.apache.hadoop.hbase.master.http.gson.GsonSerializationFeature; | ||
| import org.apache.hadoop.hbase.master.http.jersey.MasterFeature; | ||
| import org.apache.yetus.audience.InterfaceAudience; | ||
|
|
||
| import org.apache.hbase.thirdparty.org.glassfish.jersey.server.ResourceConfig; | ||
| import org.apache.hbase.thirdparty.org.glassfish.jersey.server.ServerProperties; | ||
| import org.apache.hbase.thirdparty.org.glassfish.jersey.server.TracingConfig; | ||
|
|
||
| @InterfaceAudience.Private | ||
| public class HbckConfigFactory { | ||
| private HbckConfigFactory() { | ||
| } | ||
|
|
||
| public static ResourceConfig createResourceConfig(Configuration conf, HMaster master) { | ||
| return new ResourceConfig().setApplicationName("hbck") | ||
| .packages(HbckConfigFactory.class.getPackage().getName()) | ||
| // TODO: anything registered here that does not have necessary bindings won't inject properly | ||
| // at annotation sites and will result in a WARN logged by o.a.h.t.o.g.j.i.inject.Providers. | ||
| // These warnings should be treated by the service as fatal errors, but I have not found a | ||
| // callback API for registering a failed binding handler. | ||
| .register(ResponseEntityMapper.class).register(GsonSerializationFeature.class) | ||
| .register(new MasterFeature(master)) | ||
|
|
||
| // devs: enable TRACING to see how jersey is dispatching to resources. | ||
| // in hbase-site.xml, set 'hbase.http.jersey.tracing.type=ON_DEMAND` and | ||
| // to curl, add `-H X-Jersey-Tracing-Accept:true` | ||
| .property(ServerProperties.TRACING, | ||
| conf.get("hbase.http.jersey.tracing.type", TracingConfig.OFF.name())) | ||
| .property(ServerProperties.TRACING_THRESHOLD, | ||
| conf.get("hbase.http.jersey.tracing.threshold", "TRACE")); | ||
| } | ||
| } | ||
33 changes: 33 additions & 0 deletions
33
...ver/src/main/java/org/apache/hadoop/hbase/master/http/hbck/model/HbckEmptyRegionInfo.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.hadoop.hbase.master.http.hbck.model; | ||
|
|
||
| import org.apache.yetus.audience.InterfaceAudience; | ||
|
|
||
| @InterfaceAudience.Private | ||
| public class HbckEmptyRegionInfo { | ||
| private final String regionInfo; | ||
|
|
||
| public HbckEmptyRegionInfo(String emptyRegionInfo) { | ||
| this.regionInfo = emptyRegionInfo; | ||
| } | ||
|
|
||
| public String getRegionInfo() { | ||
| return regionInfo; | ||
| } | ||
| } |
47 changes: 47 additions & 0 deletions
47
...src/main/java/org/apache/hadoop/hbase/master/http/hbck/model/HbckInconsistentRegions.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.hadoop.hbase.master.http.hbck.model; | ||
|
|
||
| import java.util.List; | ||
| import org.apache.yetus.audience.InterfaceAudience; | ||
|
|
||
| @InterfaceAudience.Private | ||
| public class HbckInconsistentRegions { | ||
| private final String regionId; | ||
| private final HbckServerName serverNameInMeta; | ||
| private final List<HbckServerName> listOfServers; | ||
|
|
||
| public HbckInconsistentRegions(String inconsistentRegionId, HbckServerName serverNameInMeta, | ||
| List<HbckServerName> listOfServerName) { | ||
| this.regionId = inconsistentRegionId; | ||
| this.serverNameInMeta = serverNameInMeta; | ||
| this.listOfServers = listOfServerName; | ||
| } | ||
|
|
||
| public String getRegionId() { | ||
| return regionId; | ||
| } | ||
|
|
||
| public HbckServerName getServerNameInMeta() { | ||
| return serverNameInMeta; | ||
| } | ||
|
|
||
| public List<HbckServerName> getListOfServers() { | ||
| return listOfServers; | ||
| } | ||
| } |
88 changes: 88 additions & 0 deletions
88
hbase-server/src/main/java/org/apache/hadoop/hbase/master/http/hbck/model/HbckMetrics.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.hadoop.hbase.master.http.hbck.model; | ||
|
|
||
| import java.util.List; | ||
| import org.apache.yetus.audience.InterfaceAudience; | ||
|
|
||
| @InterfaceAudience.Private | ||
| public class HbckMetrics { | ||
|
|
||
| private final long hbckReportStartTime; | ||
| private final long hbckReportEndTime; | ||
| private final List<HbckOrphanRegionsOnFS> hbckOrphanRegionsOnFs; | ||
| private final List<HbckOrphanRegionsOnRS> hbckOrphanRegionsOnRs; | ||
| private final List<HbckInconsistentRegions> hbckInconsistentRegions; | ||
| private final List<HbckRegionHoles> hbckHoles; | ||
| private final List<HbckOverlapRegions> hbckOverlaps; | ||
| private final List<HbckUnknownServers> hbckUnknownServers; | ||
| private final List<HbckEmptyRegionInfo> hbckEmptyRegionInfo; | ||
|
|
||
| public HbckMetrics(long hbckReportStartTime, long hbckReportEndTime, | ||
| List<HbckOrphanRegionsOnFS> hbckOrphanRegionsOnFs, | ||
| List<HbckOrphanRegionsOnRS> hbckOrphanRegionsOnRs, | ||
| List<HbckInconsistentRegions> hbckInconsistentRegions, List<HbckRegionHoles> hbckHoles, | ||
| List<HbckOverlapRegions> hbckOverlaps, List<HbckUnknownServers> hbckUnknownServers, | ||
| List<HbckEmptyRegionInfo> hbckEmptyRegionInfo) { | ||
| this.hbckReportStartTime = hbckReportStartTime; | ||
| this.hbckReportEndTime = hbckReportEndTime; | ||
| this.hbckOrphanRegionsOnFs = hbckOrphanRegionsOnFs; | ||
| this.hbckOrphanRegionsOnRs = hbckOrphanRegionsOnRs; | ||
| this.hbckInconsistentRegions = hbckInconsistentRegions; | ||
| this.hbckHoles = hbckHoles; | ||
| this.hbckOverlaps = hbckOverlaps; | ||
| this.hbckUnknownServers = hbckUnknownServers; | ||
| this.hbckEmptyRegionInfo = hbckEmptyRegionInfo; | ||
| } | ||
|
|
||
| public long gethbckReportStartTime() { | ||
| return hbckReportStartTime; | ||
| } | ||
|
|
||
| public long gethbckReportEndTime() { | ||
| return hbckReportEndTime; | ||
| } | ||
|
|
||
| public List<HbckOrphanRegionsOnFS> gethbckOrphanRegionsOnFs() { | ||
| return hbckOrphanRegionsOnFs; | ||
| } | ||
|
|
||
| public List<HbckOrphanRegionsOnRS> gethbckOrphanRegionsOnRs() { | ||
| return hbckOrphanRegionsOnRs; | ||
| } | ||
|
|
||
| public List<HbckInconsistentRegions> gethbckInconsistentRegions() { | ||
| return hbckInconsistentRegions; | ||
| } | ||
|
|
||
| public List<HbckRegionHoles> gethbckHoles() { | ||
| return hbckHoles; | ||
| } | ||
|
|
||
| public List<HbckOverlapRegions> gethbckOverlaps() { | ||
| return hbckOverlaps; | ||
| } | ||
|
|
||
| public List<HbckUnknownServers> gethbckUnknownServers() { | ||
| return hbckUnknownServers; | ||
| } | ||
|
|
||
| public List<HbckEmptyRegionInfo> gethbckEmptyRegionInfo() { | ||
| return hbckEmptyRegionInfo; | ||
| } | ||
| } |
39 changes: 39 additions & 0 deletions
39
...r/src/main/java/org/apache/hadoop/hbase/master/http/hbck/model/HbckOrphanRegionsOnFS.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.hadoop.hbase.master.http.hbck.model; | ||
|
|
||
| import org.apache.yetus.audience.InterfaceAudience; | ||
|
|
||
| @InterfaceAudience.Private | ||
| public class HbckOrphanRegionsOnFS { | ||
| private final String regionId; | ||
| private final String regionHdfsPath; | ||
|
|
||
| public HbckOrphanRegionsOnFS(String regionId, String orphanRegionHdfsPath) { | ||
| this.regionId = regionId; | ||
| this.regionHdfsPath = orphanRegionHdfsPath; | ||
| } | ||
|
|
||
| public String getRegionId() { | ||
| return regionId; | ||
| } | ||
|
|
||
| public String getRegionHdfsPath() { | ||
| return regionHdfsPath; | ||
| } | ||
| } |
39 changes: 39 additions & 0 deletions
39
...r/src/main/java/org/apache/hadoop/hbase/master/http/hbck/model/HbckOrphanRegionsOnRS.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.hadoop.hbase.master.http.hbck.model; | ||
|
|
||
| import org.apache.yetus.audience.InterfaceAudience; | ||
|
|
||
| @InterfaceAudience.Private | ||
| public class HbckOrphanRegionsOnRS { | ||
| private final String regionId; | ||
| private final HbckServerName rsName; | ||
|
|
||
| public HbckOrphanRegionsOnRS(String orphanRegionId, HbckServerName orphanRegionRsName) { | ||
| this.regionId = orphanRegionId; | ||
| this.rsName = orphanRegionRsName; | ||
| } | ||
|
|
||
| public String getRegionId() { | ||
| return regionId; | ||
| } | ||
|
|
||
| public HbckServerName getRsName() { | ||
| return rsName; | ||
| } | ||
| } |
39 changes: 39 additions & 0 deletions
39
...rver/src/main/java/org/apache/hadoop/hbase/master/http/hbck/model/HbckOverlapRegions.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one | ||
| * or more contributor license agreements. See the NOTICE file | ||
| * distributed with this work for additional information | ||
| * regarding copyright ownership. The ASF licenses this file | ||
| * to you under the Apache License, Version 2.0 (the | ||
| * "License"); you may not use this file except in compliance | ||
| * with the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.hadoop.hbase.master.http.hbck.model; | ||
|
|
||
| import org.apache.yetus.audience.InterfaceAudience; | ||
|
|
||
| @InterfaceAudience.Private | ||
| public class HbckOverlapRegions { | ||
| private final HbckRegionDetails region1; | ||
| private final HbckRegionDetails region2; | ||
|
|
||
| public HbckOverlapRegions(HbckRegionDetails overlapRegion1, HbckRegionDetails overlapRegion2) { | ||
|
||
| this.region1 = overlapRegion1; | ||
| this.region2 = overlapRegion2; | ||
| } | ||
|
|
||
| public HbckRegionDetails getRegion1() { | ||
| return region1; | ||
| } | ||
|
|
||
| public HbckRegionDetails getRegion2() { | ||
| return region2; | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nice, thanks for adding this note.