Class AbstractTestIPC

java.lang.Object
org.apache.hadoop.hbase.ipc.AbstractTestIPC
Direct Known Subclasses:
TestBlockingIPC, TestNettyIPC, TestNettyTlsIPC

public abstract class AbstractTestIPC extends Object
Some basic ipc tests.
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • CELL_BYTES

      private static final byte[] CELL_BYTES
    • CELL

      private static final org.apache.hadoop.hbase.KeyValue CELL
    • CONF

      protected static final org.apache.hadoop.conf.Configuration CONF
    • OTEL_EXT

      @RegisterExtension private static final io.opentelemetry.sdk.testing.junit5.OpenTelemetryExtension OTEL_EXT
    • rpcServerImpl

      private Class<? extends org.apache.hadoop.hbase.ipc.RpcServer> rpcServerImpl
  • Constructor Details

    • AbstractTestIPC

      protected AbstractTestIPC(Class<? extends org.apache.hadoop.hbase.ipc.RpcServer> rpcServerImpl)
  • Method Details

    • createRpcServer

      protected org.apache.hadoop.hbase.ipc.RpcServer createRpcServer(org.apache.hadoop.hbase.Server server, String name, List<org.apache.hadoop.hbase.ipc.RpcServer.BlockingServiceAndInterface> services, InetSocketAddress bindAddress, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.ipc.RpcScheduler scheduler) throws IOException
      Throws:
      IOException
    • createRpcServer

      private org.apache.hadoop.hbase.ipc.RpcServer createRpcServer(String name, List<org.apache.hadoop.hbase.ipc.RpcServer.BlockingServiceAndInterface> services, InetSocketAddress bindAddress, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.ipc.RpcScheduler scheduler) throws IOException
      Throws:
      IOException
    • createRpcClientNoCodec

      protected abstract org.apache.hadoop.hbase.ipc.AbstractRpcClient<?> createRpcClientNoCodec(org.apache.hadoop.conf.Configuration conf)
    • setUpBeforeTest

      @BeforeEach public void setUpBeforeTest()
    • testNoCodec

      @TestTemplate public void testNoCodec() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
      Ensure we do not HAVE TO HAVE a codec.
      Throws:
      IOException
      org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
    • createRpcClient

      protected abstract org.apache.hadoop.hbase.ipc.AbstractRpcClient<?> createRpcClient(org.apache.hadoop.conf.Configuration conf)
    • testCompressCellBlock

      @TestTemplate public void testCompressCellBlock() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
      It is hard to verify the compression is actually happening under the wraps. Hope that if unsupported, we'll get an exception out of some time (meantime, have to trace it manually to confirm that compression is happening down in the client and server).
      Throws:
      IOException
      org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
    • createRpcClientRTEDuringConnectionSetup

      protected abstract org.apache.hadoop.hbase.ipc.AbstractRpcClient<?> createRpcClientRTEDuringConnectionSetup(org.apache.hadoop.conf.Configuration conf) throws IOException
      Throws:
      IOException
    • testRTEDuringConnectionSetup

      @TestTemplate public void testRTEDuringConnectionSetup() throws Exception
      Throws:
      Exception
    • testRpcScheduler

      @TestTemplate public void testRpcScheduler() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException, InterruptedException
      Tests that the rpc scheduler is called when requests arrive.
      Throws:
      IOException
      org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
      InterruptedException
    • testRpcMaxRequestSize

      @TestTemplate public void testRpcMaxRequestSize() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
      Tests that the rpc scheduler is called when requests arrive.
      Throws:
      IOException
      org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
    • testRpcServerForNotNullRemoteAddressInCallObject

      @TestTemplate public void testRpcServerForNotNullRemoteAddressInCallObject() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
      Tests that the RpcServer creates & dispatches CallRunner object to scheduler with non-null remoteAddress set to its Call Object
      Throws:
      IOException
      org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
    • testRemoteError

      @TestTemplate public void testRemoteError() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
      Throws:
      IOException
      org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
    • testTimeout

      @TestTemplate public void testTimeout() throws IOException
      Throws:
      IOException
    • createTestFailingRpcServer

      protected org.apache.hadoop.hbase.ipc.RpcServer createTestFailingRpcServer(String name, List<org.apache.hadoop.hbase.ipc.RpcServer.BlockingServiceAndInterface> services, InetSocketAddress bindAddress, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.hbase.ipc.RpcScheduler scheduler) throws IOException
      Throws:
      IOException
    • testConnectionCloseWithOutstandingRPCs

      Tests that the connection closing is handled by the client with outstanding RPC calls
      Throws:
      InterruptedException
      IOException
    • testAsyncEcho

      @TestTemplate public void testAsyncEcho() throws IOException
      Throws:
      IOException
    • testAsyncRemoteError

      @TestTemplate public void testAsyncRemoteError() throws IOException
      Throws:
      IOException
    • testAsyncTimeout

      @TestTemplate public void testAsyncTimeout() throws IOException
      Throws:
      IOException
    • waitSpan

      private io.opentelemetry.sdk.trace.data.SpanData waitSpan(org.hamcrest.Matcher<io.opentelemetry.sdk.trace.data.SpanData> matcher)
    • buildIpcSpanName

      private static String buildIpcSpanName(String packageAndService, String methodName)
    • buildIpcClientSpanMatcher

      private static org.hamcrest.Matcher<io.opentelemetry.sdk.trace.data.SpanData> buildIpcClientSpanMatcher(String packageAndService, String methodName)
    • buildIpcServerSpanMatcher

      private static org.hamcrest.Matcher<io.opentelemetry.sdk.trace.data.SpanData> buildIpcServerSpanMatcher(String packageAndService, String methodName)
    • buildIpcClientSpanAttributesMatcher

      private static org.hamcrest.Matcher<io.opentelemetry.sdk.trace.data.SpanData> buildIpcClientSpanAttributesMatcher(String packageAndService, String methodName, InetSocketAddress isa)
    • buildIpcServerSpanAttributesMatcher

      private static org.hamcrest.Matcher<io.opentelemetry.sdk.trace.data.SpanData> buildIpcServerSpanAttributesMatcher(String packageAndService, String methodName)
    • assertRemoteSpan

      private void assertRemoteSpan()
    • testTracingSuccessIpc

      @TestTemplate public void testTracingSuccessIpc() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
      Throws:
      IOException
      org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
    • testTracingErrorIpc

      @TestTemplate public void testTracingErrorIpc() throws IOException
      Throws:
      IOException
    • createBadAuthRpcClient

      protected abstract org.apache.hadoop.hbase.ipc.AbstractRpcClient<?> createBadAuthRpcClient(org.apache.hadoop.conf.Configuration conf)
    • doBadPreableHeaderCall

      private IOException doBadPreableHeaderCall(org.apache.hadoop.hbase.shaded.ipc.protobuf.generated.TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface stub)
    • testBadPreambleHeader

      @TestTemplate public void testBadPreambleHeader() throws Exception
      Throws:
      Exception
    • testGetConnectionRegistry

      @TestTemplate public void testGetConnectionRegistry() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
      Testcase for getting connection registry information through connection preamble header, see HBASE-25051 for more details.
      Throws:
      IOException
      org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
    • testGetConnectionRegistryError

      @TestTemplate public void testGetConnectionRegistryError() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException
      Test server does not support getting connection registry information through connection preamble header, i.e, a new client connecting to an old server. We simulate this by using a Server without implementing the ConnectionRegistryEndpoint interface.
      Throws:
      IOException
      org.apache.hbase.thirdparty.com.google.protobuf.ServiceException