Package org.apache.hadoop.hbase.mapred
Class TestTableInputFormat
java.lang.Object
org.apache.hadoop.hbase.mapred.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 final HBaseTestingUtility
-
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 DoNoRetryIOException 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
runTestMapred
(org.apache.hadoop.hbase.client.Table table) Create table data and run tests on specified htable using the o.a.h.hbase.mapred API.void
void
Verify the example we present in javadocs on TableInputFormatBase(package private) void
testInputFormat
(Class<? extends org.apache.hadoop.mapred.InputFormat> clazz) void
void
Run test assuming no errors using mapred api.void
Run test assuming Scanner IOException failure using mapred api,void
Run test assuming Scanner IOException failure using mapred api,void
Run test assuming NotServingRegionException using mapred api.void
Run test assuming NotServingRegionException using mapred api.
-
Field Details
-
CLASS_RULE
-
LOG
-
UTIL
-
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.- Parameters:
tableName
- the name of the table to create- 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.
-
runTestMapred
Create table data and run tests on specified htable using the o.a.h.hbase.mapred API.- Throws:
IOException
-
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 DoNoRetryIOException on first scanner next call- Throws:
IOException
-
testTableRecordReader
Run test assuming no errors using mapred api.- Throws:
IOException
-
testTableRecordReaderScannerFail
Run test assuming Scanner IOException failure using mapred api,- Throws:
IOException
-
testTableRecordReaderScannerFailTwice
Run test assuming Scanner IOException failure using mapred api,- Throws:
IOException
-
testTableRecordReaderScannerTimeout
Run test assuming NotServingRegionException using mapred api.- Throws:
org.apache.hadoop.hbase.DoNotRetryIOException
IOException
-
testTableRecordReaderScannerTimeoutTwice
Run test assuming NotServingRegionException using mapred api.- Throws:
org.apache.hadoop.hbase.DoNotRetryIOException
IOException
-
testExtensionOfTableInputFormatBase
Verify the example we present in javadocs on TableInputFormatBase- Throws:
IOException
-
testDeprecatedExtensionOfTableInputFormatBase
- Throws:
IOException
-
testJobConfigurableExtensionOfTableInputFormatBase
- Throws:
IOException
-
testInputFormat
void testInputFormat(Class<? extends org.apache.hadoop.mapred.InputFormat> clazz) throws IOException - Throws:
IOException
-