Class TestImportExport
java.lang.Object
org.apache.hadoop.hbase.mapreduce.TestImportExport
Tests the table import and table export MR job functionality
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
private static class
This 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
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static final String
private final org.apache.hadoop.hbase.TableName
private static final byte[]
private static final String
private static final byte[]
private static final String
private static String
private final org.apache.hadoop.hbase.TableName
private static final org.slf4j.Logger
final org.junit.rules.TestName
private static final long
private static final String
private static final byte[]
private static final byte[]
private static final byte[]
private static final byte[]
static final String
static final String
static final byte
protected static final HBaseTestingUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
void
announce()
static void
private void
checkWhetherTagExists
(org.apache.hadoop.hbase.TableName table, boolean tagExists) void
cleanup()
private int
getCount
(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 boolean
Runs an export job with the specified command line argsprotected void
runExportMain
(String[] args) (package private) boolean
Runs an import job with the specified command line argsvoid
Test addFilterAndArguments method of Import This method set couple parameters into Configurationvoid
void
test main method.void
void
Test export scanner batchingvoid
Test import data from 0.94 exported filevoid
test main method.void
Test map method of Importervoid
Test export hbase:meta tablevoid
Test simple replication case with column mappingvoid
Add cell tags to delete mutations, run export and import tool and verify that tags are present in import table also.void
Set hbase.client.rpc.codec and hbase.client.default.rpc.codec both to empty string This means it will use no Codec.void
void
Create 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
-