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
Exception
public void testSubmitLargeRequestWithUnlimitedSize() throws Exception
Exception
public void testSubmitRandomSizeRequest() throws Exception
Exception
public void testSubmitSmallRequest() throws Exception
Exception
public void testSubmitLargeRequest() throws Exception
Exception
private void doSubmitRequest(long maxHeapSizePerRequest, long putsHeapSize) throws Exception
Exception
public void testSubmit() throws Exception
Exception
public void testSubmitWithCB() throws Exception
Exception
public void testSubmitBusyRegion() throws Exception
Exception
public void testSubmitBusyRegionServer() throws Exception
Exception
public void testSubmitTrue() throws IOException
IOException
public void testFailAndSuccess() throws Exception
Exception
public void testTaskCountWithoutClientBackoffPolicy() throws IOException, InterruptedException
IOException
InterruptedException
public void testTaskCountWithClientBackoffPolicy() throws IOException, InterruptedException
IOException
InterruptedException
private void testTaskCount(TestAsyncProcess.MyAsyncProcess ap) throws InterruptedIOException, InterruptedException
public void testMaxTask() throws Exception
Exception
private org.apache.hadoop.hbase.client.ClusterConnection createHConnection() throws IOException
IOException
private org.apache.hadoop.hbase.client.ClusterConnection createHConnectionWithReplicas() throws IOException
IOException
private static void setMockLocation(org.apache.hadoop.hbase.client.ClusterConnection hc, byte[] row, org.apache.hadoop.hbase.RegionLocations result) throws IOException
IOException
private org.apache.hadoop.hbase.client.ClusterConnection createHConnectionCommon()
public void testHTablePutSuccess() throws Exception
Exception
public void testSettingWriteBufferPeriodicFlushParameters() throws Exception
Exception
private 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
Exception
public void testBufferedMutatorImplWithSharedPool() throws Exception
Exception
public void testFailedPutAndNewPut() throws Exception
Exception
public void testAction()
public void testBatch() throws IOException, InterruptedException
IOException
InterruptedException
public void testErrorsServers() throws IOException
IOException
public void testReadAndWriteTimeout() throws IOException
IOException
public void testErrors() throws IOException
IOException
public void testCallQueueTooLarge() throws IOException
IOException
public void testThreadCreation() throws Exception
Exception
public void testReplicaReplicaSuccess() throws Exception
Exception
public void testReplicaPrimarySuccessWoReplicaCalls() throws Exception
Exception
public void testReplicaParallelCallsSucceed() throws Exception
Exception
public void testReplicaPartialReplicaCall() throws Exception
Exception
public void testReplicaMainFailsBeforeReplicaCalls() throws Exception
Exception
public void testReplicaReplicaSuccessWithParallelFailures() throws Exception
Exception
public void testReplicaAllCallsFailForOneRegion() throws Exception
Exception
private TestAsyncProcess.MyAsyncProcessWithReplicas createReplicaAp(int replicaAfterMs, int primaryMs, int replicaMs) throws Exception
Exception
private TestAsyncProcess.MyAsyncProcessWithReplicas createReplicaAp(int replicaAfterMs, int primaryMs, int replicaMs, int retries) throws Exception
Exception
private 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
Exception
private void verifyReplicaResult(org.apache.hadoop.hbase.client.AsyncRequestFuture ars, TestAsyncProcess.RR... expecteds) throws Exception
Exception
private 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
Exception
public void testRetryPauseWithCallQueueTooBigException() throws Exception
Exception
- if unexpected error happened during testpublic void testRetryWithExceptionClearsMetaCache() throws Exception
Exception
public void testQueueRowAccess() throws Exception
Exception
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.