Package org.apache.hadoop.hbase.ipc
Class AbstractTestIPC
java.lang.Object
org.apache.hadoop.hbase.ipc.AbstractTestIPC
- Direct Known Subclasses:
TestBlockingIPC,TestNettyIPC,TestNettyTlsIPC
Some basic ipc tests.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.apache.hadoop.hbase.KeyValueprivate static final byte[]protected static final org.apache.hadoop.conf.Configurationprivate static final org.slf4j.LoggerClass<? extends org.apache.hadoop.hbase.ipc.RpcServer>io.opentelemetry.sdk.testing.junit4.OpenTelemetryRule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate static org.hamcrest.Matcher<io.opentelemetry.sdk.trace.data.SpanData>buildIpcClientSpanAttributesMatcher(String packageAndService, String methodName, InetSocketAddress isa) private static org.hamcrest.Matcher<io.opentelemetry.sdk.trace.data.SpanData>buildIpcClientSpanMatcher(String packageAndService, String methodName) private static org.hamcrest.Matcher<io.opentelemetry.sdk.trace.data.SpanData>buildIpcServerSpanAttributesMatcher(String packageAndService, String methodName) private static org.hamcrest.Matcher<io.opentelemetry.sdk.trace.data.SpanData>buildIpcServerSpanMatcher(String packageAndService, String methodName) private static StringbuildIpcSpanName(String packageAndService, String methodName) protected abstract org.apache.hadoop.hbase.ipc.AbstractRpcClient<?>createBadAuthRpcClient(org.apache.hadoop.conf.Configuration conf) protected abstract org.apache.hadoop.hbase.ipc.AbstractRpcClient<?>createRpcClient(org.apache.hadoop.conf.Configuration conf) protected abstract org.apache.hadoop.hbase.ipc.AbstractRpcClient<?>createRpcClientNoCodec(org.apache.hadoop.conf.Configuration conf) protected abstract org.apache.hadoop.hbase.ipc.AbstractRpcClient<?>createRpcClientRTEDuringConnectionSetup(org.apache.hadoop.conf.Configuration conf) private org.apache.hadoop.hbase.ipc.RpcServercreateRpcServer(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) protected org.apache.hadoop.hbase.ipc.RpcServercreateRpcServer(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) protected org.apache.hadoop.hbase.ipc.RpcServercreateTestFailingRpcServer(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) private IOExceptiondoBadPreableHeaderCall(org.apache.hadoop.hbase.shaded.ipc.protobuf.generated.TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface stub) voidvoidvoidvoidvoidvoidIt is hard to verify the compression is actually happening under the wraps.voidTests that the connection closing is handled by the client with outstanding RPC callsvoidTestcase for getting connection registry information through connection preamble header, see HBASE-25051 for more details.voidTest server does not support getting connection registry information through connection preamble header, i.e, a new client connecting to an old server.voidEnsure we do not HAVE TO HAVE a codec.voidvoidTests that the rpc scheduler is called when requests arrive.voidTests that the rpc scheduler is called when requests arrive.voidTests that the RpcServer creates & dispatches CallRunner object to scheduler with non-null remoteAddress set to its Call Objectvoidvoidvoidvoidprivate io.opentelemetry.sdk.trace.data.SpanDatawaitSpan(org.hamcrest.Matcher<io.opentelemetry.sdk.trace.data.SpanData> matcher)
-
Field Details
-
LOG
-
CELL_BYTES
-
CELL
-
CONF
-
traceRule
-
rpcServerImpl
-
-
Constructor Details
-
AbstractTestIPC
public AbstractTestIPC()
-
-
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
-
testNoCodec
public void testNoCodec() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceExceptionEnsure we do not HAVE TO HAVE a codec.- Throws:
IOExceptionorg.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
createRpcClient
protected abstract org.apache.hadoop.hbase.ipc.AbstractRpcClient<?> createRpcClient(org.apache.hadoop.conf.Configuration conf) -
testCompressCellBlock
public void testCompressCellBlock() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceExceptionIt 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:
IOExceptionorg.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
- Throws:
Exception
-
testRpcScheduler
public void testRpcScheduler() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException, InterruptedExceptionTests that the rpc scheduler is called when requests arrive.- Throws:
IOExceptionorg.apache.hbase.thirdparty.com.google.protobuf.ServiceExceptionInterruptedException
-
testRpcMaxRequestSize
public void testRpcMaxRequestSize() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceExceptionTests that the rpc scheduler is called when requests arrive.- Throws:
IOExceptionorg.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
testRpcServerForNotNullRemoteAddressInCallObject
public void testRpcServerForNotNullRemoteAddressInCallObject() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceExceptionTests that the RpcServer creates & dispatches CallRunner object to scheduler with non-null remoteAddress set to its Call Object- Throws:
IOExceptionorg.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
testRemoteError
public void testRemoteError() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException- Throws:
IOExceptionorg.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
testTimeout
- 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:
InterruptedExceptionIOException
-
testAsyncEcho
- Throws:
IOException
-
testAsyncRemoteError
- Throws:
IOException
-
testAsyncTimeout
- Throws:
IOException
-
waitSpan
private io.opentelemetry.sdk.trace.data.SpanData waitSpan(org.hamcrest.Matcher<io.opentelemetry.sdk.trace.data.SpanData> matcher) -
buildIpcSpanName
-
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
-
testTracingSuccessIpc
public void testTracingSuccessIpc() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceException- Throws:
IOExceptionorg.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
testTracingErrorIpc
- 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
- Throws:
Exception
-
testGetConnectionRegistry
public void testGetConnectionRegistry() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceExceptionTestcase for getting connection registry information through connection preamble header, see HBASE-25051 for more details.- Throws:
IOExceptionorg.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-
testGetConnectionRegistryError
public void testGetConnectionRegistryError() throws IOException, org.apache.hbase.thirdparty.com.google.protobuf.ServiceExceptionTest 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:
IOExceptionorg.apache.hbase.thirdparty.com.google.protobuf.ServiceException
-