Class TestTableSnapshotInputFormat
java.lang.Object
org.apache.hadoop.hbase.mapreduce.TableSnapshotInputFormatTestBase
org.apache.hadoop.hbase.mapreduce.TestTableSnapshotInputFormat
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]private static final byte[]static final HBaseClassTestRuleprivate static final org.slf4j.Loggerorg.junit.rules.TestNameprivate static final byte[]private static final byte[]Fields inherited from class org.apache.hadoop.hbase.mapreduce.TableSnapshotInputFormatTestBase
FAMILIES, fs, NUM_REGION_SERVERS, rootDir, UTIL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddoTestWithMapReduce(HBaseTestingUtil util, org.apache.hadoop.hbase.TableName tableName, String snapshotName, byte[] startRow, byte[] endRow, org.apache.hadoop.fs.Path tableDir, int numRegions, int numSplitsPerRegion, int expectedNumSplits, boolean shutdownCluster) protected byte[]protected byte[]private org.apache.hadoop.hbase.client.ScanserializeAndReturn(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.Scan s) Serializes and deserializes the given scan in the same manner that TableSnapshotInputFormat does.voidvoidvoidvoidvoidTest that explicitly restores a snapshot to a temp directory and reads the restored regions via ClientSideRegionScanner through a MapReduce job.voidtestRestoreSnapshotDoesNotCreateBackRefLinksInit(org.apache.hadoop.hbase.TableName tableName, String snapshotName, org.apache.hadoop.fs.Path tmpTableDir) voidvoidprotected voidtestWithMapReduceImpl(HBaseTestingUtil util, org.apache.hadoop.hbase.TableName tableName, String snapshotName, org.apache.hadoop.fs.Path tableDir, int numRegions, int numSplitsPerRegion, int expectedNumSplits, boolean shutdownCluster) voidvoidtestWithMockedMapReduce(HBaseTestingUtil util, String snapshotName, int numRegions, int numSplitsPerRegion, int expectedNumSplits, boolean setLocalityEnabledTo) voidvoidvoidprivate voidverifyWithMockedMapReduce(org.apache.hadoop.mapreduce.Job job, int numRegions, int expectedNumSplits, byte[] startRow, byte[] stopRow) Methods inherited from class org.apache.hadoop.hbase.mapreduce.TableSnapshotInputFormatTestBase
createTableAndSnapshot, setupCluster, tearDownCluster, testRestoreSnapshotDoesNotCreateBackRefLinks, testWithMapReduce, testWithMapReduceAndOfflineHBaseMultiRegion, testWithMapReduceMultiRegion, testWithMapReduceSingleRegion, testWithMockedMapReduceMultiRegion, testWithMockedMapReduceSingleRegion, verifyRowFromMap
-
Field Details
-
CLASS_RULE
-
LOG
-
bbb
-
yyy
-
bbc
-
yya
-
name
-
-
Constructor Details
-
TestTableSnapshotInputFormat
public TestTableSnapshotInputFormat()
-
-
Method Details
-
getStartRow
- Specified by:
getStartRowin classTableSnapshotInputFormatTestBase
-
getEndRow
- Specified by:
getEndRowin classTableSnapshotInputFormatTestBase
-
testGetBestLocations
- Throws:
IOException
-
testInitTableSnapshotMapperJobConfig
- Throws:
Exception
-
testWithMockedMapReduceSingleRegionByRegionLocation
- Throws:
Exception
-
testRestoreSnapshotDoesNotCreateBackRefLinksInit
public void testRestoreSnapshotDoesNotCreateBackRefLinksInit(org.apache.hadoop.hbase.TableName tableName, String snapshotName, org.apache.hadoop.fs.Path tmpTableDir) throws Exception - Specified by:
testRestoreSnapshotDoesNotCreateBackRefLinksInitin classTableSnapshotInputFormatTestBase- Throws:
Exception
-
testWithMockedMapReduce
public void testWithMockedMapReduce(HBaseTestingUtil util, String snapshotName, int numRegions, int numSplitsPerRegion, int expectedNumSplits, boolean setLocalityEnabledTo) throws Exception - Specified by:
testWithMockedMapReducein classTableSnapshotInputFormatTestBase- Throws:
Exception
-
testWithMockedMapReduceWithSplitsPerRegion
- Throws:
Exception
-
testWithMockedMapReduceWithNoStartRowStopRow
- Throws:
Exception
-
testScanLimit
- Throws:
Exception
-
testNoDuplicateResultsWhenSplitting
- Throws:
Exception
-
testScannerReadTypeConfiguration
- Throws:
IOException
-
serializeAndReturn
private org.apache.hadoop.hbase.client.Scan serializeAndReturn(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.client.Scan s) throws IOException Serializes and deserializes the given scan in the same manner that TableSnapshotInputFormat does.- Throws:
IOException
-
verifyWithMockedMapReduce
private void verifyWithMockedMapReduce(org.apache.hadoop.mapreduce.Job job, int numRegions, int expectedNumSplits, byte[] startRow, byte[] stopRow) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
testWithMapReduceImpl
protected void testWithMapReduceImpl(HBaseTestingUtil util, org.apache.hadoop.hbase.TableName tableName, String snapshotName, org.apache.hadoop.fs.Path tableDir, int numRegions, int numSplitsPerRegion, int expectedNumSplits, boolean shutdownCluster) throws Exception - Specified by:
testWithMapReduceImplin classTableSnapshotInputFormatTestBase- Throws:
Exception
-
doTestWithMapReduce
public static void doTestWithMapReduce(HBaseTestingUtil util, org.apache.hadoop.hbase.TableName tableName, String snapshotName, byte[] startRow, byte[] endRow, org.apache.hadoop.fs.Path tableDir, int numRegions, int numSplitsPerRegion, int expectedNumSplits, boolean shutdownCluster) throws Exception - Throws:
Exception
-
testWithMapReduceMultipleMappersPerRegion
- Throws:
Exception
-
testCleanRestoreDir
- Throws:
Exception
-
testReadFromRestoredSnapshotViaMR
Test that explicitly restores a snapshot to a temp directory and reads the restored regions via ClientSideRegionScanner through a MapReduce job.This test verifies the full workflow: 1. Create and load a table with data 2. Create a snapshot and restore the snapshot to a temporary directory 3. Configure a job to read the restored regions via ClientSideRegionScanner using TableSnapshotInputFormat and verify that it succeeds 4. Delete restored temporary directory 5. Configure a new job and verify that it fails
- Throws:
Exception
-