Package org.apache.hadoop.hbase.client
Class TestClientScannerTimeouts
java.lang.Object
org.apache.hadoop.hbase.client.TestClientScannerTimeouts
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static class
private static class
-
Field Summary
Modifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.client.AsyncConnection
static final HBaseClassTestRule
private static final int
private org.apache.hadoop.hbase.client.Connection
private static final byte[]
private static final org.slf4j.Logger
private static final int
private static final int
org.junit.rules.TestName
private static final byte[]
private static final byte[]
private static final byte[]
private static final byte[]
private static final byte[]
private static final int
private static final int
private static org.apache.hadoop.hbase.TableName
private static final HBaseTestingUtility
boolean
private static final byte[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
after()
private void
expectNumTries
(int expected) private void
expectRetryOutOfOrderScannerNext
(Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) private void
expectRow
(byte[] expected, org.apache.hadoop.hbase.client.Result result) private void
expectTimeout
(long start, int timeout) private void
expectTimeoutOnCloseScanner
(int timeout, Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) private void
expectTimeoutOnNext
(int timeout, Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) private void
expectTimeoutOnOpenScanner
(int timeout, Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) private void
expectTimeoutOnRenewScanner
(int timeout, Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) private org.apache.hadoop.hbase.client.ResultScanner
private org.apache.hadoop.hbase.client.Connection
private org.apache.hadoop.hbase.client.ResultScanner
private org.apache.hadoop.hbase.client.ResultScanner
getScanner
(org.apache.hadoop.hbase.client.Connection conn) static Collection<Object[]>
private void
putToTable
(org.apache.hadoop.hbase.client.Table ht, byte[] rowkey) void
setup
(boolean isSystemTable) void
setUp()
static void
static void
void
Test close timeout for non-async scanner, which should use rpcTimeout.void
verify that we honorConnectionConfiguration.HBASE_CLIENT_META_SCANNER_TIMEOUT
for next() calls in meta scansvoid
AsyncTable version of abovevoid
verify that we honorConnectionConfiguration.HBASE_CLIENT_META_READ_RPC_TIMEOUT_KEY
for openScanner() calls for meta scansvoid
AsyncTable version of abovevoid
Test renewLease timeout for non-async scanner, which should use rpcTimeout.void
Test close timeout for non-async scanner, which should use rpcTimeout.void
void
AsyncTable version of abovevoid
verify that we honorHConstants.HBASE_RPC_READ_TIMEOUT_KEY
for openScanner() calls for meta scansvoid
AsyncTable version of abovevoid
Test renewLease timeout for non-async scanner, which should use rpcTimeout.void
verify that we don't miss any data when encountering an OutOfOrderScannerNextException.void
AsyncTable version of aboveprivate void
testScanTimeoutOnNext
(int rpcTimeout, int scannerTimeout)
-
Field Details
-
CLASS_RULE
-
LOG
-
TEST_UTIL
-
ASYNC_CONN
-
CONN
-
FAMILY
-
QUALIFIER
-
VALUE
-
ROW0
-
ROW1
-
ROW2
-
ROW3
-
rpcTimeout
- See Also:
-
scanTimeout
- See Also:
-
metaReadRpcTimeout
- See Also:
-
metaScanTimeout
- See Also:
-
CLIENT_RETRIES_NUMBER
- See Also:
-
tableName
-
name
-
useScannerTimeoutPeriodForNextCalls
-
-
Constructor Details
-
TestClientScannerTimeouts
public TestClientScannerTimeouts()
-
-
Method Details
-
parameters
-
setUpBeforeClass
- Throws:
Exception
-
setUp
- Throws:
Exception
-
after
- Throws:
Exception
-
tearDownAfterClass
- Throws:
Exception
-
setup
- Throws:
IOException
-
expectRow
-
expectNumTries
-
testRetryOutOfOrderScannerNextException
verify that we don't miss any data when encountering an OutOfOrderScannerNextException. Typically, the only way to naturally trigger this is if a client-side timeout causes an erroneous next() call. This is relatively hard to do these days because the server attempts to always return before the timeout. In this test we force the server to throw this exception, so that we can test the retry logic appropriately.- Throws:
IOException
-
testRetryOutOfOrderScannerNextExceptionAsync
AsyncTable version of above- Throws:
IOException
-
testNormalScanTimeoutOnNext
- Throws:
IOException
-
testNormalScanTimeoutOnNextAsync
AsyncTable version of above- Throws:
IOException
-
testNormalScanTimeoutOnOpenScanner
verify that we honorHConstants.HBASE_RPC_READ_TIMEOUT_KEY
for openScanner() calls for meta scans- Throws:
IOException
-
testNormalScanTimeoutOnOpenScannerAsync
AsyncTable version of above- Throws:
IOException
-
testMetaScanTimeoutOnNext
verify that we honorConnectionConfiguration.HBASE_CLIENT_META_SCANNER_TIMEOUT
for next() calls in meta scans- Throws:
IOException
-
testScanTimeoutOnNext
- Throws:
IOException
-
getNoRetriesConnection
- Throws:
IOException
-
testMetaScanTimeoutOnNextAsync
AsyncTable version of above- Throws:
IOException
-
testMetaScanTimeoutOnOpenScanner
verify that we honorConnectionConfiguration.HBASE_CLIENT_META_READ_RPC_TIMEOUT_KEY
for openScanner() calls for meta scans- Throws:
IOException
-
testMetaScanTimeoutOnOpenScannerAsync
AsyncTable version of above- Throws:
IOException
-
testNormalScanTimeoutOnRenewLease
Test renewLease timeout for non-async scanner, which should use rpcTimeout. Async scanner does lease renewal automatically in the background, so renewLease() always returns false. So this test doesn't have an Async counterpart like the others.- Throws:
IOException
-
testMetaScanTimeoutOnRenewLease
Test renewLease timeout for non-async scanner, which should use rpcTimeout. Async scanner does lease renewal automatically in the background, so renewLease() always returns false. So this test doesn't have an Async counterpart like the others.- Throws:
IOException
-
testNormalScanTimeoutOnClose
Test close timeout for non-async scanner, which should use rpcTimeout. Async scanner does closes async and always returns immediately. So this test doesn't have an Async counterpart like the others.- Throws:
IOException
-
testMetaScanTimeoutOnClose
Test close timeout for non-async scanner, which should use rpcTimeout. Async scanner does closes async and always returns immediately. So this test doesn't have an Async counterpart like the others.- Throws:
IOException
-
expectRetryOutOfOrderScannerNext
private void expectRetryOutOfOrderScannerNext(Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) throws IOException - Throws:
IOException
-
expectTimeoutOnNext
private void expectTimeoutOnNext(int timeout, Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) throws IOException - Throws:
IOException
-
expectTimeoutOnOpenScanner
private void expectTimeoutOnOpenScanner(int timeout, Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) throws IOException - Throws:
IOException
-
expectTimeoutOnRenewScanner
private void expectTimeoutOnRenewScanner(int timeout, Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) throws IOException - Throws:
IOException
-
expectTimeoutOnCloseScanner
private void expectTimeoutOnCloseScanner(int timeout, Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) throws IOException - Throws:
IOException
-
expectTimeout
-
getScanner
-
getScanner
private org.apache.hadoop.hbase.client.ResultScanner getScanner(org.apache.hadoop.hbase.client.Connection conn) -
getAsyncScanner
-
putToTable
- Throws:
IOException
-