Class TestClientOperationTimeout

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

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
    • CLASS_RULE

      public static final HBaseClassTestRule CLASS_RULE
    • 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

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

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

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

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

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

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

      Tests that scan on a table throws RetriesExhaustedException when the operation takes longer than 'hbase.client.scanner.timeout.period'.
      Throws:
      IOException
      InterruptedException