Package org.apache.hadoop.hbase
Class TestClientOperationTimeout
java.lang.Object
org.apache.hadoop.hbase.TestClientOperationTimeout
These tests verify that the RPC timeouts ('hbase.client.operation.timeout' and
'hbase.client.scanner.timeout.period') work correctly using a modified Region Server which
injects delays to get, scan and mutate operations.
When 'hbase.client.operation.timeout' is set and client operation is not completed in time the
client will retry the operation 'hbase.client.retries.number' times. After that
SocketTimeoutException
will be thrown.
Using 'hbase.client.scanner.timeout.period' configuration property similar behavior can be
specified for scan related operations such as openScanner(), next(). If that times out
RetriesExhaustedException
will be thrown.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
private static final class
ThisRSRpcServices
class injects delay for Rpc calls and after executes super methods. -
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private static org.apache.hadoop.hbase.client.Connection
private static int
private static int
private static int
private static int
private static final byte[]
private static final org.slf4j.Logger
private static final byte[]
private static final byte[]
private static org.apache.hadoop.hbase.client.Table
private static final org.apache.hadoop.hbase.TableName
private static final HBaseTestingUtil
private static final byte[]
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
setUp()
void
static void
tearDown()
void
Tests that a get on a table throwsRetriesExhaustedException
when the operation takes longer than 'hbase.client.operation.timeout'.void
Tests that a batch mutate on a table throwsRetriesExhaustedException
when the operation takes longer than 'hbase.client.operation.timeout'.void
Tests that a put on a table throwsRetriesExhaustedException
when the operation takes longer than 'hbase.client.operation.timeout'.void
Tests that scan on a table throwsRetriesExhaustedException
when the operation takes longer than 'hbase.client.scanner.timeout.period'.
-
Field Details
-
LOG
-
CLASS_RULE
-
UTIL
-
DELAY_GET
-
DELAY_SCAN
-
DELAY_MUTATE
-
DELAY_BATCH_MUTATE
-
TABLE_NAME
-
FAMILY
-
ROW
-
QUALIFIER
-
VALUE
-
CONN
-
TABLE
-
-
Constructor Details
-
TestClientOperationTimeout
public TestClientOperationTimeout()
-
-
Method Details
-
setUp
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
setUpBeforeTest
- Throws:
Exception
-
testGetTimeout
Tests that a get on a table throwsRetriesExhaustedException
when the operation takes longer than 'hbase.client.operation.timeout'. -
testPutTimeout
Tests that a put on a table throwsRetriesExhaustedException
when the operation takes longer than 'hbase.client.operation.timeout'. -
testMultiPutsTimeout
Tests that a batch mutate on a table throwsRetriesExhaustedException
when the operation takes longer than 'hbase.client.operation.timeout'. -
testScanTimeout
Tests that scan on a table throwsRetriesExhaustedException
when the operation takes longer than 'hbase.client.scanner.timeout.period'.- Throws:
IOException
InterruptedException
-