public class TestImportTsv extends Object implements org.apache.hadoop.conf.Configurable
| Modifier and Type | Field and Description |
|---|---|
private Map<String,String> |
args |
static HBaseClassTestRule |
CLASS_RULE |
protected static String |
DELETE_AFTER_LOAD_CONF |
org.junit.rules.ExpectedException |
exception |
private String |
FAMILY |
protected static String |
FORCE_COMBINER_CONF
Force use of combiner in doMROnTableTest.
|
private static org.slf4j.Logger |
LOG |
protected static String |
NAME |
private org.apache.hadoop.hbase.TableName |
tn |
protected static HBaseTestingUtility |
util |
| Constructor and Description |
|---|
TestImportTsv() |
| Modifier and Type | Method and Description |
|---|---|
protected static org.apache.hadoop.util.Tool |
doMROnTableTest(HBaseTestingUtility util,
org.apache.hadoop.hbase.TableName table,
String family,
String data,
Map<String,String> args) |
protected static org.apache.hadoop.util.Tool |
doMROnTableTest(HBaseTestingUtility util,
org.apache.hadoop.hbase.TableName table,
String family,
String data,
Map<String,String> args,
int valueMultiplier,
int expectedKVCount)
Run an ImportTsv job and perform basic validation on the results.
|
private org.apache.hadoop.util.Tool |
doMROnTableTest(String data,
int valueMultiplier) |
org.apache.hadoop.conf.Configuration |
getConf() |
private static int |
getKVCountFromHfile(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path p)
Method returns the total KVs in given hfile
|
static void |
provisionCluster() |
static void |
releaseCluster() |
void |
setConf(org.apache.hadoop.conf.Configuration conf) |
void |
setup() |
void |
testBulkOutputWithAnExistingTable() |
void |
testBulkOutputWithAnExistingTableNoStrictTrue() |
void |
testBulkOutputWithoutAnExistingTable() |
void |
testBulkOutputWithTsvImporterTextMapper() |
void |
testDryModeWithBulkModeAndTableDoesNotExistsCreateTableSetToYes() |
void |
testDryModeWithBulkOutputAndTableDoesNotExistsCreateTableSetToNo()
If table is not present in bulk mode and create.table is not set to yes,
import should fail with TableNotFoundException.
|
void |
testDryModeWithBulkOutputAndTableExists() |
void |
testDryModeWithoutBulkOutputAndTableDoesNotExists()
If table is not present in non-bulk mode, dry run should fail just like
normal mode.
|
void |
testDryModeWithoutBulkOutputAndTableExists() |
void |
testJobConfigurationsWithDryMode() |
void |
testJobConfigurationsWithTsvImporterTextMapper() |
void |
testMROnTable() |
void |
testMROnTableWithCustomMapper() |
void |
testMROnTableWithTimestamp() |
void |
testMRWithoutAnExistingTable() |
void |
testSkipEmptyColumns() |
void |
testTsvImporterTextMapperWithInvalidData()
If there are invalid data rows as inputs, then only those rows should be ignored.
|
void |
testWithoutAnExistingTableAndCreateTableSetToNo() |
private static void |
validateHFiles(org.apache.hadoop.fs.FileSystem fs,
String outputPath,
String family,
int expectedKVCount)
Confirm ImportTsv via HFiles on fs.
|
private static void |
validateTable(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.hbase.TableName tableName,
String family,
int valueMultiplier,
boolean isDryRun)
Confirm ImportTsv via data in online table.
|
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
protected static HBaseTestingUtility util
protected static final String DELETE_AFTER_LOAD_CONF
protected static final String FORCE_COMBINER_CONF
private final String FAMILY
private org.apache.hadoop.hbase.TableName tn
public org.junit.rules.ExpectedException exception
public TestImportTsv()
public org.apache.hadoop.conf.Configuration getConf()
getConf in interface org.apache.hadoop.conf.Configurablepublic void setConf(org.apache.hadoop.conf.Configuration conf)
setConf in interface org.apache.hadoop.conf.Configurablepublic static void provisionCluster() throws Exception
Exceptionpublic static void releaseCluster() throws Exception
Exceptionpublic void testMROnTable() throws Exception
Exceptionpublic void testMROnTableWithTimestamp() throws Exception
Exceptionpublic void testMROnTableWithCustomMapper() throws Exception
Exceptionpublic void testBulkOutputWithoutAnExistingTable() throws Exception
Exceptionpublic void testBulkOutputWithAnExistingTable() throws Exception
Exceptionpublic void testBulkOutputWithAnExistingTableNoStrictTrue() throws Exception
Exceptionpublic void testJobConfigurationsWithTsvImporterTextMapper() throws Exception
Exceptionpublic void testBulkOutputWithTsvImporterTextMapper() throws Exception
Exceptionpublic void testWithoutAnExistingTableAndCreateTableSetToNo() throws Exception
Exceptionpublic void testMRWithoutAnExistingTable() throws Exception
Exceptionpublic void testJobConfigurationsWithDryMode() throws Exception
Exceptionpublic void testDryModeWithoutBulkOutputAndTableExists() throws Exception
Exceptionpublic void testDryModeWithoutBulkOutputAndTableDoesNotExists() throws Exception
Exceptionpublic void testDryModeWithBulkOutputAndTableExists() throws Exception
Exceptionpublic void testDryModeWithBulkOutputAndTableDoesNotExistsCreateTableSetToNo() throws Exception
Exceptionpublic void testDryModeWithBulkModeAndTableDoesNotExistsCreateTableSetToYes() throws Exception
Exceptionpublic void testTsvImporterTextMapperWithInvalidData() throws Exception
Exceptionpublic void testSkipEmptyColumns() throws Exception
Exceptionprivate org.apache.hadoop.util.Tool doMROnTableTest(String data, int valueMultiplier) throws Exception
Exceptionprotected static org.apache.hadoop.util.Tool doMROnTableTest(HBaseTestingUtility util, org.apache.hadoop.hbase.TableName table, String family, String data, Map<String,String> args) throws Exception
Exceptionprotected static org.apache.hadoop.util.Tool doMROnTableTest(HBaseTestingUtility util, org.apache.hadoop.hbase.TableName table, String family, String data, Map<String,String> args, int valueMultiplier, int expectedKVCount) throws Exception
Tool instance so that other tests can
inspect it for further validation as necessary. This method is static to
insure non-reliance on instance's util/conf facilities.args - Any arguments to pass BEFORE inputFile path is appended.Exceptionprivate static void validateTable(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.TableName tableName, String family, int valueMultiplier, boolean isDryRun) throws IOException
IOExceptionprivate static void validateHFiles(org.apache.hadoop.fs.FileSystem fs, String outputPath, String family, int expectedKVCount) throws IOException
IOExceptionprivate static int getKVCountFromHfile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path p) throws IOException
fs - File Systemp - HFile pathIOExceptionCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.