Package org.apache.hadoop.hbase.client
Class TestAsyncProcess
java.lang.Object
org.apache.hadoop.hbase.client.TestAsyncProcess
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static class(package private) static class(package private) static classUsed to simulate the case where a RegionServer responds to a multi request, but some or all of the actions have an Exception instead of Result.(package private) static class(package private) static class(package private) static class(package private) static class(package private) static classMake the backoff time always different on each call.(package private) static classReturns our async process.(package private) static classReturns our async process.(package private) static classprivate static interfaceprivate static enumAfter reading TheDailyWtf, I always wanted to create a MyBoolean enum like this! -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRuleprivate org.apache.hadoop.conf.Configurationprivate org.apache.hadoop.hbase.client.ConnectionConfigurationprivate static final byte[]private static final byte[]private static final byte[]private static final org.apache.hadoop.hbase.TableNameprivate static final byte[]private static Exceptionprivate static final org.apache.hadoop.hbase.HRegionInfoprivate static final org.apache.hadoop.hbase.client.RegionInfoprivate static final org.apache.hadoop.hbase.client.RegionInfoprivate static final org.apache.hadoop.hbase.HRegionInfoprivate static final org.apache.hadoop.hbase.client.RegionInfoprivate static final org.apache.hadoop.hbase.HRegionInfoprivate static final org.apache.hadoop.hbase.RegionLocationsprivate static final org.apache.hadoop.hbase.RegionLocationsprivate static final org.apache.hadoop.hbase.RegionLocationsprivate static final org.apache.hadoop.hbase.HRegionLocationprivate static final org.apache.hadoop.hbase.HRegionLocationprivate static final org.apache.hadoop.hbase.HRegionLocationprivate static final org.slf4j.Loggerprivate static final intprivate intprivate intprivate static final org.apache.hadoop.hbase.ServerNameprivate static final org.apache.hadoop.hbase.ServerNameprivate static final org.apache.hadoop.hbase.ServerNameprivate static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate static longcalculateRequestCount(long putSizePerServer, long maxHeapSizePerRequest) private voidcheckPeriodicFlushParameters(org.apache.hadoop.hbase.client.ClusterConnection conn, TestAsyncProcess.MyAsyncProcess ap, long setTO, long expectTO, long setTT, long expectTT) private org.apache.hadoop.hbase.client.BufferedMutatorParamscreateBufferedMutatorParams(TestAsyncProcess.MyAsyncProcess ap, org.apache.hadoop.hbase.TableName name) private org.apache.hadoop.hbase.client.ClusterConnectionprivate org.apache.hadoop.hbase.client.ClusterConnectioncreateHConnection(org.apache.hadoop.hbase.client.ConnectionConfiguration configuration) private org.apache.hadoop.hbase.client.ClusterConnectioncreateHConnectionCommon(org.apache.hadoop.hbase.client.ConnectionConfiguration connectionConfiguration) private org.apache.hadoop.hbase.client.ClusterConnectioncreateHConnectionWithReplicas(org.apache.hadoop.hbase.client.ConnectionConfiguration configuration) (package private) static org.apache.hadoop.hbase.client.MultiResponsecreateMultiResponse(org.apache.hadoop.hbase.client.MultiAction multi, AtomicInteger nbMultiResponse, AtomicInteger nbActions, TestAsyncProcess.ResponseGenerator gen) private org.apache.hadoop.hbase.client.PutcreatePut(int regCnt, boolean success) createReplicaAp(int replicaAfterMs, int primaryMs, int replicaMs) createReplicaAp(int replicaAfterMs, int primaryMs, int replicaMs, int retries) private voiddoSubmitRequest(long maxHeapSizePerRequest, long putsHeapSize) private static List<org.apache.hadoop.hbase.client.Get>makeTimelineGets(byte[]... rows) private static voidsetMockLocation(org.apache.hadoop.hbase.client.ClusterConnection hc, byte[] row, org.apache.hadoop.hbase.RegionLocations result) voidvoidvoidvoidvoidvoidvoidtestFail()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidprivate voidtestRetryPause(org.apache.hadoop.conf.Configuration testConf, long expectedPause, org.apache.hadoop.hbase.HBaseIOException exception) voidprivate voidtestRetryPauseWhenServerIsOverloaded(org.apache.hadoop.hbase.HBaseServerException exception) voidvoidBelow tests make sure we could use a special pause setting when retry an exception whereHBaseServerException.isServerOverloaded(Throwable)is true, see HBASE-17114private voidtestRetryWithExceptionClearsMetaCache(boolean useRegionException) voidTests that we properly recover from exceptions that DO NOT go through receiveGlobalFailure, due to updating the meta cache for the region which failed.voidTests that we properly recover from exceptions that go through receiveGlobalFailure, due to updating the meta cache for the region which failed.voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidprivate voidvoidvoidvoidThis test simulates multiple regions on 2 servers.voidvoidprivate voidverifyReplicaResult(org.apache.hadoop.hbase.client.AsyncRequestFuture ars, TestAsyncProcess.RR... expecteds) private voidverifyResult(org.apache.hadoop.hbase.client.AsyncRequestFuture ars, boolean... expected)
-
Field Details
-
CLASS_RULE
-
LOG
-
DUMMY_TABLE
-
DUMMY_BYTES_1
-
DUMMY_BYTES_2
-
DUMMY_BYTES_3
-
FAILS
-
CONF
-
CONNECTION_CONFIG
-
sn
-
sn2
-
sn3
-
hri1
-
hri2
-
hri3
-
loc1
-
loc2
-
loc3
-
hri1r1
-
hri1r2
-
hri2r1
-
hrls1
-
hrls2
-
hrls3
-
success
- See Also:
-
failure
-
NB_RETRIES
- See Also:
-
RPC_TIMEOUT
-
OPERATION_TIMEOUT
-
-
Constructor Details
-
TestAsyncProcess
public TestAsyncProcess()
-
-
Method Details
-
beforeEach
-
createMultiResponse
static org.apache.hadoop.hbase.client.MultiResponse createMultiResponse(org.apache.hadoop.hbase.client.MultiAction multi, AtomicInteger nbMultiResponse, AtomicInteger nbActions, TestAsyncProcess.ResponseGenerator gen) -
testListRowAccess
-
calculateRequestCount
-
testSubmitSameSizeOfRequest
- Throws:
Exception
-
testSubmitLargeRequestWithUnlimitedSize
- Throws:
Exception
-
testSubmitRandomSizeRequest
- Throws:
Exception
-
testSubmitSmallRequest
- Throws:
Exception
-
testSubmitLargeRequest
- Throws:
Exception
-
doSubmitRequest
- Throws:
Exception
-
testSubmit
- Throws:
Exception
-
testSubmitWithCB
- Throws:
Exception
-
testSubmitBusyRegion
- Throws:
Exception
-
testSubmitBusyRegionServer
- Throws:
Exception
-
testFail
- Throws:
Exception
-
testSubmitTrue
- Throws:
IOException
-
testFailAndSuccess
- Throws:
Exception
-
testFlush
- Throws:
Exception
-
testTaskCountWithoutClientBackoffPolicy
- Throws:
IOExceptionInterruptedException
-
testTaskCountWithClientBackoffPolicy
- Throws:
IOExceptionInterruptedException
-
testTaskCount
private void testTaskCount(TestAsyncProcess.MyAsyncProcess ap) throws InterruptedIOException, InterruptedException -
testMaxTask
- Throws:
Exception
-
createHConnection
- Throws:
IOException
-
createHConnection
private org.apache.hadoop.hbase.client.ClusterConnection createHConnection(org.apache.hadoop.hbase.client.ConnectionConfiguration configuration) throws IOException - Throws:
IOException
-
createHConnectionWithReplicas
private org.apache.hadoop.hbase.client.ClusterConnection createHConnectionWithReplicas(org.apache.hadoop.hbase.client.ConnectionConfiguration configuration) 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
-
createHConnectionCommon
private org.apache.hadoop.hbase.client.ClusterConnection createHConnectionCommon(org.apache.hadoop.hbase.client.ConnectionConfiguration connectionConfiguration) -
testHTablePutSuccess
- Throws:
Exception
-
testSettingWriteBufferPeriodicFlushParameters
- Throws:
Exception
-
checkPeriodicFlushParameters
private void checkPeriodicFlushParameters(org.apache.hadoop.hbase.client.ClusterConnection conn, TestAsyncProcess.MyAsyncProcess ap, long setTO, long expectTO, long setTT, long expectTT) -
testWriteBufferPeriodicFlushTimeoutMs
- Throws:
Exception
-
testFailedPutAndNewPut
- Throws:
Exception
-
testAction
-
testBatch
- Throws:
IOExceptionInterruptedException
-
testErrorsServers
- Throws:
IOException
-
testReadAndWriteTimeout
- Throws:
IOException
-
testErrors
- Throws:
IOException
-
testCallQueueTooLarge
- Throws:
IOException
-
testThreadCreation
This test simulates multiple regions on 2 servers. We should have 2 multi requests and 2 threads: 1 per server, this whatever the number of regions.- Throws:
Exception
-
testReplicaReplicaSuccess
- Throws:
Exception
-
testReplicaPrimarySuccessWoReplicaCalls
- Throws:
Exception
-
testReplicaParallelCallsSucceed
- Throws:
Exception
-
testReplicaPartialReplicaCall
- Throws:
Exception
-
testReplicaMainFailsBeforeReplicaCalls
- Throws:
Exception
-
testReplicaReplicaSuccessWithParallelFailures
- Throws:
Exception
-
testReplicaAllCallsFailForOneRegion
- Throws:
Exception
-
createReplicaAp
private TestAsyncProcess.MyAsyncProcessWithReplicas createReplicaAp(int replicaAfterMs, int primaryMs, int replicaMs) throws Exception - Throws:
Exception
-
createReplicaAp
private TestAsyncProcess.MyAsyncProcessWithReplicas createReplicaAp(int replicaAfterMs, int primaryMs, int replicaMs, int retries) throws Exception - Throws:
Exception
-
createBufferedMutatorParams
private org.apache.hadoop.hbase.client.BufferedMutatorParams createBufferedMutatorParams(TestAsyncProcess.MyAsyncProcess ap, org.apache.hadoop.hbase.TableName name) -
makeTimelineGets
-
verifyResult
private void verifyResult(org.apache.hadoop.hbase.client.AsyncRequestFuture ars, boolean... expected) throws Exception - Throws:
Exception
-
verifyReplicaResult
private void verifyReplicaResult(org.apache.hadoop.hbase.client.AsyncRequestFuture ars, TestAsyncProcess.RR... expecteds) throws Exception - Throws:
Exception
-
createPut
- Parameters:
regCnt- the region: 1 to 3.success- if true, the put will succeed.- Returns:
- a put
-
testUncheckedException
- Throws:
Exception
-
testRetryPauseWhenServerOverloadedDueToCQTBE
Below tests make sure we could use a special pause setting when retry an exception whereHBaseServerException.isServerOverloaded(Throwable)is true, see HBASE-17114- Throws:
Exception
-
testRetryPauseWhenServerOverloadedDueToCDE
- Throws:
Exception
-
testRetryPauseForRpcThrottling
- Throws:
IOException
-
testRetryPauseWhenServerIsOverloaded
private void testRetryPauseWhenServerIsOverloaded(org.apache.hadoop.hbase.HBaseServerException exception) throws IOException - Throws:
IOException
-
testRetryPause
private void testRetryPause(org.apache.hadoop.conf.Configuration testConf, long expectedPause, org.apache.hadoop.hbase.HBaseIOException exception) throws IOException - Throws:
IOException
-
testFastFailIfBackoffGreaterThanRemaining
- Throws:
IOException
-
testRetryWithExceptionClearsMetaCacheUsingRegionException
Tests that we properly recover from exceptions that DO NOT go through receiveGlobalFailure, due to updating the meta cache for the region which failed. Successful multigets can include region exceptions in the MultiResponse. In that case, it skips receiveGlobalFailure and instead handles in receiveMultiAction- Throws:
Exception
-
testRetryWithExceptionClearsMetaCacheUsingServerException
Tests that we properly recover from exceptions that go through receiveGlobalFailure, due to updating the meta cache for the region which failed.- Throws:
Exception
-
testRetryWithExceptionClearsMetaCache
- Throws:
IOException
-
testQueueRowAccess
- Throws:
Exception
-