Class TestTableMapReduceBase
java.lang.Object
org.apache.hadoop.hbase.mapreduce.TestTableMapReduceBase
- Direct Known Subclasses:
TestTableMapReduce,TestTableMapReduce
A base class for a test Map/Reduce job over HBase tables. The map/reduce process we're testing on
our tables is simple - take every row in the table, reverse the value of a particular cell, and
write it back to the table. Implements common components between mapred and mapreduce
implementations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final byte[][]protected static final byte[]protected static final org.apache.hadoop.hbase.TableNameprotected static final byte[]protected static final org.apache.hadoop.hbase.TableNameprotected static final HBaseTestingUtil -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidprotected abstract org.slf4j.LoggergetLog()Retrieve my logger instance.protected static org.apache.hadoop.hbase.client.Putmap(org.apache.hadoop.hbase.io.ImmutableBytesWritable key, org.apache.hadoop.hbase.client.Result value) Implements mapper logic for use across APIs.protected abstract voidrunTestOnTable(org.apache.hadoop.hbase.client.Table table) Handles API-specifics for setting up and executing the job.voidvoidTest a map/reduce against a multi-region tableprotected voidverify(org.apache.hadoop.hbase.TableName tableName) private voidverifyAttempt(org.apache.hadoop.hbase.client.Table table) Looks at every value of the mapreduce output and verifies that indeed the values have been reversed.
-
Field Details
-
UTIL
-
MULTI_REGION_TABLE_NAME
-
TABLE_FOR_NEGATIVE_TESTS
-
INPUT_FAMILY
-
OUTPUT_FAMILY
-
columns
-
-
Constructor Details
-
TestTableMapReduceBase
public TestTableMapReduceBase()
-
-
Method Details
-
getLog
Retrieve my logger instance. -
runTestOnTable
protected abstract void runTestOnTable(org.apache.hadoop.hbase.client.Table table) throws IOException Handles API-specifics for setting up and executing the job.- Throws:
IOException
-
beforeClass
- Throws:
Exception
-
afterClass
- Throws:
Exception
-
testMultiRegionTable
Test a map/reduce against a multi-region table- Throws:
IOException
-
testCombiner
- Throws:
IOException
-
map
protected static org.apache.hadoop.hbase.client.Put map(org.apache.hadoop.hbase.io.ImmutableBytesWritable key, org.apache.hadoop.hbase.client.Result value) throws IOException Implements mapper logic for use across APIs.- Throws:
IOException
-
verify
- Throws:
IOException
-
verifyAttempt
private void verifyAttempt(org.apache.hadoop.hbase.client.Table table) throws IOException, NullPointerException Looks at every value of the mapreduce output and verifies that indeed the values have been reversed.- Parameters:
table- Table to scan.- Throws:
NullPointerException- if we failed to find a cell valueIOException
-