Package org.apache.hadoop.hbase.client
Class TestClientScannerTimeouts
java.lang.Object
org.apache.hadoop.hbase.client.TestClientScannerTimeouts
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.hbase.client.AsyncConnectionstatic final HBaseClassTestRuleprivate static final intprivate org.apache.hadoop.hbase.client.Connectionprivate static final byte[]private static final org.slf4j.Loggerprivate static final intprivate static final intorg.junit.rules.TestNameprivate static final byte[]private static final byte[]private static final byte[]private static final byte[]private static final byte[]private static final intprivate static final intprivate static org.apache.hadoop.hbase.TableNameprivate static final HBaseTestingUtilitybooleanprivate static final byte[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidafter()private voidexpectNumTries(int expected) private voidexpectRetryOutOfOrderScannerNext(Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) private voidexpectRow(byte[] expected, org.apache.hadoop.hbase.client.Result result) private voidexpectTimeout(long start, int timeout) private voidexpectTimeoutOnCloseScanner(int timeout, Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) private voidexpectTimeoutOnNext(int timeout, Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) private voidexpectTimeoutOnOpenScanner(int timeout, Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) private voidexpectTimeoutOnRenewScanner(int timeout, Supplier<org.apache.hadoop.hbase.client.ResultScanner> scannerSupplier) private org.apache.hadoop.hbase.client.ResultScannerprivate org.apache.hadoop.hbase.client.Connectionprivate org.apache.hadoop.hbase.client.ResultScannerprivate org.apache.hadoop.hbase.client.ResultScannergetScanner(org.apache.hadoop.hbase.client.Connection conn) static Collection<Object[]>private voidputToTable(org.apache.hadoop.hbase.client.Table ht, byte[] rowkey) voidsetup(boolean isSystemTable) voidsetUp()static voidstatic voidvoidTest close timeout for non-async scanner, which should use rpcTimeout.voidverify that we honorConnectionConfiguration.HBASE_CLIENT_META_SCANNER_TIMEOUTfor next() calls in meta scansvoidAsyncTable version of abovevoidverify that we honorConnectionConfiguration.HBASE_CLIENT_META_READ_RPC_TIMEOUT_KEYfor openScanner() calls for meta scansvoidAsyncTable version of abovevoidTest renewLease timeout for non-async scanner, which should use rpcTimeout.voidTest close timeout for non-async scanner, which should use rpcTimeout.voidvoidAsyncTable version of abovevoidverify that we honorHConstants.HBASE_RPC_READ_TIMEOUT_KEYfor openScanner() calls for meta scansvoidAsyncTable version of abovevoidTest renewLease timeout for non-async scanner, which should use rpcTimeout.voidverify that we don't miss any data when encountering an OutOfOrderScannerNextException.voidAsyncTable version of aboveprivate voidtestScanTimeoutOnNext(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_KEYfor openScanner() calls for meta scans- Throws:
IOException
-
testNormalScanTimeoutOnOpenScannerAsync
AsyncTable version of above- Throws:
IOException
-
testMetaScanTimeoutOnNext
verify that we honorConnectionConfiguration.HBASE_CLIENT_META_SCANNER_TIMEOUTfor 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_KEYfor 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
-