public class TestRowCounter extends Object
| Modifier and Type | Field and Description |
|---|---|
static HBaseClassTestRule |
CLASS_RULE |
private static String |
COL_FAM |
private static String |
COL1 |
private static String |
COL2 |
private static String |
COMPOSITE_COLUMN |
private static org.slf4j.Logger |
LOG |
private static int |
ROWS_WITH_ONE_COL |
private static String |
TABLE_NAME |
private static String |
TABLE_NAME_TS_RANGE |
private static HBaseTestingUtility |
TEST_UTIL |
private static int |
TOTAL_ROWS |
| Constructor and Description |
|---|
TestRowCounter() |
| Modifier and Type | Method and Description |
|---|---|
private void |
assertUsageContent(String usage) |
private void |
runCreateSubmittableJobWithArgs(String[] args,
int expectedCount)
Run the RowCounter map reduce job and verify the row count.
|
private void |
runRowCount(String[] args,
int expectedCount)
Run the RowCounter map reduce job and verify the row count.
|
static void |
setUpBeforeClass() |
static void |
tearDownAfterClass() |
void |
testCreateSubmittableJobWithArgs10kRowRange() |
void |
testCreateSubmittableJobWithArgsColumnAndRowRange()
Test a case when the column specified in command line arguments is
exclusive for few rows and also a row range filter is specified
|
void |
testCreateSubmittableJobWithArgsColumnWithColonInQualifier()
Test a case when the column specified in command line arguments is
one for which the qualifier contains colons.
|
void |
testCreateSubmittableJobWithArgsExclusiveColumn()
Test a case when the column specified in command line arguments is
exclusive for few rows.
|
void |
testCreateSubmittableJobWithArgsHiddenColumn()
Test a case when the column specified in command line arguments is not part
of first KV for a row.
|
void |
testCreateSubmittableJobWithArgsNoColumn() |
void |
testCreateSubmittableJobWithArgsRowMultiEmptyRange()
Test a case when a range is specified with multiple ranges of start-end keys;
one range is filled, another two are not
|
void |
testCreateSubmittableJobWithArgsRowMultiRange()
Test a case when a range is specified with multiple ranges of start-end keys
|
void |
testCreateSubmittableJobWithArgsRowMultiRangeUpperBound()
Test a case when a range is specified with two ranges where one range is with end key only
|
void |
testCreateSubmittableJobWithArgsRowSingleRange()
Test a case when a range is specified with single range of start-end keys
|
void |
testCreateSubmittableJobWithArgsRowSingleRangeUpperBound()
Test a case when a range is specified with single range with end key only
|
void |
testCreateSubmittableJobWithArgsTimeRange()
Test a case when the timerange is specified with --starttime and --endtime options
|
void |
testHelp() |
void |
testImportMain()
test main method.
|
void |
testInvalidTable() |
void |
testRowCounter10kRowRange() |
void |
testRowCounterColumnAndRowRange()
Test a case when the column specified in command line arguments is
exclusive for few rows and also a row range filter is specified
|
void |
testRowCounterColumnWithColonInQualifier()
Test a case when the column specified in command line arguments is
one for which the qualifier contains colons.
|
void |
testRowCounterExclusiveColumn()
Test a case when the column specified in command line arguments is
exclusive for few rows.
|
void |
testRowCounterHiddenColumn()
Test a case when the column specified in command line arguments is not part
of first KV for a row.
|
void |
testRowCounterNoColumn()
Test a case when no column was specified in command line arguments.
|
void |
testRowCounterRowMultiEmptyRange()
Test a case when a range is specified with multiple ranges of start-end keys;
one range is filled, another two are not
|
void |
testRowCounterRowMultiRange()
Test a case when a range is specified with multiple ranges of start-end keys
|
void |
testRowCounterRowMultiRangeUpperBound()
Test a case when a range is specified with two ranges where one range is with end key only
|
void |
testRowCounterRowSingleRange()
Test a case when a range is specified with single range of start-end keys
|
void |
testRowCounterRowSingleRangeUpperBound()
Test a case when a range is specified with single range with end key only
|
void |
testRowCounterTimeRange()
Test a case when the timerange is specified with --starttime and --endtime options
|
private static void |
writeRows(org.apache.hadoop.hbase.client.Table table,
int totalRows,
int rowsWithOneCol)
Writes TOTAL_ROWS number of distinct rows in to the table.
|
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private static final HBaseTestingUtility TEST_UTIL
private static final String TABLE_NAME
private static final String TABLE_NAME_TS_RANGE
private static final String COL_FAM
private static final String COL1
private static final String COL2
private static final String COMPOSITE_COLUMN
private static final int TOTAL_ROWS
private static final int ROWS_WITH_ONE_COL
public TestRowCounter()
public static void setUpBeforeClass() throws Exception
Exceptionpublic static void tearDownAfterClass() throws Exception
Exceptionpublic void testRowCounterNoColumn() throws Exception
Exceptionpublic void testRowCounterExclusiveColumn() throws Exception
Exceptionpublic void testRowCounterColumnWithColonInQualifier() throws Exception
Exceptionpublic void testRowCounterHiddenColumn() throws Exception
Exceptionpublic void testRowCounterColumnAndRowRange() throws Exception
Exceptionpublic void testRowCounterRowSingleRange() throws Exception
Exceptionpublic void testRowCounterRowSingleRangeUpperBound() throws Exception
Exceptionpublic void testRowCounterRowMultiRangeUpperBound() throws Exception
Exceptionpublic void testRowCounterRowMultiRange() throws Exception
Exceptionpublic void testRowCounterRowMultiEmptyRange() throws Exception
Exceptionpublic void testRowCounter10kRowRange() throws Exception
Exceptionpublic void testRowCounterTimeRange() throws Exception
Exceptionprivate void runRowCount(String[] args, int expectedCount) throws Exception
args - the command line arguments to be used for rowcounter job.expectedCount - the expected row count (result of map reduce job).Exceptionprivate void runCreateSubmittableJobWithArgs(String[] args, int expectedCount) throws Exception
args - the command line arguments to be used for rowcounter job.expectedCount - the expected row count (result of map reduce job).Exception - in case of any unexpected error.public void testCreateSubmittableJobWithArgsNoColumn() throws Exception
Exceptionpublic void testCreateSubmittableJobWithArgsExclusiveColumn() throws Exception
Exception - in case of any unexpected error.public void testCreateSubmittableJobWithArgsColumnWithColonInQualifier() throws Exception
Exception - in case of any unexpected error.public void testCreateSubmittableJobWithArgsHiddenColumn() throws Exception
Exception - in case of any unexpected error.public void testCreateSubmittableJobWithArgsColumnAndRowRange() throws Exception
Exception - in case of any unexpected error.public void testCreateSubmittableJobWithArgsRowSingleRange() throws Exception
Exception - in case of any unexpected error.public void testCreateSubmittableJobWithArgsRowSingleRangeUpperBound() throws Exception
Exception - in case of any unexpected error.public void testCreateSubmittableJobWithArgsRowMultiRangeUpperBound() throws Exception
Exception - in case of any unexpected error.public void testCreateSubmittableJobWithArgsRowMultiRange() throws Exception
Exception - in case of any unexpected error.public void testCreateSubmittableJobWithArgsRowMultiEmptyRange() throws Exception
Exception - in case of any unexpected error.public void testCreateSubmittableJobWithArgs10kRowRange() throws Exception
Exceptionpublic void testCreateSubmittableJobWithArgsTimeRange() throws Exception
Exception - in case of any unexpected error.private static void writeRows(org.apache.hadoop.hbase.client.Table table, int totalRows, int rowsWithOneCol) throws IOException
table - IOExceptionpublic void testImportMain() throws Exception
Exceptionpublic void testInvalidTable() throws Exception
Exceptionprivate void assertUsageContent(String usage)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.