Class TestTableInputFormat
java.lang.Object
org.apache.hadoop.hbase.mapreduce.TestTableInputFormat
This tests the TableInputFormat and its recovery semantics
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
static class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static final byte[][]
(package private) static final byte[]
private static final org.slf4j.Logger
private static org.apache.hadoop.mapred.MiniMRCluster
private static final HBaseTestingUtil
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
void
before()
static void
(package private) static boolean
checkResult
(org.apache.hadoop.hbase.client.Result r, org.apache.hadoop.hbase.io.ImmutableBytesWritable key, byte[] expectedKey, byte[] expectedValue) Verify that the result and key have expected values.(package private) static org.apache.hadoop.hbase.client.Table
createDNRIOEScannerTable
(byte[] name, int failCnt) Create a table that throws a NotServingRegionException on first scanner next call(package private) static org.apache.hadoop.hbase.client.Table
createIOEScannerTable
(byte[] name, int failCnt) Create a table that IOE's on first scanner next callstatic org.apache.hadoop.hbase.client.Table
createTable
(byte[] tableName) Setup a table with two rows and values.static org.apache.hadoop.hbase.client.Table
createTable
(byte[] tableName, byte[][] families) Setup a table with two rows and values per column family.(package private) static void
runTestMapreduce
(org.apache.hadoop.hbase.client.Table table) Create table data and run tests on specified htable using the o.a.h.hbase.mapreduce API.void
void
Verify the example we present in javadocs on TableInputFormatBase(package private) void
testInputFormat
(Class<? extends org.apache.hadoop.mapreduce.InputFormat> clazz) void
void
Run test assuming no errors using newer mapreduce apivoid
Run test assuming Scanner IOException failure using newer mapreduce apivoid
Run test assuming Scanner IOException failure using newer mapreduce apivoid
Run test assuming NotServingRegionException using newer mapreduce apivoid
Run test assuming NotServingRegionException using newer mapreduce api
-
Field Details
-
CLASS_RULE
-
LOG
-
UTIL
-
mrCluster
-
FAMILY
-
columns
-
-
Constructor Details
-
TestTableInputFormat
public TestTableInputFormat()
-
-
Method Details
-
beforeClass
- Throws:
Exception
-
afterClass
- Throws:
Exception
-
before
- Throws:
IOException
-
createTable
Setup a table with two rows and values.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
createTable
public static org.apache.hadoop.hbase.client.Table createTable(byte[] tableName, byte[][] families) throws IOException Setup a table with two rows and values per column family.- Returns:
- A Table instance for the created table.
- Throws:
IOException
-
checkResult
static boolean checkResult(org.apache.hadoop.hbase.client.Result r, org.apache.hadoop.hbase.io.ImmutableBytesWritable key, byte[] expectedKey, byte[] expectedValue) Verify that the result and key have expected values.- Parameters:
r
- single row resultkey
- the row keyexpectedKey
- the expected keyexpectedValue
- the expected value- Returns:
- true if the result contains the expected key and value, false otherwise.
-
runTestMapreduce
static void runTestMapreduce(org.apache.hadoop.hbase.client.Table table) throws IOException, InterruptedException Create table data and run tests on specified htable using the o.a.h.hbase.mapreduce API.- Throws:
IOException
InterruptedException
-
createIOEScannerTable
static org.apache.hadoop.hbase.client.Table createIOEScannerTable(byte[] name, int failCnt) throws IOException Create a table that IOE's on first scanner next call- Throws:
IOException
-
createDNRIOEScannerTable
static org.apache.hadoop.hbase.client.Table createDNRIOEScannerTable(byte[] name, int failCnt) throws IOException Create a table that throws a NotServingRegionException on first scanner next call- Throws:
IOException
-
testTableRecordReaderMapreduce
Run test assuming no errors using newer mapreduce api- Throws:
IOException
InterruptedException
-
testTableRecordReaderScannerFailMapreduce
Run test assuming Scanner IOException failure using newer mapreduce api- Throws:
IOException
InterruptedException
-
testTableRecordReaderScannerFailMapreduceTwice
public void testTableRecordReaderScannerFailMapreduceTwice() throws IOException, InterruptedExceptionRun test assuming Scanner IOException failure using newer mapreduce api- Throws:
IOException
InterruptedException
-
testTableRecordReaderScannerTimeoutMapreduce
Run test assuming NotServingRegionException using newer mapreduce api- Throws:
IOException
InterruptedException
-
testTableRecordReaderScannerTimeoutMapreduceTwice
public void testTableRecordReaderScannerTimeoutMapreduceTwice() throws IOException, InterruptedExceptionRun test assuming NotServingRegionException using newer mapreduce api- Throws:
IOException
InterruptedException
-
testExtensionOfTableInputFormatBase
public void testExtensionOfTableInputFormatBase() throws IOException, InterruptedException, ClassNotFoundExceptionVerify the example we present in javadocs on TableInputFormatBase -
testJobConfigurableExtensionOfTableInputFormatBase
public void testJobConfigurableExtensionOfTableInputFormatBase() throws IOException, InterruptedException, ClassNotFoundException -
testDeprecatedExtensionOfTableInputFormatBase
public void testDeprecatedExtensionOfTableInputFormatBase() throws IOException, InterruptedException, ClassNotFoundException -
testInputFormat
void testInputFormat(Class<? extends org.apache.hadoop.mapreduce.InputFormat> clazz) throws IOException, InterruptedException, ClassNotFoundException
-