Class TestImportExportBase
java.lang.Object
org.apache.hadoop.hbase.mapreduce.TestImportExportBase
- Direct Known Subclasses:
TestImportExport
Base class for testing Import/Export. Shared logic without @BeforeAll/@AfterAll to allow
subclasses to manage their own lifecycle.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprivate static classThis listens to theTestImportExportBase.TableWALActionListener.visitLogEntryBeforeWrite(RegionInfo, WALKey, WALEdit)to identify that an entry is written to the Write Ahead Log for the given table. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprotected final org.apache.hadoop.hbase.TableNameprivate static final byte[]private static final Stringprivate static final byte[]private static final Stringprotected static Stringprotected final org.apache.hadoop.hbase.TableNameprivate static final org.slf4j.Loggerprotected Stringprivate static final longprotected static final Stringprivate static final byte[]private static final byte[]private static final byte[]private static final byte[]static final Stringstatic final Stringstatic final byteprotected static final HBaseTestingUtil -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidannounce(org.junit.jupiter.api.TestInfo testInfo) private voidcheckWhetherTagExists(org.apache.hadoop.hbase.TableName table, boolean tagExists) voidcleanup()private intgetCount(org.apache.hadoop.hbase.client.Table table, org.apache.hadoop.hbase.filter.Filter filter) Count the number of keyvalues in the specified table with the given filterprotected booleanRuns an export job with the specified command line argsprotected voidrunExportMain(String[] args) (package private) booleanRuns an import job with the specified command line argsprotected static voidvoidTest addFilterAndArguments method of Import This method set couple parameters into ConfigurationvoidCreate a simple table, run an Export Job on it, Import with bulk output and enable largeResultvoidvoidtest main method.voidvoidTest export scanner batchingvoidTest import data from 0.94 exported filevoidtest main method.voidTest map method of ImportervoidTest export hbase:meta tablevoidTest simple replication case with column mappingvoidAdd cell tags to delete mutations, run export and import tool and verify that tags are present in import table also.voidSet hbase.client.rpc.codec and hbase.client.default.rpc.codec both to empty string This means it will use no Codec.voidvoidCreate a simple table, run an Export Job on it, Import with filtering on, verify counts, attempt with invalid values.void
-
Field Details
-
LOG
-
UTIL
-
ROW1
-
ROW2
-
ROW3
-
FAMILYA_STRING
- See Also:
-
FAMILYB_STRING
- See Also:
-
FAMILYA
-
FAMILYB
-
QUAL
-
OUTPUT_DIR
- See Also:
-
FQ_OUTPUT_DIR
-
EXPORT_BATCH_SIZE
- See Also:
-
now
-
EXPORT_TABLE
-
IMPORT_TABLE
-
TEST_TAG_TYPE
- See Also:
-
TEST_ATTR
- See Also:
-
TEST_TAG
- See Also:
-
name
-
-
Constructor Details
-
TestImportExportBase
public TestImportExportBase()
-
-
Method Details
-
announce
-
cleanup
- Throws:
Throwable
-
setUpBeforeClass
- Throws:
Exception
-
runExport
Runs an export job with the specified command line args- Returns:
- true if job completed successfully
- Throws:
Throwable
-
runExportMain
- Throws:
Throwable
-
runImport
Runs an import job with the specified command line args- Returns:
- true if job completed successfully
- Throws:
Throwable
-
testSimpleCase
Test simple replication case with column mapping- Throws:
Throwable
-
testMetaExport
Test export hbase:meta table- Throws:
Throwable
-
testImport94Table
Test import data from 0.94 exported file- Throws:
Throwable
-
testExportScannerBatching
Test export scanner batching- Throws:
Throwable
-
testWithDeletes
- Throws:
Throwable
-
testWithMultipleDeleteFamilyMarkersOfSameRowSameFamily
- Throws:
Throwable
-
testWithFilter
Create a simple table, run an Export Job on it, Import with filtering on, verify counts, attempt with invalid values.- Throws:
Throwable
-
testBulkImportAndLargeResult
Create a simple table, run an Export Job on it, Import with bulk output and enable largeResult- Throws:
Throwable
-
getCount
private int getCount(org.apache.hadoop.hbase.client.Table table, org.apache.hadoop.hbase.filter.Filter filter) throws IOException Count the number of keyvalues in the specified table with the given filter- Parameters:
table- the table to scan- Returns:
- the number of keyvalues found
- Throws:
IOException
-
testImportMain
test main method. Import should print help and call System.exit- Throws:
Throwable
-
testExportScan
- Throws:
Exception
-
testExportMain
test main method. Export should print help and call System.exit- Throws:
Throwable
-
testKeyValueImporter
Test map method of Importer- Throws:
Throwable
-
testAddFilterAndArguments
Test addFilterAndArguments method of Import This method set couple parameters into Configuration- Throws:
IOException
-
testDurability
- Throws:
Throwable
-
testTagsAddition
Add cell tags to delete mutations, run export and import tool and verify that tags are present in import table also.- Throws:
Throwable- throws Throwable.
-
checkWhetherTagExists
private void checkWhetherTagExists(org.apache.hadoop.hbase.TableName table, boolean tagExists) throws IOException - Throws:
IOException
-
testTagsWithEmptyCodec
Set hbase.client.rpc.codec and hbase.client.default.rpc.codec both to empty string This means it will use no Codec. Make sure that we don't return Tags in response.- Throws:
Exception- Exception
-