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 HBaseTestingUtilprivate 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 optionsvoidStep 1: Add 10 rows(row1, row2, row3, row4, row5, row6, row7, row8, row9, row10) to a table.private voidvalidateCounterCounts(org.apache.hadoop.mapreduce.Counters counters, long rowCount, long rowsWithDeleteMarkersCount, long deleteCount, long deleteColumnCount, long deleteFamilyCount, long deleteFamilyVersionCount) private 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
 - 
testRowCounterWithCountDeleteMarkersOption
Step 1: Add 10 rows(row1, row2, row3, row4, row5, row6, row7, row8, row9, row10) to a table. Each row contains 1 column family and 4 columns and values for two different timestamps - 5 & 10.Step 2: Delete the latest version of column A for row1. --> 1 X Delete
Step 3: Delete the cell for timestamp 5 of column B for row1. --> 1 X Delete
Step 4: Delete a column family for row2 and row4. --> 2 X DeleteFamily
Step 5: Delete all versions of a specific column for row3, row5 and row6. --> 3 X DeleteColumn
Step 6: Delete all columns for timestamp 5 for row 7. --> 1 X DeleteFamilyVersion
Case 1: Run row counter without countDeleteMarkers and validate counter values.
Case 2: Run row counter with countDeleteMarkers flag and validate counter values.
Case 3: Run row counter with countDeleteMarkers flag for a row range and validate counter values.
- Throws:
 Exception
 - 
validateCounterCounts
private void validateCounterCounts(org.apache.hadoop.mapreduce.Counters counters, long rowCount, long rowsWithDeleteMarkersCount, long deleteCount, long deleteColumnCount, long deleteFamilyCount, long deleteFamilyVersionCount)  - 
assertUsageContent
 
 -