public class BaseTestHBaseFsck extends Object
| Modifier and Type | Class and Description | 
|---|---|
| static class  | BaseTestHBaseFsck.MasterSyncCoprocessor | 
| (package private) static class  | BaseTestHBaseFsck.MockErrorReporter | 
| Modifier and Type | Field and Description | 
|---|---|
| protected static org.apache.hadoop.hbase.client.Admin | admin | 
| protected static org.apache.hadoop.hbase.master.assignment.AssignmentManager | assignmentManager | 
| protected static org.apache.hadoop.conf.Configuration | conf | 
| protected static org.apache.hadoop.hbase.client.ClusterConnection | connection | 
| protected static byte[] | FAM | 
| protected static String | FAM_STR | 
| protected static ScheduledThreadPoolExecutor | hbfsckExecutorService | 
| protected static org.slf4j.Logger | LOG | 
| org.junit.rules.TestName | name | 
| (package private) static int | POOL_SIZE | 
| protected static int | REGION_ONLINE_TIMEOUT | 
| protected static org.apache.hadoop.hbase.master.assignment.RegionStates | regionStates | 
| protected static byte[][] | ROWKEYS | 
| protected static byte[][] | SPLITS | 
| protected static ExecutorService | tableExecutorService | 
| protected org.apache.hadoop.hbase.client.Table | tbl | 
| protected static HBaseTestingUtility | TEST_UTIL | 
| Constructor and Description | 
|---|
| BaseTestHBaseFsck() | 
| Modifier and Type | Method and Description | 
|---|---|
| (package private) void | cleanupTable(org.apache.hadoop.hbase.TableName tablename)delete table in preparation for next test | 
| (package private) int | countRows()Counts the number of rows to verify data loss or non-dataloss. | 
| (package private) int | countRows(byte[] start,
         byte[] end)Counts the number of rows to verify data loss or non-dataloss. | 
| (package private) String | createMobFileName(String oldFileName)Creates a new mob file name by the old one. | 
| static void | createTable(HBaseTestingUtility testUtil,
           org.apache.hadoop.hbase.HTableDescriptor htd,
           byte[][] splitKeys) | 
| protected void | deleteMetaRegion(org.apache.hadoop.conf.Configuration conf,
                boolean unassign,
                boolean hdfs,
                boolean regionInfoOnly) | 
| protected void | deleteRegion(org.apache.hadoop.conf.Configuration conf,
            org.apache.hadoop.hbase.HTableDescriptor htd,
            byte[] startKey,
            byte[] endKey,
            boolean unassign,
            boolean metaRow,
            boolean hdfs)Delete a region from assignments, meta, or completely from hdfs. | 
| protected void | deleteRegion(org.apache.hadoop.conf.Configuration conf,
            org.apache.hadoop.hbase.HTableDescriptor htd,
            byte[] startKey,
            byte[] endKey,
            boolean unassign,
            boolean metaRow,
            boolean hdfs,
            boolean regionInfoOnly,
            int replicaId)Delete a region from assignments, meta, or completely from hdfs. | 
| static void | deleteTable(HBaseTestingUtility testUtil,
           org.apache.hadoop.hbase.TableName tableName) | 
| void | deleteTableDir(org.apache.hadoop.hbase.TableName table) | 
| protected void | doQuarantineTest(org.apache.hadoop.hbase.TableName table,
                org.apache.hadoop.hbase.util.HBaseFsck hbck,
                int check,
                int corrupt,
                int fail,
                int quar,
                int missing)Test that use this should have a timeout, because this method could potentially wait forever. | 
| protected void | dumpMeta(org.apache.hadoop.hbase.TableName tableName)Debugging method to dump the contents of meta. | 
| (package private) org.apache.hadoop.hbase.ServerName | findDeployedHSI(Map<org.apache.hadoop.hbase.ServerName,List<String>> mm,
               org.apache.hadoop.hbase.client.RegionInfo hri)Returns the HSI a region info is on. | 
| (package private) Map<org.apache.hadoop.hbase.ServerName,List<String>> | getDeployedHRIs(org.apache.hadoop.hbase.client.Admin admin)Get region info from local cluster. | 
| (package private) org.apache.hadoop.fs.Path | getFlushedHFile(org.apache.hadoop.fs.FileSystem fs,
               org.apache.hadoop.hbase.TableName table)We don't have an easy way to verify that a flush completed, so we loop until we find a
 legitimate hfile and return it. | 
| (package private) org.apache.hadoop.fs.Path | getFlushedMobFile(org.apache.hadoop.fs.FileSystem fs,
                 org.apache.hadoop.hbase.TableName table)Gets flushed mob files. | 
| (package private) void | setupMobTable(org.apache.hadoop.hbase.TableName tablename)Setup a clean table with a mob-enabled column. | 
| (package private) void | setupTable(org.apache.hadoop.hbase.TableName tablename)Setup a clean table before we start mucking with it. | 
| (package private) void | setupTableWithRegionReplica(org.apache.hadoop.hbase.TableName tablename,
                           int replicaCount)Setup a clean table with a certain region_replica count
 It will set tbl which needs to be closed after test | 
| protected void | undeployRegion(org.apache.hadoop.hbase.client.Connection conn,
              org.apache.hadoop.hbase.ServerName sn,
              org.apache.hadoop.hbase.client.RegionInfo hri)This method is used to undeploy a region -- close it and attempt to
 remove its state from the Master. | 
static final int POOL_SIZE
protected static final org.slf4j.Logger LOG
protected static final HBaseTestingUtility TEST_UTIL
protected static final org.apache.hadoop.conf.Configuration conf
protected static final String FAM_STR
protected static final byte[] FAM
protected static final int REGION_ONLINE_TIMEOUT
protected static org.apache.hadoop.hbase.master.assignment.AssignmentManager assignmentManager
protected static org.apache.hadoop.hbase.master.assignment.RegionStates regionStates
protected static ExecutorService tableExecutorService
protected static ScheduledThreadPoolExecutor hbfsckExecutorService
protected static org.apache.hadoop.hbase.client.ClusterConnection connection
protected static org.apache.hadoop.hbase.client.Admin admin
protected org.apache.hadoop.hbase.client.Table tbl
protected static final byte[][] SPLITS
protected static final byte[][] ROWKEYS
public org.junit.rules.TestName name
public BaseTestHBaseFsck()
protected void dumpMeta(org.apache.hadoop.hbase.TableName tableName) throws IOException
IOExceptionprotected void undeployRegion(org.apache.hadoop.hbase.client.Connection conn, org.apache.hadoop.hbase.ServerName sn, org.apache.hadoop.hbase.client.RegionInfo hri) throws IOException, InterruptedException
IOExceptionInterruptedExceptionprotected void deleteRegion(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd, byte[] startKey, byte[] endKey, boolean unassign, boolean metaRow, boolean hdfs) throws IOException, InterruptedException
unassign - if true unassign region if assignedmetaRow - if true remove region's row from METAhdfs - if true remove region's dir in HDFSIOExceptionInterruptedExceptionprotected void deleteRegion(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.HTableDescriptor htd, byte[] startKey, byte[] endKey, boolean unassign, boolean metaRow, boolean hdfs, boolean regionInfoOnly, int replicaId) throws IOException, InterruptedException
unassign - if true unassign region if assignedmetaRow - if true remove region's row from METAhdfs - if true remove region's dir in HDFSregionInfoOnly - if true remove a region dir's .regioninfo filereplicaId - replica idIOExceptionInterruptedExceptionvoid setupTable(org.apache.hadoop.hbase.TableName tablename) throws Exception
IOExceptionInterruptedExceptionorg.apache.zookeeper.KeeperExceptionExceptionvoid setupTableWithRegionReplica(org.apache.hadoop.hbase.TableName tablename, int replicaCount) throws Exception
Exceptionvoid setupMobTable(org.apache.hadoop.hbase.TableName tablename) throws Exception
tablename - The name of a table to be created.Exceptionint countRows() throws IOException
IOExceptionint countRows(byte[] start, byte[] end) throws IOException
IOExceptionvoid cleanupTable(org.apache.hadoop.hbase.TableName tablename) throws Exception
tablename - IOExceptionExceptionMap<org.apache.hadoop.hbase.ServerName,List<String>> getDeployedHRIs(org.apache.hadoop.hbase.client.Admin admin) throws IOException
IOExceptionorg.apache.hadoop.hbase.ServerName findDeployedHSI(Map<org.apache.hadoop.hbase.ServerName,List<String>> mm, org.apache.hadoop.hbase.client.RegionInfo hri)
public void deleteTableDir(org.apache.hadoop.hbase.TableName table) throws IOException
IOExceptionorg.apache.hadoop.fs.Path getFlushedHFile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.hbase.TableName table) throws IOException
fs - table - IOExceptionorg.apache.hadoop.fs.Path getFlushedMobFile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.hbase.TableName table) throws IOException
fs - The current file system.table - The current table name.IOExceptionString createMobFileName(String oldFileName)
oldFileName - The old mob file name.protected void doQuarantineTest(org.apache.hadoop.hbase.TableName table, org.apache.hadoop.hbase.util.HBaseFsck hbck, int check, int corrupt, int fail, int quar, int missing) throws Exception
Exceptionprotected void deleteMetaRegion(org.apache.hadoop.conf.Configuration conf, boolean unassign, boolean hdfs, boolean regionInfoOnly) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic static void createTable(HBaseTestingUtility testUtil, org.apache.hadoop.hbase.HTableDescriptor htd, byte[][] splitKeys) throws Exception
Exceptionpublic static void deleteTable(HBaseTestingUtility testUtil, org.apache.hadoop.hbase.TableName tableName) throws Exception
ExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.