Class TestRowCounter
java.lang.Object
org.apache.hadoop.hbase.mapreduce.TestRowCounter
Test the rowcounter map reduce job.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRuleprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final org.slf4j.Loggerprivate static final intprivate static final Stringprivate static final Stringprivate static final HBaseTestingUtilityprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidassertUsageContent(String usage) private voidrunCreateSubmittableJobWithArgs(String[] args, int expectedCount) Run the RowCounter map reduce job and verify the row count.private voidrunRowCount(String[] args, int expectedCount) Run the RowCounter map reduce job and verify the row count.static voidstatic voidvoidvoidTest a case when the column specified in command line arguments is exclusive for few rows and also a row range filter is specifiedvoidTest a case when the column specified in command line arguments is one for which the qualifier contains colons.voidTest a case when the column specified in command line arguments is exclusive for few rows.voidTest a case when the column specified in command line arguments is not part of first KV for a row.voidvoidTest a case when a range is specified with multiple ranges of start-end keys; one range is filled, another two are notvoidTest a case when a range is specified with multiple ranges of start-end keysvoidTest a case when a range is specified with two ranges where one range is with end key onlyvoidTest a case when a range is specified with single range of start-end keysvoidTest a case when a range is specified with single range with end key onlyvoidTest a case when the timerange is specified with --starttime and --endtime optionsvoidtestHelp()voidtest main method.voidvoidvoidTest a case when the column specified in command line arguments is exclusive for few rows and also a row range filter is specifiedvoidTest a case when the column specified in command line arguments is one for which the qualifier contains colons.voidTest a case when the column specified in command line arguments is exclusive for few rows.voidTest a case when the column specified in command line arguments is not part of first KV for a row.voidTest a case when no column was specified in command line arguments.voidTest a case when a range is specified with multiple ranges of start-end keys; one range is filled, another two are notvoidTest a case when a range is specified with multiple ranges of start-end keysvoidTest a case when a range is specified with two ranges where one range is with end key onlyvoidTest a case when a range is specified with single range of start-end keysvoidTest a case when a range is specified with single range with end key onlyvoidTest a case when the timerange is specified with --starttime and --endtime optionsprivate static voidwriteRows(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
-