Skip to content

Commit

Permalink
Review comments #1 [Contd.]
Browse files Browse the repository at this point in the history
- Changed the package for HBCKMetaTableAccessor
- Added comments for source of the copied methods
  • Loading branch information
jatsakthi committed Aug 15, 2019
1 parent dcc7c5b commit c5524eb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hbase.hbck1;
package org.apache.hbase;

import org.apache.hadoop.hbase.Cell;
import org.apache.hadoop.hbase.CellUtil;
Expand All @@ -39,12 +39,13 @@
* hbck's local version of the MetaTableAccessor from the hbase repo
*/
@InterfaceAudience.Private
class HBCKMetaTableAccessor {
public class HBCKMetaTableAccessor {

private static final Logger LOG = LoggerFactory.getLogger(HBCKMetaTableAccessor.class);
private static final Logger LOG = LoggerFactory.getLogger(
HBCKMetaTableAccessor.class);

// Constants
public static final byte[] MERGE_QUALIFIER_PREFIX = Bytes.toBytes("merge");
private static final byte[] MERGE_QUALIFIER_PREFIX = Bytes.toBytes("merge");

public static List<RegionInfo> getMergeRegions(Cell[] cells) {
if (cells == null) {
Expand Down Expand Up @@ -85,6 +86,7 @@ public static void deleteRegionInfo(Connection connection, RegionInfo regionInfo

// Private helper methods

// COPIED from MetaTableAccessor.isMergeQualifierPrefix()
private static boolean isMergeQualifierPrefix(Cell cell) {
// Check to see if has family and that qualifier starts with the MERGE_QUALIFIER_PREFIX
return CellUtil.matchingFamily(cell, HConstants.CATALOG_FAMILY) && qualifierStartsWith(cell,
Expand All @@ -94,6 +96,7 @@ private static boolean isMergeQualifierPrefix(Cell cell) {
/**
* Finds if the start of the qualifier part of the Cell matches 'startsWith'
*
* COPIED from PrivateCellUtil.qualifierStartsWith()
* @param left the cell with which we need to match the qualifier
* @param startsWith the serialized keyvalue format byte[]
* @return true if the qualifier have same staring characters, false otherwise
Expand All @@ -110,6 +113,7 @@ private static boolean qualifierStartsWith(final Cell left, final byte[] startsW
/**
* Delete the passed <code>d</code> from the <code>hbase:meta</code> table.
*
* COPIED MetaTableAccessor.deleteFromMetaTable()
* @param connection connection we're using
* @param d Delete to add to hbase:meta
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.util.ReflectionUtils;
import org.apache.hadoop.util.Tool;
import org.apache.hbase.HBCKMetaTableAccessor;
import org.apache.yetus.audience.InterfaceAudience;
import org.apache.yetus.audience.InterfaceStability;
import org.apache.zookeeper.KeeperException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import org.apache.hadoop.hbase.master.ServerManager;
import org.apache.hadoop.hbase.regionserver.HRegion;
import org.apache.hadoop.hbase.util.FSUtils;
import org.apache.hbase.HBCKMetaTableAccessor;
import org.apache.zookeeper.KeeperException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down

0 comments on commit c5524eb

Please sign in to comment.