public class TestAsyncProcess extends Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
TestAsyncProcess.AsyncProcessForThrowableCheck |
(package private) static class |
TestAsyncProcess.AsyncProcessWithFailure |
(package private) static class |
TestAsyncProcess.CallerWithFailure |
(package private) static class |
TestAsyncProcess.CountingThreadFactory |
(package private) static class |
TestAsyncProcess.MyAsyncProcess |
(package private) static class |
TestAsyncProcess.MyAsyncProcessWithReplicas |
(package private) static class |
TestAsyncProcess.MyAsyncRequestFutureImpl<Res> |
(package private) static class |
TestAsyncProcess.MyClientBackoffPolicy
Make the backoff time always different on each call.
|
(package private) static class |
TestAsyncProcess.MyConnectionImpl
Returns our async process.
|
(package private) static class |
TestAsyncProcess.MyConnectionImpl2
Returns our async process.
|
(package private) static class |
TestAsyncProcess.MyThreadPoolExecutor |
private static interface |
TestAsyncProcess.ResponseGenerator |
private static class |
TestAsyncProcess.RR
After reading TheDailyWtf, I always wanted to create a MyBoolean enum like this!
|
| Modifier and Type | Field and Description |
|---|---|
static HBaseClassTestRule |
CLASS_RULE |
private org.apache.hadoop.conf.Configuration |
CONF |
private org.apache.hadoop.hbase.client.ConnectionConfiguration |
CONNECTION_CONFIG |
private static byte[] |
DUMMY_BYTES_1 |
private static byte[] |
DUMMY_BYTES_2 |
private static byte[] |
DUMMY_BYTES_3 |
private static org.apache.hadoop.hbase.TableName |
DUMMY_TABLE |
private static byte[] |
FAILS |
private static Exception |
failure |
private static org.apache.hadoop.hbase.HRegionInfo |
hri1 |
private static org.apache.hadoop.hbase.client.RegionInfo |
hri1r1 |
private static org.apache.hadoop.hbase.client.RegionInfo |
hri1r2 |
private static org.apache.hadoop.hbase.HRegionInfo |
hri2 |
private static org.apache.hadoop.hbase.client.RegionInfo |
hri2r1 |
private static org.apache.hadoop.hbase.HRegionInfo |
hri3 |
private static org.apache.hadoop.hbase.RegionLocations |
hrls1 |
private static org.apache.hadoop.hbase.RegionLocations |
hrls2 |
private static org.apache.hadoop.hbase.RegionLocations |
hrls3 |
private static org.apache.hadoop.hbase.HRegionLocation |
loc1 |
private static org.apache.hadoop.hbase.HRegionLocation |
loc2 |
private static org.apache.hadoop.hbase.HRegionLocation |
loc3 |
private static org.slf4j.Logger |
LOG |
private static int |
NB_RETRIES |
private int |
OPERATION_TIMEOUT |
private int |
RPC_TIMEOUT |
private static org.apache.hadoop.hbase.ServerName |
sn |
private static org.apache.hadoop.hbase.ServerName |
sn2 |
private static org.apache.hadoop.hbase.ServerName |
sn3 |
private static String |
success |
| Constructor and Description |
|---|
TestAsyncProcess() |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeEach() |
private static long |
calculateRequestCount(long putSizePerServer,
long maxHeapSizePerRequest) |
private void |
checkPeriodicFlushParameters(org.apache.hadoop.hbase.client.ClusterConnection conn,
TestAsyncProcess.MyAsyncProcess ap,
long setTO,
long expectTO,
long setTT,
long expectTT) |
private org.apache.hadoop.hbase.client.BufferedMutatorParams |
createBufferedMutatorParams(TestAsyncProcess.MyAsyncProcess ap,
org.apache.hadoop.hbase.TableName name) |
private org.apache.hadoop.hbase.client.ClusterConnection |
createHConnection() |
private org.apache.hadoop.hbase.client.ClusterConnection |
createHConnectionCommon() |
private org.apache.hadoop.hbase.client.ClusterConnection |
createHConnectionWithReplicas() |
(package private) static org.apache.hadoop.hbase.client.MultiResponse |
createMultiResponse(org.apache.hadoop.hbase.client.MultiAction multi,
AtomicInteger nbMultiResponse,
AtomicInteger nbActions,
TestAsyncProcess.ResponseGenerator gen) |
private org.apache.hadoop.hbase.client.Put |
createPut(int regCnt,
boolean success) |
private TestAsyncProcess.MyAsyncProcessWithReplicas |
createReplicaAp(int replicaAfterMs,
int primaryMs,
int replicaMs) |
private TestAsyncProcess.MyAsyncProcessWithReplicas |
createReplicaAp(int replicaAfterMs,
int primaryMs,
int replicaMs,
int retries) |
private void |
doSubmitRequest(long maxHeapSizePerRequest,
long putsHeapSize) |
private static List<org.apache.hadoop.hbase.client.Get> |
makeTimelineGets(byte[]... rows) |
private static void |
setMockLocation(org.apache.hadoop.hbase.client.ClusterConnection hc,
byte[] row,
org.apache.hadoop.hbase.RegionLocations result) |
void |
testAction() |
void |
testBatch() |
void |
testBufferedMutatorImplWithSharedPool() |
void |
testCallQueueTooLarge() |
void |
testErrors() |
void |
testErrorsServers() |
void |
testFail() |
void |
testFailAndSuccess() |
void |
testFailedPutAndNewPut() |
void |
testFlush() |
void |
testHTablePutSuccess() |
void |
testListRowAccess() |
void |
testMaxTask() |
void |
testQueueRowAccess() |
void |
testReadAndWriteTimeout() |
void |
testReplicaAllCallsFailForOneRegion() |
void |
testReplicaMainFailsBeforeReplicaCalls() |
void |
testReplicaParallelCallsSucceed() |
void |
testReplicaPartialReplicaCall() |
void |
testReplicaPrimarySuccessWoReplicaCalls() |
void |
testReplicaReplicaSuccess() |
void |
testReplicaReplicaSuccessWithParallelFailures() |
void |
testRetryPauseWithCallQueueTooBigException()
Test and make sure we could use a special pause setting when retry with
CallQueueTooBigException, see HBASE-17114
|
void |
testRetryWithExceptionClearsMetaCache() |
void |
testSettingWriteBufferPeriodicFlushParameters() |
void |
testSubmit() |
void |
testSubmitBusyRegion() |
void |
testSubmitBusyRegionServer() |
void |
testSubmitLargeRequest() |
void |
testSubmitLargeRequestWithUnlimitedSize() |
void |
testSubmitRandomSizeRequest() |
void |
testSubmitSameSizeOfRequest() |
void |
testSubmitSmallRequest() |
void |
testSubmitTrue() |
void |
testSubmitWithCB() |
private void |
testTaskCount(TestAsyncProcess.MyAsyncProcess ap) |
void |
testTaskCountWithClientBackoffPolicy() |
void |
testTaskCountWithoutClientBackoffPolicy() |
void |
testThreadCreation()
This test simulates multiple regions on 2 servers.
|
void |
testUncheckedException() |
void |
testWriteBufferPeriodicFlushTimeoutMs() |
private void |
verifyReplicaResult(org.apache.hadoop.hbase.client.AsyncRequestFuture ars,
TestAsyncProcess.RR... expecteds) |
private void |
verifyResult(org.apache.hadoop.hbase.client.AsyncRequestFuture ars,
boolean... expected) |
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private static final org.apache.hadoop.hbase.TableName DUMMY_TABLE
private static final byte[] DUMMY_BYTES_1
private static final byte[] DUMMY_BYTES_2
private static final byte[] DUMMY_BYTES_3
private static final byte[] FAILS
private org.apache.hadoop.conf.Configuration CONF
private org.apache.hadoop.hbase.client.ConnectionConfiguration CONNECTION_CONFIG
private static final org.apache.hadoop.hbase.ServerName sn
private static final org.apache.hadoop.hbase.ServerName sn2
private static final org.apache.hadoop.hbase.ServerName sn3
private static final org.apache.hadoop.hbase.HRegionInfo hri1
private static final org.apache.hadoop.hbase.HRegionInfo hri2
private static final org.apache.hadoop.hbase.HRegionInfo hri3
private static final org.apache.hadoop.hbase.HRegionLocation loc1
private static final org.apache.hadoop.hbase.HRegionLocation loc2
private static final org.apache.hadoop.hbase.HRegionLocation loc3
private static final org.apache.hadoop.hbase.client.RegionInfo hri1r1
private static final org.apache.hadoop.hbase.client.RegionInfo hri1r2
private static final org.apache.hadoop.hbase.client.RegionInfo hri2r1
private static final org.apache.hadoop.hbase.RegionLocations hrls1
private static final org.apache.hadoop.hbase.RegionLocations hrls2
private static final org.apache.hadoop.hbase.RegionLocations hrls3
private static final String success
private static final int NB_RETRIES
private int RPC_TIMEOUT
private int OPERATION_TIMEOUT
public TestAsyncProcess()
public void beforeEach()
static org.apache.hadoop.hbase.client.MultiResponse createMultiResponse(org.apache.hadoop.hbase.client.MultiAction multi, AtomicInteger nbMultiResponse, AtomicInteger nbActions, TestAsyncProcess.ResponseGenerator gen)
public void testListRowAccess()
private static long calculateRequestCount(long putSizePerServer, long maxHeapSizePerRequest)
public void testSubmitSameSizeOfRequest() throws Exception
Exceptionpublic void testSubmitLargeRequestWithUnlimitedSize() throws Exception
Exceptionpublic void testSubmitRandomSizeRequest() throws Exception
Exceptionpublic void testSubmitSmallRequest() throws Exception
Exceptionpublic void testSubmitLargeRequest() throws Exception
Exceptionprivate void doSubmitRequest(long maxHeapSizePerRequest, long putsHeapSize) throws Exception
Exceptionpublic void testSubmit() throws Exception
Exceptionpublic void testSubmitWithCB() throws Exception
Exceptionpublic void testSubmitBusyRegion() throws Exception
Exceptionpublic void testSubmitBusyRegionServer() throws Exception
Exceptionpublic void testSubmitTrue() throws IOException
IOExceptionpublic void testFailAndSuccess() throws Exception
Exceptionpublic void testTaskCountWithoutClientBackoffPolicy() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void testTaskCountWithClientBackoffPolicy() throws IOException, InterruptedException
IOExceptionInterruptedExceptionprivate void testTaskCount(TestAsyncProcess.MyAsyncProcess ap) throws InterruptedIOException, InterruptedException
public void testMaxTask() throws Exception
Exceptionprivate org.apache.hadoop.hbase.client.ClusterConnection createHConnection() throws IOException
IOExceptionprivate org.apache.hadoop.hbase.client.ClusterConnection createHConnectionWithReplicas() throws IOException
IOExceptionprivate static void setMockLocation(org.apache.hadoop.hbase.client.ClusterConnection hc, byte[] row, org.apache.hadoop.hbase.RegionLocations result) throws IOException
IOExceptionprivate org.apache.hadoop.hbase.client.ClusterConnection createHConnectionCommon()
public void testHTablePutSuccess() throws Exception
Exceptionpublic void testSettingWriteBufferPeriodicFlushParameters() throws Exception
Exceptionprivate void checkPeriodicFlushParameters(org.apache.hadoop.hbase.client.ClusterConnection conn, TestAsyncProcess.MyAsyncProcess ap, long setTO, long expectTO, long setTT, long expectTT)
public void testWriteBufferPeriodicFlushTimeoutMs() throws Exception
Exceptionpublic void testBufferedMutatorImplWithSharedPool() throws Exception
Exceptionpublic void testFailedPutAndNewPut() throws Exception
Exceptionpublic void testAction()
public void testBatch() throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void testErrorsServers() throws IOException
IOExceptionpublic void testReadAndWriteTimeout() throws IOException
IOExceptionpublic void testErrors() throws IOException
IOExceptionpublic void testCallQueueTooLarge() throws IOException
IOExceptionpublic void testThreadCreation() throws Exception
Exceptionpublic void testReplicaReplicaSuccess() throws Exception
Exceptionpublic void testReplicaPrimarySuccessWoReplicaCalls() throws Exception
Exceptionpublic void testReplicaParallelCallsSucceed() throws Exception
Exceptionpublic void testReplicaPartialReplicaCall() throws Exception
Exceptionpublic void testReplicaMainFailsBeforeReplicaCalls() throws Exception
Exceptionpublic void testReplicaReplicaSuccessWithParallelFailures() throws Exception
Exceptionpublic void testReplicaAllCallsFailForOneRegion() throws Exception
Exceptionprivate TestAsyncProcess.MyAsyncProcessWithReplicas createReplicaAp(int replicaAfterMs, int primaryMs, int replicaMs) throws Exception
Exceptionprivate TestAsyncProcess.MyAsyncProcessWithReplicas createReplicaAp(int replicaAfterMs, int primaryMs, int replicaMs, int retries) throws Exception
Exceptionprivate org.apache.hadoop.hbase.client.BufferedMutatorParams createBufferedMutatorParams(TestAsyncProcess.MyAsyncProcess ap, org.apache.hadoop.hbase.TableName name)
private static List<org.apache.hadoop.hbase.client.Get> makeTimelineGets(byte[]... rows)
private void verifyResult(org.apache.hadoop.hbase.client.AsyncRequestFuture ars, boolean... expected) throws Exception
Exceptionprivate void verifyReplicaResult(org.apache.hadoop.hbase.client.AsyncRequestFuture ars, TestAsyncProcess.RR... expecteds) throws Exception
Exceptionprivate org.apache.hadoop.hbase.client.Put createPut(int regCnt, boolean success)
regCnt - the region: 1 to 3.success - if true, the put will succeed.public void testUncheckedException() throws Exception
Exceptionpublic void testRetryPauseWithCallQueueTooBigException() throws Exception
Exception - if unexpected error happened during testpublic void testRetryWithExceptionClearsMetaCache() throws Exception
Exceptionpublic void testQueueRowAccess() throws Exception
ExceptionCopyright © 2007–2021 The Apache Software Foundation. All rights reserved.