Package org.apache.hadoop.hbase.client
Class TestAsyncProcessWithRegionException
java.lang.Object
org.apache.hadoop.hbase.client.TestAsyncProcessWithRegionException
The purpose of this test is to make sure the region exception won't corrupt the results of batch.
The prescription is shown below. 1) honor the action result rather than region exception. If the
action have both of true result and region exception, the action is fine as the exception is
caused by other actions which are in the same region. 2) honor the action exception rather than
region exception. If the action have both of action exception and region exception, we deal with
the action exception only. If we also handle the region exception for the same action, it will
introduce the negative count of actions in progress. The AsyncRequestFuture#waitUntilDone will
block forever. This bug can be reproduced by real use case. see TestMalformedCellFromClient(in
branch-1.4+). It uses the batch of RowMutations to present the bug. Given that the batch of
RowMutations is only supported by branch-1.4+, perhaps the branch-1.3 and branch-1.2 won't
encounter this issue. We still backport the fix to branch-1.3 and branch-1.2 in case we ignore
some write paths.
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final byte[]
private static final byte[]
static final HBaseClassTestRule
private static final org.apache.hadoop.conf.Configuration
private static final org.apache.hadoop.hbase.client.ConnectionConfiguration
private static final org.apache.hadoop.hbase.TableName
private static final org.apache.hadoop.hbase.client.Result
private static final byte[]
private static final byte[]
private static final IOException
private static final org.apache.hadoop.hbase.client.RegionInfo
private static final org.apache.hadoop.hbase.HRegionLocation
private static final org.apache.hadoop.hbase.ServerName
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static void
assertActionsInProgress
(org.apache.hadoop.hbase.client.AsyncRequestFuture arf) private static void
assertError
(org.apache.hadoop.hbase.client.AsyncRequestFuture arf, int expectedCountOfFailure) private static org.apache.hadoop.hbase.client.ClusterConnection
private static void
setMockLocation
(org.apache.hadoop.hbase.client.ClusterConnection hc, byte[] row, org.apache.hadoop.hbase.RegionLocations result) static void
void
void
void
-
Field Details
-
CLASS_RULE
-
EMPTY_RESULT
-
IOE
-
CONF
-
CONNECTION_CONFIG
-
DUMMY_TABLE
-
GOOD_ROW
-
BAD_ROW
-
BAD_ROW_WITHOUT_ACTION_EXCEPTION
-
FAMILY
-
SERVER_NAME
-
REGION_INFO
-
REGION_LOCATION
-
-
Constructor Details
-
TestAsyncProcessWithRegionException
public TestAsyncProcessWithRegionException()
-
-
Method Details
-
setUpBeforeClass
-
testSuccessivePut
- Throws:
Exception
-
testFailedPut
- Throws:
Exception
-
testFailedPutWithoutActionException
- Throws:
Exception
-
assertError
private static void assertError(org.apache.hadoop.hbase.client.AsyncRequestFuture arf, int expectedCountOfFailure) -
assertActionsInProgress
-
createHConnection
private static org.apache.hadoop.hbase.client.ClusterConnection createHConnection() throws IOException- Throws:
IOException
-
setMockLocation
private static void setMockLocation(org.apache.hadoop.hbase.client.ClusterConnection hc, byte[] row, org.apache.hadoop.hbase.RegionLocations result) throws IOException - Throws:
IOException
-