Class TestWALPlayer
java.lang.Object
org.apache.hadoop.hbase.mapreduce.TestWALPlayer
@Tag("org.apache.hadoop.hbase.testclassification.MapReduceTests") @Tag("org.apache.hadoop.hbase.testclassification.LargeTests")
public class TestWALPlayer
extends Object
Basic test for the WALPlayer M/R tool
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static Stringprivate static SingleProcessHBaseClusterprivate static final byte[]private static final byte[]private static org.apache.hadoop.conf.Configurationprivate static final byte[]private static org.apache.hadoop.fs.FileSystemprivate static org.apache.hadoop.fs.FileSystemprivate static org.apache.hadoop.fs.FileSystemprivate static org.apache.hadoop.fs.Pathprivate static final byte[]private static final HBaseTestingUtilprivate static org.apache.hadoop.fs.Path -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidprivate voidassertMultiTableOutputFormatDirStructure(org.apache.hadoop.hbase.TableName tableName, String namespace) static voidprivate org.apache.hadoop.fs.PathcreateEmptyWALFile(String walDir) private voidputRowIntoTable(org.apache.hadoop.hbase.client.Table table) private static voidprivate voidsetConfSimilarToIncrementalBackupWALToHFilesMethod(org.junit.jupiter.api.TestInfo testInfo, org.apache.hadoop.conf.Configuration conf) voidvoidTest main methodvoidTest that WALPlayer can replay recovered.edits files.voidTest WALKeyValueMapper setup and mapprivate voidtestWALKeyValueMapper(String tableConfigKey) voidvoidtestWALPlayer(org.junit.jupiter.api.TestInfo testInfo) Simple end-to-end testvoidtestWALPlayerBulkLoadWithOverriddenTimestamps(org.junit.jupiter.api.TestInfo testInfo) Tests that when you write multiple cells with the same timestamp they are properly sorted by their sequenceId in WALPlayer/CellSortReducer so that the correct one wins when querying from the resulting bulkloaded HFiles.voidtestWALPlayerMultiTableHFileOutputFormat(org.junit.jupiter.api.TestInfo testInfo) Verifies the HFile output format for WALPlayer has the following directory structure when "hbase.mapreduce.use.multi.table.hfileoutputformat" is set to true:
.../BULK_OUTPUT_CONF_KEY/namespace/tableName/columnFamilyvoidtestWALPlayerSingleTableHFileOutputFormat(org.junit.jupiter.api.TestInfo testInfo) Verifies the HFile output format for WALPlayer has the following directory structure when "hbase.mapreduce.use.multi.table.hfileoutputformat" is set to false:
.../BULK_OUTPUT_CONF_KEY/columnFamily
Also verifies an exception occurs when the WALPlayer is run on multiple tables at once while hbase.mapreduce.use.multi.table.hfileoutputformat is set to false.
-
Field Details
-
FAMILY
-
COLUMN1
-
COLUMN2
-
ROW
-
TEST_UTIL
-
cluster
-
rootDir
-
walRootDir
-
localFs
-
logFs
-
conf
-
hdfs
-
bulkLoadOutputDir
-
-
Constructor Details
-
TestWALPlayer
public TestWALPlayer()
-
-
Method Details
-
beforeClass
- Throws:
Exception
-
afterClass
- Throws:
Exception
-
testPlayingRecoveredEdit
Test that WALPlayer can replay recovered.edits files.- Throws:
Exception
-
testWALPlayerBulkLoadWithOverriddenTimestamps
@Test public void testWALPlayerBulkLoadWithOverriddenTimestamps(org.junit.jupiter.api.TestInfo testInfo) throws Exception Tests that when you write multiple cells with the same timestamp they are properly sorted by their sequenceId in WALPlayer/CellSortReducer so that the correct one wins when querying from the resulting bulkloaded HFiles. See HBASE-27649- Throws:
Exception
-
testWALPlayer
Simple end-to-end test- Throws:
Exception
-
testWALKeyValueMapper
Test WALKeyValueMapper setup and map- Throws:
Exception
-
testWALKeyValueMapperWithDeprecatedConfig
- Throws:
Exception
-
testWALKeyValueMapper
- Throws:
Exception
-
testMainMethod
Test main method- Throws:
Exception
-
runWithDiskBasedSortingDisabledAndEnabled
private static void runWithDiskBasedSortingDisabledAndEnabled(TestWALPlayer.TestMethod method) throws Exception - Throws:
Exception
-
testIgnoreEmptyWALFiles
- Throws:
Exception
-
testWALPlayerMultiTableHFileOutputFormat
@Test public void testWALPlayerMultiTableHFileOutputFormat(org.junit.jupiter.api.TestInfo testInfo) throws Exception Verifies the HFile output format for WALPlayer has the following directory structure when "hbase.mapreduce.use.multi.table.hfileoutputformat" is set to true:
.../BULK_OUTPUT_CONF_KEY/namespace/tableName/columnFamily- Throws:
Exception
-
testWALPlayerSingleTableHFileOutputFormat
@Test public void testWALPlayerSingleTableHFileOutputFormat(org.junit.jupiter.api.TestInfo testInfo) throws Exception Verifies the HFile output format for WALPlayer has the following directory structure when "hbase.mapreduce.use.multi.table.hfileoutputformat" is set to false:
.../BULK_OUTPUT_CONF_KEY/columnFamily
Also verifies an exception occurs when the WALPlayer is run on multiple tables at once while hbase.mapreduce.use.multi.table.hfileoutputformat is set to false.- Throws:
Exception
-
putRowIntoTable
- Throws:
IOException
-
createEmptyWALFile
- Throws:
IOException
-
setConfSimilarToIncrementalBackupWALToHFilesMethod
private void setConfSimilarToIncrementalBackupWALToHFilesMethod(org.junit.jupiter.api.TestInfo testInfo, org.apache.hadoop.conf.Configuration conf) -
assertMultiTableOutputFormatDirStructure
private void assertMultiTableOutputFormatDirStructure(org.apache.hadoop.hbase.TableName tableName, String namespace) throws IOException - Throws:
IOException
-