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
Nested ClassesModifier and TypeClassDescriptionprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]private static final byte[]static final HBaseClassTestRuleprivate static final org.apache.hadoop.conf.Configurationprivate static final org.apache.hadoop.hbase.client.ConnectionConfigurationprivate static final org.apache.hadoop.hbase.TableNameprivate static final org.apache.hadoop.hbase.client.Resultprivate static final byte[]private static final byte[]private static final IOExceptionprivate static final org.apache.hadoop.hbase.client.RegionInfoprivate static final org.apache.hadoop.hbase.HRegionLocationprivate static final org.apache.hadoop.hbase.ServerName -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidassertActionsInProgress(org.apache.hadoop.hbase.client.AsyncRequestFuture arf) private static voidassertError(org.apache.hadoop.hbase.client.AsyncRequestFuture arf, int expectedCountOfFailure) private static org.apache.hadoop.hbase.client.ClusterConnectionprivate static voidsetMockLocation(org.apache.hadoop.hbase.client.ClusterConnection hc, byte[] row, org.apache.hadoop.hbase.RegionLocations result) static voidvoidvoidvoid
-
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
-