Class TestImportExport
java.lang.Object
org.apache.hadoop.hbase.mapreduce.TestImportExport
Tests the table import and table export MR job functionality
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprivate static classThis listens to theTestImportExport.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 TypeFieldDescriptionstatic final HBaseClassTestRuleprivate static final Stringprivate final org.apache.hadoop.hbase.TableNameprivate static final byte[]private static final Stringprivate static final byte[]private static final Stringprivate static Stringprivate final org.apache.hadoop.hbase.TableNameprivate static final org.slf4j.Loggerfinal org.junit.rules.TestNameprivate static final longprivate 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 HBaseTestingUtility -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidvoidannounce()static voidprivate 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 argsvoidTest addFilterAndArguments method of Import This method set couple parameters into Configurationvoidvoidtest 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
-
CLASS_RULE
-
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
-
TestImportExport
public TestImportExport()
-
-
Method Details
-
beforeClass
- Throws:
Throwable
-
afterClass
- Throws:
Throwable
-
announce
-
cleanup
- Throws:
Throwable
-
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
-
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
-