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
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 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 DoNoRetryIOException 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 voidrunTestMapred(org.apache.hadoop.hbase.client.Table table) Create table data and run tests on specified htable using the o.a.h.hbase.mapred API.voidvoidVerify the example we present in javadocs on TableInputFormatBase(package private) voidtestInputFormat(Class<? extends org.apache.hadoop.mapred.InputFormat> clazz) voidvoidRun test assuming no errors using mapred api.voidRun test assuming Scanner IOException failure using mapred api,voidRun test assuming Scanner IOException failure using mapred api,voidRun test assuming NotServingRegionException using mapred api.voidRun 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.DoNotRetryIOExceptionIOException
-
testTableRecordReaderScannerTimeoutTwice
Run test assuming NotServingRegionException using mapred api.- Throws:
org.apache.hadoop.hbase.DoNotRetryIOExceptionIOException
-
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
-