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.Configurable
public void setConf(org.apache.hadoop.conf.Configuration conf)
setConf
in interface org.apache.hadoop.conf.Configurable
public static void provisionCluster() throws Exception
Exception
public static void releaseCluster() throws Exception
Exception
public void testMROnTable() throws Exception
Exception
public void testMROnTableWithTimestamp() throws Exception
Exception
public void testMROnTableWithCustomMapper() throws Exception
Exception
public void testBulkOutputWithoutAnExistingTable() throws Exception
Exception
public void testBulkOutputWithAnExistingTable() throws Exception
Exception
public void testBulkOutputWithAnExistingTableNoStrictTrue() throws Exception
Exception
public void testJobConfigurationsWithTsvImporterTextMapper() throws Exception
Exception
public void testBulkOutputWithTsvImporterTextMapper() throws Exception
Exception
public void testWithoutAnExistingTableAndCreateTableSetToNo() throws Exception
Exception
public void testMRWithoutAnExistingTable() throws Exception
Exception
public void testJobConfigurationsWithDryMode() throws Exception
Exception
public void testDryModeWithoutBulkOutputAndTableExists() throws Exception
Exception
public void testDryModeWithoutBulkOutputAndTableDoesNotExists() throws Exception
Exception
public void testDryModeWithBulkOutputAndTableExists() throws Exception
Exception
public void testDryModeWithBulkOutputAndTableDoesNotExistsCreateTableSetToNo() throws Exception
Exception
public void testDryModeWithBulkModeAndTableDoesNotExistsCreateTableSetToYes() throws Exception
Exception
public void testTsvImporterTextMapperWithInvalidData() throws Exception
Exception
public void testSkipEmptyColumns() throws Exception
Exception
private org.apache.hadoop.util.Tool doMROnTableTest(String data, int valueMultiplier) throws Exception
Exception
protected 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
Exception
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) 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.Exception
private static void validateTable(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.TableName tableName, String family, int valueMultiplier, boolean isDryRun) throws IOException
IOException
private static void validateHFiles(org.apache.hadoop.fs.FileSystem fs, String outputPath, String family, int expectedKVCount) throws IOException
IOException
private static int getKVCountFromHfile(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path p) throws IOException
fs
- File Systemp
- HFile pathIOException
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.