From c2a8978fdf0bdce011c5b3ea73af90e26531c27e Mon Sep 17 00:00:00 2001 From: Nick Dimiduk Date: Wed, 16 Mar 2022 13:38:36 +0100 Subject: [PATCH] PR Feedback --- .../coprocessor/TestCoprocessorEndpointTracing.java | 12 ++++++------ .../java/org/apache/hadoop/hbase/ConnectionRule.java | 4 ++-- .../org/apache/hadoop/hbase/MiniClusterRule.java | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpointTracing.java b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpointTracing.java index 1def51bc55c2..167a656ded09 100644 --- a/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpointTracing.java +++ b/hbase-endpoint/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorEndpointTracing.java @@ -228,7 +228,7 @@ public void onError(Throwable error) { @Test public void traceSyncTableEndpointCall() throws Exception { - final Connection connection = connectionRule.getSyncConnection(); + final Connection connection = connectionRule.getConnection(); try (final Table table = connection.getTable(TEST_TABLE)) { final RpcController controller = new ServerRpcController(); final EchoRequestProto request = EchoRequestProto.newBuilder().setMessage("hello").build(); @@ -280,7 +280,7 @@ public void traceSyncTableEndpointCall() throws Exception { @Test public void traceSyncTableEndpointCallAndCallback() throws Exception { - final Connection connection = connectionRule.getSyncConnection(); + final Connection connection = connectionRule.getConnection(); try (final Table table = connection.getTable(TEST_TABLE)) { final RpcController controller = new ServerRpcController(); final EchoRequestProto request = EchoRequestProto.newBuilder().setMessage("hello").build(); @@ -336,7 +336,7 @@ public void traceSyncTableEndpointCallAndCallback() throws Exception { @Test public void traceSyncTableRegionCoprocessorRpcChannel() throws Exception { - final Connection connection = connectionRule.getSyncConnection(); + final Connection connection = connectionRule.getConnection(); try (final Table table = connection.getTable(TEST_TABLE)) { final EchoRequestProto request = EchoRequestProto.newBuilder().setMessage("hello").build(); final EchoResponseProto response = TraceUtil.trace(() -> { @@ -376,7 +376,7 @@ public void traceSyncTableRegionCoprocessorRpcChannel() throws Exception { @Test public void traceSyncTableBatchEndpoint() throws Exception { - final Connection connection = connectionRule.getSyncConnection(); + final Connection connection = connectionRule.getConnection(); try (final Table table = connection.getTable(TEST_TABLE)) { final Descriptors.MethodDescriptor descriptor = TestProtobufRpcProto.getDescriptor().findMethodByName("echo"); @@ -423,7 +423,7 @@ public void traceSyncTableBatchEndpoint() throws Exception { @Test public void traceSyncTableBatchEndpointCallback() throws Exception { - final Connection connection = connectionRule.getSyncConnection(); + final Connection connection = connectionRule.getConnection(); try (final Table table = connection.getTable(TEST_TABLE)) { final Descriptors.MethodDescriptor descriptor = TestProtobufRpcProto.getDescriptor().findMethodByName("echo"); @@ -504,7 +504,7 @@ public void traceAsyncAdminEndpoint() throws Exception { @Test public void traceSyncAdminEndpoint() throws Exception { - final Connection connection = connectionRule.getSyncConnection(); + final Connection connection = connectionRule.getConnection(); try (final Admin admin = connection.getAdmin()) { final TestProtobufRpcProto.BlockingInterface service = TestProtobufRpcProto.newBlockingStub(admin.coprocessorService()); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/ConnectionRule.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/ConnectionRule.java index 1feb7d55fdd8..77bd1c531c68 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/ConnectionRule.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/ConnectionRule.java @@ -53,7 +53,7 @@ public final class ConnectionRule extends ExternalResource { private Connection connection; private AsyncConnection asyncConnection; - public static ConnectionRule createSyncConnectionRule( + public static ConnectionRule createConnectionRule( final Supplier connectionSupplier ) { return new ConnectionRule(connectionSupplier, null); @@ -80,7 +80,7 @@ private ConnectionRule( this.asyncConnectionSupplier = asyncConnectionSupplier; } - public Connection getSyncConnection() { + public Connection getConnection() { if (connection == null) { throw new IllegalStateException( "ConnectionRule not initialized with a synchronous connection."); diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniClusterRule.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniClusterRule.java index 6c09adeb88a9..f13258f93736 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniClusterRule.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/MiniClusterRule.java @@ -111,10 +111,10 @@ public HBaseTestingUtil getTestingUtility() { } /** - * Create a {@link AsyncConnection} to the managed {@link SingleProcessHBaseCluster}. It's up to + * Create a {@link Connection} to the managed {@link SingleProcessHBaseCluster}. It's up to * the caller to {@link Connection#close() close()} the connection when finished. */ - public Connection createSyncConnection() { + public Connection createConnection() { try { return createAsyncConnection().get().toConnection(); } catch (InterruptedException | ExecutionException e) {