Skip to content
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

HBASE-26192 Master UI hbck should provide a JSON formatted output option #5772

Merged
merged 9 commits into from
Apr 8, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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;

import org.apache.yetus.audience.InterfaceAudience;

/**
* POJO to present Empty Region Info from Catalog Janitor Inconsistencies Report via REST API. These
* inconsistencies are shown on hbck.jsp page on Active HMaster UI as part of Catalog Janitor
* inconsistencies.
*/
@InterfaceAudience.Public
public class HbckEmptyRegionInfo {
private final String regionInfo;

public HbckEmptyRegionInfo(String emptyRegionInfo) {
this.regionInfo = emptyRegionInfo;
}

public String getRegionInfo() {
return regionInfo;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* 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;

import java.util.List;
import org.apache.yetus.audience.InterfaceAudience;

/**
* POJO to present HBCK Inconsistent Regions from HBCK Inconsistencies Report via REST API. These
* inconsistencies are shown on hbck.jsp page on Active HMaster UI as part of HBCK inconsistencies.
*/
@InterfaceAudience.Public
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;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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;

import org.apache.yetus.audience.InterfaceAudience;

/**
* POJO to present Orphan Region on FS from HBCK Inconsistencies Report via REST API. These
* inconsistencies are shown on hbck.jsp page on Active HMaster UI as part of HBCK Inconsistencies.
*/
@InterfaceAudience.Public
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;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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;

import org.apache.yetus.audience.InterfaceAudience;

/**
* POJO to present Orphan Region on RS from HBCK Inconsistencies Report via REST API. These
* inconsistencies are shown on hbck.jsp page on Active HMaster UI as part of HBCK Inconsistencies.
*/
@InterfaceAudience.Public
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;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* 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;

import org.apache.yetus.audience.InterfaceAudience;

/**
* POJO to present Region Overlap from Catalog Janitor Inconsistencies Report via REST API. These
* inconsistencies are shown on hbck.jsp page on Active HMaster UI as part of Catalog Janitor
* inconsistencies.
*/
@InterfaceAudience.Public
public class HbckOverlapRegions {
private final HbckRegionDetails region1Info;
private final HbckRegionDetails region2Info;

public HbckOverlapRegions(HbckRegionDetails region1Info, HbckRegionDetails region2Info) {
this.region1Info = region1Info;
this.region2Info = region2Info;
}

public HbckRegionDetails getRegion1Info() {
return region1Info;
}

public HbckRegionDetails getRegion2Info() {
return region2Info;
}
}
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;

import org.apache.yetus.audience.InterfaceAudience;

/**
* POJO class for HBCK RegionInfo in HBCK Inconsistencies report.
*/
@InterfaceAudience.Public
public class HbckRegionDetails {
private final String regionId;
private final String tableName;
private final String startKey;
private final String endKey;

public HbckRegionDetails(String regionId, String tableName, String startKey, String endKey) {
this.regionId = regionId;
this.tableName = tableName;
this.startKey = startKey;
this.endKey = endKey;
}

public String getRegionId() {
return regionId;
}

public String getTableName() {
return tableName;
}

public String getStartKey() {
return startKey;
}

public String getEndKey() {
return endKey;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* 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;

import org.apache.yetus.audience.InterfaceAudience;

/**
* POJO to present Region Holes from Catalog Janitor Inconsistencies Report via REST API. These
* inconsistencies are shown on hbck.jsp page on Active HMaster UI as part of Catalog Janitor
* inconsistencies.
*/
@InterfaceAudience.Public
public class HbckRegionHoles {
private final HbckRegionDetails region1Info;
private final HbckRegionDetails region2Info;

public HbckRegionHoles(HbckRegionDetails region1Info, HbckRegionDetails region2Info) {
this.region1Info = region1Info;
this.region2Info = region2Info;
}

public HbckRegionDetails getRegion1Info() {
return region1Info;
}

public HbckRegionDetails getRegion2Info() {
return region2Info;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* 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;

import org.apache.yetus.audience.InterfaceAudience;

/**
* POJO class for ServerName in HBCK Inconsistencies report.
*/
@InterfaceAudience.Public
public class HbckServerName {
private final String hostName;
private final int hostPort;
private final long startCode;

public HbckServerName(String hostName, int hostPort, long startCode) {
this.hostName = hostName;
this.hostPort = hostPort;
this.startCode = startCode;
}

public String getHostName() {
return hostName;
}

public int getHostPort() {
return hostPort;
}

public long getStartCode() {
return startCode;
}
}
Loading