Class TestClientOperationTimeout

java.lang.Object
org.apache.hadoop.hbase.TestClientOperationTimeout

@Tag("org.apache.hadoop.hbase.testclassification.ClientTests") @Tag("org.apache.hadoop.hbase.testclassification.MediumTests") public class TestClientOperationTimeout extends Object
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.

  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • UTIL

      private static final HBaseTestingUtil UTIL
    • DELAY_GET

      private static int DELAY_GET
    • DELAY_SCAN

      private static int DELAY_SCAN
    • DELAY_MUTATE

      private static int DELAY_MUTATE
    • DELAY_BATCH_MUTATE

      private static int DELAY_BATCH_MUTATE
    • TABLE_NAME

      private static final org.apache.hadoop.hbase.TableName TABLE_NAME
    • FAMILY

      private static final byte[] FAMILY
    • ROW

      private static final byte[] ROW
    • QUALIFIER

      private static final byte[] QUALIFIER
    • VALUE

      private static final byte[] VALUE
    • CONN

      private static org.apache.hadoop.hbase.client.Connection CONN
    • TABLE

      private static org.apache.hadoop.hbase.client.Table TABLE
  • Constructor Details

  • Method Details

    • setUp

      @BeforeAll public static void setUp() throws Exception
      Throws:
      Exception
    • tearDown

      @AfterAll public static void tearDown() throws Exception
      Throws:
      Exception
    • setUpBeforeTest

      @BeforeEach public void setUpBeforeTest() throws Exception
      Throws:
      Exception
    • testGetTimeout

      @Test public void testGetTimeout()
      Tests that a get on a table throws RetriesExhaustedException when the operation takes longer than 'hbase.client.operation.timeout'.
    • testPutTimeout

      @Test public void testPutTimeout()
      Tests that a put on a table throws RetriesExhaustedException when the operation takes longer than 'hbase.client.operation.timeout'.
    • testMultiPutsTimeout

      @Test public void testMultiPutsTimeout()
      Tests that a batch mutate on a table throws RetriesExhaustedException when the operation takes longer than 'hbase.client.operation.timeout'.
    • testScanTimeout

      @Test public void testScanTimeout() throws IOException, InterruptedException
      Tests that scan on a table throws RetriesExhaustedException when the operation takes longer than 'hbase.client.scanner.timeout.period'.
      Throws:
      IOException
      InterruptedException