Class TestTableInputFormat
java.lang.Object
org.apache.hadoop.hbase.mapreduce.TestTableInputFormat
This tests the TableInputFormat and its recovery semantics
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRuleprivate static final byte[][](package private) static final byte[]private static final org.slf4j.Loggerprivate static org.apache.hadoop.mapred.MiniMRClusterprivate static final HBaseTestingUtil -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidvoidbefore()static void(package private) static booleancheckResult(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.TablecreateDNRIOEScannerTable(byte[] name, int failCnt) Create a table that throws a NotServingRegionException on first scanner next call(package private) static org.apache.hadoop.hbase.client.TablecreateIOEScannerTable(byte[] name, int failCnt) Create a table that IOE's on first scanner next callstatic org.apache.hadoop.hbase.client.TablecreateTable(byte[] tableName) Setup a table with two rows and values.static org.apache.hadoop.hbase.client.TablecreateTable(byte[] tableName, byte[][] families) Setup a table with two rows and values per column family.(package private) static voidrunTestMapreduce(org.apache.hadoop.hbase.client.Table table) Create table data and run tests on specified htable using the o.a.h.hbase.mapreduce API.voidvoidVerify the example we present in javadocs on TableInputFormatBase(package private) voidtestInputFormat(Class<? extends org.apache.hadoop.mapreduce.InputFormat> clazz) voidvoidRun test assuming no errors using newer mapreduce apivoidRun test assuming Scanner IOException failure using newer mapreduce apivoidRun test assuming Scanner IOException failure using newer mapreduce apivoidRun test assuming NotServingRegionException using newer mapreduce apivoidRun 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:
IOExceptionInterruptedException
-
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:
IOExceptionInterruptedException
-
testTableRecordReaderScannerFailMapreduce
Run test assuming Scanner IOException failure using newer mapreduce api- Throws:
IOExceptionInterruptedException
-
testTableRecordReaderScannerFailMapreduceTwice
public void testTableRecordReaderScannerFailMapreduceTwice() throws IOException, InterruptedExceptionRun test assuming Scanner IOException failure using newer mapreduce api- Throws:
IOExceptionInterruptedException
-
testTableRecordReaderScannerTimeoutMapreduce
Run test assuming NotServingRegionException using newer mapreduce api- Throws:
IOExceptionInterruptedException
-
testTableRecordReaderScannerTimeoutMapreduceTwice
public void testTableRecordReaderScannerTimeoutMapreduceTwice() throws IOException, InterruptedExceptionRun test assuming NotServingRegionException using newer mapreduce api- Throws:
IOExceptionInterruptedException
-
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
-