Class TestRowCounter
java.lang.Object
org.apache.hadoop.hbase.mapreduce.TestRowCounter
Test the rowcounter map reduce job.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static final String
private static final String
private static final String
private static final String
private static final org.slf4j.Logger
private static final int
private static final String
private static final String
private static final HBaseTestingUtil
private static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate 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
static void
void
void
Test a case when the column specified in command line arguments is exclusive for few rows and also a row range filter is specifiedvoid
Test a case when the column specified in command line arguments is one for which the qualifier contains colons.void
Test a case when the column specified in command line arguments is exclusive for few rows.void
Test a case when the column specified in command line arguments is not part of first KV for a row.void
void
Test a case when a range is specified with multiple ranges of start-end keys; one range is filled, another two are notvoid
Test a case when a range is specified with multiple ranges of start-end keysvoid
Test a case when a range is specified with two ranges where one range is with end key onlyvoid
Test a case when a range is specified with single range of start-end keysvoid
Test a case when a range is specified with single range with end key onlyvoid
Test a case when the timerange is specified with --starttime and --endtime optionsvoid
testHelp()
void
test main method.void
void
void
Test a case when the column specified in command line arguments is exclusive for few rows and also a row range filter is specifiedvoid
Test a case when the column specified in command line arguments is one for which the qualifier contains colons.void
Test a case when the column specified in command line arguments is exclusive for few rows.void
Test a case when the column specified in command line arguments is not part of first KV for a row.void
Test a case when no column was specified in command line arguments.void
Test a case when a range is specified with multiple ranges of start-end keys; one range is filled, another two are notvoid
Test a case when a range is specified with multiple ranges of start-end keysvoid
Test a case when a range is specified with two ranges where one range is with end key onlyvoid
Test a case when a range is specified with single range of start-end keysvoid
Test a case when a range is specified with single range with end key onlyvoid
Test a case when the timerange is specified with --starttime and --endtime optionsprivate 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.
-
Field Details
-
CLASS_RULE
-
LOG
-
TEST_UTIL
-
TABLE_NAME
- See Also:
-
TABLE_NAME_TS_RANGE
- See Also:
-
COL_FAM
- See Also:
-
COL1
- See Also:
-
COL2
- See Also:
-
COMPOSITE_COLUMN
- See Also:
-
TOTAL_ROWS
- See Also:
-
ROWS_WITH_ONE_COL
- See Also:
-
-
Constructor Details
-
TestRowCounter
public TestRowCounter()
-
-
Method Details
-
setUpBeforeClass
- Throws:
Exception
-
tearDownAfterClass
- Throws:
Exception
-
testRowCounterNoColumn
Test a case when no column was specified in command line arguments.- Throws:
Exception
-
testRowCounterExclusiveColumn
Test a case when the column specified in command line arguments is exclusive for few rows.- Throws:
Exception
-
testRowCounterColumnWithColonInQualifier
Test a case when the column specified in command line arguments is one for which the qualifier contains colons.- Throws:
Exception
-
testRowCounterHiddenColumn
Test a case when the column specified in command line arguments is not part of first KV for a row.- Throws:
Exception
-
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- Throws:
Exception
-
testRowCounterRowSingleRange
Test a case when a range is specified with single range of start-end keys- Throws:
Exception
-
testRowCounterRowSingleRangeUpperBound
Test a case when a range is specified with single range with end key only- Throws:
Exception
-
testRowCounterRowMultiRangeUpperBound
Test a case when a range is specified with two ranges where one range is with end key only- Throws:
Exception
-
testRowCounterRowMultiRange
Test a case when a range is specified with multiple ranges of start-end keys- Throws:
Exception
-
testRowCounterRowMultiEmptyRange
Test a case when a range is specified with multiple ranges of start-end keys; one range is filled, another two are not- Throws:
Exception
-
testRowCounter10kRowRange
- Throws:
Exception
-
testRowCounterTimeRange
Test a case when the timerange is specified with --starttime and --endtime options- Throws:
Exception
-
runRowCount
Run the RowCounter map reduce job and verify the row count.- Parameters:
args
- the command line arguments to be used for rowcounter job.expectedCount
- the expected row count (result of map reduce job).- Throws:
Exception
-
runCreateSubmittableJobWithArgs
Run the RowCounter map reduce job and verify the row count.- Parameters:
args
- the command line arguments to be used for rowcounter job.expectedCount
- the expected row count (result of map reduce job).- Throws:
Exception
- in case of any unexpected error.
-
testCreateSubmittableJobWithArgsNoColumn
- Throws:
Exception
-
testCreateSubmittableJobWithArgsExclusiveColumn
Test a case when the column specified in command line arguments is exclusive for few rows.- Throws:
Exception
- in case of any unexpected error.
-
testCreateSubmittableJobWithArgsColumnWithColonInQualifier
Test a case when the column specified in command line arguments is one for which the qualifier contains colons.- Throws:
Exception
- in case of any unexpected error.
-
testCreateSubmittableJobWithArgsHiddenColumn
Test a case when the column specified in command line arguments is not part of first KV for a row.- Throws:
Exception
- in case of any unexpected error.
-
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- Throws:
Exception
- in case of any unexpected error.
-
testCreateSubmittableJobWithArgsRowSingleRange
Test a case when a range is specified with single range of start-end keys- Throws:
Exception
- in case of any unexpected error.
-
testCreateSubmittableJobWithArgsRowSingleRangeUpperBound
Test a case when a range is specified with single range with end key only- Throws:
Exception
- in case of any unexpected error.
-
testCreateSubmittableJobWithArgsRowMultiRangeUpperBound
Test a case when a range is specified with two ranges where one range is with end key only- Throws:
Exception
- in case of any unexpected error.
-
testCreateSubmittableJobWithArgsRowMultiRange
Test a case when a range is specified with multiple ranges of start-end keys- Throws:
Exception
- in case of any unexpected error.
-
testCreateSubmittableJobWithArgsRowMultiEmptyRange
Test a case when a range is specified with multiple ranges of start-end keys; one range is filled, another two are not- Throws:
Exception
- in case of any unexpected error.
-
testCreateSubmittableJobWithArgs10kRowRange
- Throws:
Exception
-
testCreateSubmittableJobWithArgsTimeRange
Test a case when the timerange is specified with --starttime and --endtime options- Throws:
Exception
- in case of any unexpected error.
-
writeRows
private static void writeRows(org.apache.hadoop.hbase.client.Table table, int totalRows, int rowsWithOneCol) throws IOException Writes TOTAL_ROWS number of distinct rows in to the table. Few rows have two columns, Few have one.- Throws:
IOException
-
testImportMain
test main method. Import should print help and call System.exit- Throws:
Exception
-
testHelp
- Throws:
Exception
-
testInvalidTable
- Throws:
Exception
-
assertUsageContent
-