[hbase] 06/08: HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection
This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch HBASE-21512 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 60abe3d8f778dcf2a36a0496c80909c426352030 Author: Duo Zhang AuthorDate: Fri Jan 11 16:22:24 2019 +0800 HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection --- .../hadoop/hbase/client/AsyncConnectionImpl.java | 24 +- .../hbase/client/AsyncClusterConnection.java | 17 + .../hbase/client/AsyncClusterConnectionImpl.java | 80 +++ .../AsyncRegionReplicaReplayRetryingCaller.java| 146 .../hbase/client/AsyncRegionServerAdmin.java | 5 +- .../hbase/client/ClusterConnectionFactory.java | 2 +- .../hbase/protobuf/ReplicationProtbufUtil.java | 31 +- .../handler/RegionReplicaFlushHandler.java | 3 +- .../hbase/replication/ReplicationEndpoint.java | 35 +- .../RegionReplicaReplicationEndpoint.java | 782 +++-- .../regionserver/ReplicationSource.java| 2 +- .../hbase/client/TestAsyncTableNoncedRetry.java| 2 +- .../TestRegionReplicaReplicationEndpoint.java | 56 +- ...stRegionReplicaReplicationEndpointNoMaster.java | 99 ++- 14 files changed, 627 insertions(+), 657 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java index dc9bbcf..3501519 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java @@ -55,7 +55,6 @@ import org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer; import org.apache.hadoop.hbase.shaded.protobuf.RequestConverter; import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService; -import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsMasterRunningResponse; @@ -65,7 +64,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterServ * The implementation of AsyncConnection. */ @InterfaceAudience.Private -class AsyncConnectionImpl implements AsyncClusterConnection { +class AsyncConnectionImpl implements AsyncConnection { private static final Logger LOG = LoggerFactory.getLogger(AsyncConnectionImpl.class); @@ -85,7 +84,7 @@ class AsyncConnectionImpl implements AsyncClusterConnection { private final int rpcTimeout; - private final RpcClient rpcClient; + protected final RpcClient rpcClient; final RpcControllerFactory rpcControllerFactory; @@ -160,16 +159,10 @@ class AsyncConnectionImpl implements AsyncClusterConnection { } // ditto - @Override - public NonceGenerator getNonceGenerator() { + NonceGenerator getNonceGenerator() { return nonceGenerator; } - @Override - public RpcClient getRpcClient() { -return rpcClient; - } - private ClientService.Interface createRegionServerStub(ServerName serverName) throws IOException { return ClientService.newStub(rpcClient.createRpcChannel(serverName, user, rpcTimeout)); } @@ -360,15 +353,4 @@ class AsyncConnectionImpl implements AsyncClusterConnection { return new HBaseHbck(MasterProtos.HbckService.newBlockingStub( rpcClient.createBlockingRpcChannel(masterServer, user, rpcTimeout)), rpcControllerFactory); } - - public AsyncRegionServerAdmin getRegionServerAdmin(ServerName serverName) { -return new AsyncRegionServerAdmin(serverName, this); - } - - @Override - public CompletableFuture flush(byte[] regionName, - boolean writeFlushWALMarker) { -RawAsyncHBaseAdmin admin = (RawAsyncHBaseAdmin) getAdmin(); -return admin.flushRegionInternal(regionName, writeFlushWALMarker); - } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java similarity index 72% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java rename to hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java index f1f64ca..0ad77ba 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java @@ -17,9 +17,13 @@ */ package org.apache.hadoop.hbase.client; +import java.util.List; import java.util.concurrent.CompletableFuture; +import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.ServerName; +import
[hbase] 06/08: HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection
This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch HBASE-21512 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 350616d8a4a87fb6eb6ca7b1d1f9e14a8c72da8c Author: Duo Zhang AuthorDate: Fri Jan 11 16:22:24 2019 +0800 HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection --- .../hadoop/hbase/client/AsyncConnectionImpl.java | 24 +- .../hbase/client/AsyncClusterConnection.java | 17 + .../hbase/client/AsyncClusterConnectionImpl.java | 80 +++ .../AsyncRegionReplicaReplayRetryingCaller.java| 146 .../hbase/client/AsyncRegionServerAdmin.java | 5 +- .../hbase/client/ClusterConnectionFactory.java | 2 +- .../hbase/protobuf/ReplicationProtbufUtil.java | 31 +- .../handler/RegionReplicaFlushHandler.java | 3 +- .../hbase/replication/ReplicationEndpoint.java | 35 +- .../RegionReplicaReplicationEndpoint.java | 782 +++-- .../regionserver/ReplicationSource.java| 2 +- .../hbase/client/TestAsyncTableNoncedRetry.java| 2 +- .../TestRegionReplicaReplicationEndpoint.java | 56 +- ...stRegionReplicaReplicationEndpointNoMaster.java | 99 ++- 14 files changed, 627 insertions(+), 657 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java index dc9bbcf..3501519 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java @@ -55,7 +55,6 @@ import org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer; import org.apache.hadoop.hbase.shaded.protobuf.RequestConverter; import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService; -import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsMasterRunningResponse; @@ -65,7 +64,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterServ * The implementation of AsyncConnection. */ @InterfaceAudience.Private -class AsyncConnectionImpl implements AsyncClusterConnection { +class AsyncConnectionImpl implements AsyncConnection { private static final Logger LOG = LoggerFactory.getLogger(AsyncConnectionImpl.class); @@ -85,7 +84,7 @@ class AsyncConnectionImpl implements AsyncClusterConnection { private final int rpcTimeout; - private final RpcClient rpcClient; + protected final RpcClient rpcClient; final RpcControllerFactory rpcControllerFactory; @@ -160,16 +159,10 @@ class AsyncConnectionImpl implements AsyncClusterConnection { } // ditto - @Override - public NonceGenerator getNonceGenerator() { + NonceGenerator getNonceGenerator() { return nonceGenerator; } - @Override - public RpcClient getRpcClient() { -return rpcClient; - } - private ClientService.Interface createRegionServerStub(ServerName serverName) throws IOException { return ClientService.newStub(rpcClient.createRpcChannel(serverName, user, rpcTimeout)); } @@ -360,15 +353,4 @@ class AsyncConnectionImpl implements AsyncClusterConnection { return new HBaseHbck(MasterProtos.HbckService.newBlockingStub( rpcClient.createBlockingRpcChannel(masterServer, user, rpcTimeout)), rpcControllerFactory); } - - public AsyncRegionServerAdmin getRegionServerAdmin(ServerName serverName) { -return new AsyncRegionServerAdmin(serverName, this); - } - - @Override - public CompletableFuture flush(byte[] regionName, - boolean writeFlushWALMarker) { -RawAsyncHBaseAdmin admin = (RawAsyncHBaseAdmin) getAdmin(); -return admin.flushRegionInternal(regionName, writeFlushWALMarker); - } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java similarity index 72% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java rename to hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java index f1f64ca..0ad77ba 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java @@ -17,9 +17,13 @@ */ package org.apache.hadoop.hbase.client; +import java.util.List; import java.util.concurrent.CompletableFuture; +import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.ServerName; +import
[hbase] 06/08: HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection
This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch HBASE-21512 in repository https://gitbox.apache.org/repos/asf/hbase.git commit e9ffeda595ff599e74f286bdb5e1006b4db3d4e8 Author: Duo Zhang AuthorDate: Fri Jan 11 16:22:24 2019 +0800 HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection --- .../hadoop/hbase/client/AsyncConnectionImpl.java | 24 +- .../hbase/client/AsyncClusterConnection.java | 17 + .../hbase/client/AsyncClusterConnectionImpl.java | 80 +++ .../AsyncRegionReplicaReplayRetryingCaller.java| 146 .../hbase/client/AsyncRegionServerAdmin.java | 5 +- .../hbase/client/ClusterConnectionFactory.java | 2 +- .../hbase/protobuf/ReplicationProtbufUtil.java | 31 +- .../handler/RegionReplicaFlushHandler.java | 3 +- .../hbase/replication/ReplicationEndpoint.java | 35 +- .../RegionReplicaReplicationEndpoint.java | 782 +++-- .../regionserver/ReplicationSource.java| 2 +- .../hbase/client/TestAsyncTableNoncedRetry.java| 2 +- .../TestRegionReplicaReplicationEndpoint.java | 56 +- ...stRegionReplicaReplicationEndpointNoMaster.java | 99 ++- 14 files changed, 627 insertions(+), 657 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java index dc9bbcf..3501519 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java @@ -55,7 +55,6 @@ import org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer; import org.apache.hadoop.hbase.shaded.protobuf.RequestConverter; import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService; -import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsMasterRunningResponse; @@ -65,7 +64,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterServ * The implementation of AsyncConnection. */ @InterfaceAudience.Private -class AsyncConnectionImpl implements AsyncClusterConnection { +class AsyncConnectionImpl implements AsyncConnection { private static final Logger LOG = LoggerFactory.getLogger(AsyncConnectionImpl.class); @@ -85,7 +84,7 @@ class AsyncConnectionImpl implements AsyncClusterConnection { private final int rpcTimeout; - private final RpcClient rpcClient; + protected final RpcClient rpcClient; final RpcControllerFactory rpcControllerFactory; @@ -160,16 +159,10 @@ class AsyncConnectionImpl implements AsyncClusterConnection { } // ditto - @Override - public NonceGenerator getNonceGenerator() { + NonceGenerator getNonceGenerator() { return nonceGenerator; } - @Override - public RpcClient getRpcClient() { -return rpcClient; - } - private ClientService.Interface createRegionServerStub(ServerName serverName) throws IOException { return ClientService.newStub(rpcClient.createRpcChannel(serverName, user, rpcTimeout)); } @@ -360,15 +353,4 @@ class AsyncConnectionImpl implements AsyncClusterConnection { return new HBaseHbck(MasterProtos.HbckService.newBlockingStub( rpcClient.createBlockingRpcChannel(masterServer, user, rpcTimeout)), rpcControllerFactory); } - - public AsyncRegionServerAdmin getRegionServerAdmin(ServerName serverName) { -return new AsyncRegionServerAdmin(serverName, this); - } - - @Override - public CompletableFuture flush(byte[] regionName, - boolean writeFlushWALMarker) { -RawAsyncHBaseAdmin admin = (RawAsyncHBaseAdmin) getAdmin(); -return admin.flushRegionInternal(regionName, writeFlushWALMarker); - } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java similarity index 72% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java rename to hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java index f1f64ca..0ad77ba 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java @@ -17,9 +17,13 @@ */ package org.apache.hadoop.hbase.client; +import java.util.List; import java.util.concurrent.CompletableFuture; +import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.ServerName; +import
[hbase] 06/08: HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection
This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch HBASE-21512 in repository https://gitbox.apache.org/repos/asf/hbase.git commit d358f91004404da4374791760433119325cb38b3 Author: Duo Zhang AuthorDate: Fri Jan 11 16:22:24 2019 +0800 HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection --- .../hadoop/hbase/client/AsyncConnectionImpl.java | 24 +- .../hbase/client/AsyncClusterConnection.java | 17 + .../hbase/client/AsyncClusterConnectionImpl.java | 80 +++ .../AsyncRegionReplicaReplayRetryingCaller.java| 146 .../hbase/client/AsyncRegionServerAdmin.java | 5 +- .../hbase/client/ClusterConnectionFactory.java | 2 +- .../hbase/protobuf/ReplicationProtbufUtil.java | 31 +- .../handler/RegionReplicaFlushHandler.java | 3 +- .../hbase/replication/ReplicationEndpoint.java | 35 +- .../RegionReplicaReplicationEndpoint.java | 782 +++-- .../regionserver/ReplicationSource.java| 2 +- .../hbase/client/TestAsyncTableNoncedRetry.java| 2 +- .../TestRegionReplicaReplicationEndpoint.java | 56 +- ...stRegionReplicaReplicationEndpointNoMaster.java | 99 ++- 14 files changed, 627 insertions(+), 657 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java index dc9bbcf..3501519 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java @@ -55,7 +55,6 @@ import org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer; import org.apache.hadoop.hbase.shaded.protobuf.RequestConverter; import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService; -import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsMasterRunningResponse; @@ -65,7 +64,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterServ * The implementation of AsyncConnection. */ @InterfaceAudience.Private -class AsyncConnectionImpl implements AsyncClusterConnection { +class AsyncConnectionImpl implements AsyncConnection { private static final Logger LOG = LoggerFactory.getLogger(AsyncConnectionImpl.class); @@ -85,7 +84,7 @@ class AsyncConnectionImpl implements AsyncClusterConnection { private final int rpcTimeout; - private final RpcClient rpcClient; + protected final RpcClient rpcClient; final RpcControllerFactory rpcControllerFactory; @@ -160,16 +159,10 @@ class AsyncConnectionImpl implements AsyncClusterConnection { } // ditto - @Override - public NonceGenerator getNonceGenerator() { + NonceGenerator getNonceGenerator() { return nonceGenerator; } - @Override - public RpcClient getRpcClient() { -return rpcClient; - } - private ClientService.Interface createRegionServerStub(ServerName serverName) throws IOException { return ClientService.newStub(rpcClient.createRpcChannel(serverName, user, rpcTimeout)); } @@ -360,15 +353,4 @@ class AsyncConnectionImpl implements AsyncClusterConnection { return new HBaseHbck(MasterProtos.HbckService.newBlockingStub( rpcClient.createBlockingRpcChannel(masterServer, user, rpcTimeout)), rpcControllerFactory); } - - public AsyncRegionServerAdmin getRegionServerAdmin(ServerName serverName) { -return new AsyncRegionServerAdmin(serverName, this); - } - - @Override - public CompletableFuture flush(byte[] regionName, - boolean writeFlushWALMarker) { -RawAsyncHBaseAdmin admin = (RawAsyncHBaseAdmin) getAdmin(); -return admin.flushRegionInternal(regionName, writeFlushWALMarker); - } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java similarity index 72% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java rename to hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java index f1f64ca..0ad77ba 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java @@ -17,9 +17,13 @@ */ package org.apache.hadoop.hbase.client; +import java.util.List; import java.util.concurrent.CompletableFuture; +import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.ServerName; +import
[hbase] 06/08: HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection
This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch HBASE-21512 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 3d8b975c0149d51a6ebd4b5be6c74bda6a60c8e3 Author: Duo Zhang AuthorDate: Fri Jan 11 16:22:24 2019 +0800 HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection --- .../hadoop/hbase/client/AsyncConnectionImpl.java | 24 +- .../hbase/client/AsyncClusterConnection.java | 17 + .../hbase/client/AsyncClusterConnectionImpl.java | 80 +++ .../AsyncRegionReplicaReplayRetryingCaller.java| 146 .../hbase/client/AsyncRegionServerAdmin.java | 5 +- .../hbase/client/ClusterConnectionFactory.java | 2 +- .../hbase/protobuf/ReplicationProtbufUtil.java | 31 +- .../handler/RegionReplicaFlushHandler.java | 3 +- .../hbase/replication/ReplicationEndpoint.java | 35 +- .../RegionReplicaReplicationEndpoint.java | 782 +++-- .../regionserver/ReplicationSource.java| 2 +- .../hbase/client/TestAsyncTableNoncedRetry.java| 2 +- .../TestRegionReplicaReplicationEndpoint.java | 56 +- ...stRegionReplicaReplicationEndpointNoMaster.java | 99 ++- 14 files changed, 627 insertions(+), 657 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java index dc9bbcf..3501519 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java @@ -55,7 +55,6 @@ import org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer; import org.apache.hadoop.hbase.shaded.protobuf.RequestConverter; import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService; -import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsMasterRunningResponse; @@ -65,7 +64,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterServ * The implementation of AsyncConnection. */ @InterfaceAudience.Private -class AsyncConnectionImpl implements AsyncClusterConnection { +class AsyncConnectionImpl implements AsyncConnection { private static final Logger LOG = LoggerFactory.getLogger(AsyncConnectionImpl.class); @@ -85,7 +84,7 @@ class AsyncConnectionImpl implements AsyncClusterConnection { private final int rpcTimeout; - private final RpcClient rpcClient; + protected final RpcClient rpcClient; final RpcControllerFactory rpcControllerFactory; @@ -160,16 +159,10 @@ class AsyncConnectionImpl implements AsyncClusterConnection { } // ditto - @Override - public NonceGenerator getNonceGenerator() { + NonceGenerator getNonceGenerator() { return nonceGenerator; } - @Override - public RpcClient getRpcClient() { -return rpcClient; - } - private ClientService.Interface createRegionServerStub(ServerName serverName) throws IOException { return ClientService.newStub(rpcClient.createRpcChannel(serverName, user, rpcTimeout)); } @@ -360,15 +353,4 @@ class AsyncConnectionImpl implements AsyncClusterConnection { return new HBaseHbck(MasterProtos.HbckService.newBlockingStub( rpcClient.createBlockingRpcChannel(masterServer, user, rpcTimeout)), rpcControllerFactory); } - - public AsyncRegionServerAdmin getRegionServerAdmin(ServerName serverName) { -return new AsyncRegionServerAdmin(serverName, this); - } - - @Override - public CompletableFuture flush(byte[] regionName, - boolean writeFlushWALMarker) { -RawAsyncHBaseAdmin admin = (RawAsyncHBaseAdmin) getAdmin(); -return admin.flushRegionInternal(regionName, writeFlushWALMarker); - } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java similarity index 72% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java rename to hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java index f1f64ca..0ad77ba 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java @@ -17,9 +17,13 @@ */ package org.apache.hadoop.hbase.client; +import java.util.List; import java.util.concurrent.CompletableFuture; +import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.ServerName; +import
[hbase] 06/08: HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection
This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch HBASE-21512 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 5f291e82436c767a21eb16a08a57ce6c49395302 Author: Duo Zhang AuthorDate: Fri Jan 11 16:22:24 2019 +0800 HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection --- .../hadoop/hbase/client/AsyncConnectionImpl.java | 24 +- .../hbase/client/AsyncClusterConnection.java | 17 + .../hbase/client/AsyncClusterConnectionImpl.java | 80 +++ .../AsyncRegionReplicaReplayRetryingCaller.java| 146 .../hbase/client/AsyncRegionServerAdmin.java | 5 +- .../hbase/client/ClusterConnectionFactory.java | 2 +- .../hbase/protobuf/ReplicationProtbufUtil.java | 31 +- .../handler/RegionReplicaFlushHandler.java | 3 +- .../hbase/replication/ReplicationEndpoint.java | 35 +- .../RegionReplicaReplicationEndpoint.java | 782 +++-- .../regionserver/ReplicationSource.java| 2 +- .../hbase/client/TestAsyncTableNoncedRetry.java| 2 +- .../TestRegionReplicaReplicationEndpoint.java | 56 +- ...stRegionReplicaReplicationEndpointNoMaster.java | 99 ++- 14 files changed, 627 insertions(+), 657 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java index be73dd8..9adad74 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java @@ -55,7 +55,6 @@ import org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer; import org.apache.hadoop.hbase.shaded.protobuf.RequestConverter; import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService; -import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsMasterRunningResponse; @@ -65,7 +64,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterServ * The implementation of AsyncConnection. */ @InterfaceAudience.Private -class AsyncConnectionImpl implements AsyncClusterConnection { +class AsyncConnectionImpl implements AsyncConnection { private static final Logger LOG = LoggerFactory.getLogger(AsyncConnectionImpl.class); @@ -85,7 +84,7 @@ class AsyncConnectionImpl implements AsyncClusterConnection { private final int rpcTimeout; - private final RpcClient rpcClient; + protected final RpcClient rpcClient; final RpcControllerFactory rpcControllerFactory; @@ -160,16 +159,10 @@ class AsyncConnectionImpl implements AsyncClusterConnection { } // ditto - @Override - public NonceGenerator getNonceGenerator() { + NonceGenerator getNonceGenerator() { return nonceGenerator; } - @Override - public RpcClient getRpcClient() { -return rpcClient; - } - private ClientService.Interface createRegionServerStub(ServerName serverName) throws IOException { return ClientService.newStub(rpcClient.createRpcChannel(serverName, user, rpcTimeout)); } @@ -360,15 +353,4 @@ class AsyncConnectionImpl implements AsyncClusterConnection { return new HBaseHbck(MasterProtos.HbckService.newBlockingStub( rpcClient.createBlockingRpcChannel(masterServer, user, rpcTimeout)), rpcControllerFactory); } - - public AsyncRegionServerAdmin getRegionServerAdmin(ServerName serverName) { -return new AsyncRegionServerAdmin(serverName, this); - } - - @Override - public CompletableFuture flush(byte[] regionName, - boolean writeFlushWALMarker) { -RawAsyncHBaseAdmin admin = (RawAsyncHBaseAdmin) getAdmin(); -return admin.flushRegionInternal(regionName, writeFlushWALMarker); - } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java similarity index 72% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java rename to hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java index f1f64ca..0ad77ba 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java @@ -17,9 +17,13 @@ */ package org.apache.hadoop.hbase.client; +import java.util.List; import java.util.concurrent.CompletableFuture; +import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.ServerName; +import
[hbase] 06/08: HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection
This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch HBASE-21512 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 851ec247b5d59e1b2fac00f00eb37198bf0b9ef0 Author: Duo Zhang AuthorDate: Fri Jan 11 16:22:24 2019 +0800 HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection --- .../hadoop/hbase/client/AsyncConnectionImpl.java | 24 +- .../hbase/client/AsyncClusterConnection.java | 17 + .../hbase/client/AsyncClusterConnectionImpl.java | 80 +++ .../AsyncRegionReplicaReplayRetryingCaller.java| 146 .../hbase/client/AsyncRegionServerAdmin.java | 5 +- .../hbase/client/ClusterConnectionFactory.java | 2 +- .../hbase/protobuf/ReplicationProtbufUtil.java | 31 +- .../handler/RegionReplicaFlushHandler.java | 3 +- .../hbase/replication/ReplicationEndpoint.java | 35 +- .../RegionReplicaReplicationEndpoint.java | 782 +++-- .../regionserver/ReplicationSource.java| 2 +- .../hbase/client/TestAsyncTableNoncedRetry.java| 2 +- .../TestRegionReplicaReplicationEndpoint.java | 56 +- ...stRegionReplicaReplicationEndpointNoMaster.java | 99 ++- 14 files changed, 627 insertions(+), 657 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java index be73dd8..9adad74 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java @@ -55,7 +55,6 @@ import org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer; import org.apache.hadoop.hbase.shaded.protobuf.RequestConverter; import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService; -import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsMasterRunningResponse; @@ -65,7 +64,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterServ * The implementation of AsyncConnection. */ @InterfaceAudience.Private -class AsyncConnectionImpl implements AsyncClusterConnection { +class AsyncConnectionImpl implements AsyncConnection { private static final Logger LOG = LoggerFactory.getLogger(AsyncConnectionImpl.class); @@ -85,7 +84,7 @@ class AsyncConnectionImpl implements AsyncClusterConnection { private final int rpcTimeout; - private final RpcClient rpcClient; + protected final RpcClient rpcClient; final RpcControllerFactory rpcControllerFactory; @@ -160,16 +159,10 @@ class AsyncConnectionImpl implements AsyncClusterConnection { } // ditto - @Override - public NonceGenerator getNonceGenerator() { + NonceGenerator getNonceGenerator() { return nonceGenerator; } - @Override - public RpcClient getRpcClient() { -return rpcClient; - } - private ClientService.Interface createRegionServerStub(ServerName serverName) throws IOException { return ClientService.newStub(rpcClient.createRpcChannel(serverName, user, rpcTimeout)); } @@ -360,15 +353,4 @@ class AsyncConnectionImpl implements AsyncClusterConnection { return new HBaseHbck(MasterProtos.HbckService.newBlockingStub( rpcClient.createBlockingRpcChannel(masterServer, user, rpcTimeout)), rpcControllerFactory); } - - public AsyncRegionServerAdmin getRegionServerAdmin(ServerName serverName) { -return new AsyncRegionServerAdmin(serverName, this); - } - - @Override - public CompletableFuture flush(byte[] regionName, - boolean writeFlushWALMarker) { -RawAsyncHBaseAdmin admin = (RawAsyncHBaseAdmin) getAdmin(); -return admin.flushRegionInternal(regionName, writeFlushWALMarker); - } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java similarity index 72% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java rename to hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java index f1f64ca..0ad77ba 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java @@ -17,9 +17,13 @@ */ package org.apache.hadoop.hbase.client; +import java.util.List; import java.util.concurrent.CompletableFuture; +import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.ServerName; +import
[hbase] 06/08: HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection
This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch HBASE-21512 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 5ac2e5ccd5d3c5d98a6549f9cd10e296b16d2f04 Author: Duo Zhang AuthorDate: Fri Jan 11 16:22:24 2019 +0800 HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection --- .../hadoop/hbase/client/AsyncConnectionImpl.java | 24 +- .../hbase/client/AsyncClusterConnection.java | 17 + .../hbase/client/AsyncClusterConnectionImpl.java | 80 +++ .../AsyncRegionReplicaReplayRetryingCaller.java| 146 .../hbase/client/AsyncRegionServerAdmin.java | 5 +- .../hbase/client/ClusterConnectionFactory.java | 2 +- .../hbase/protobuf/ReplicationProtbufUtil.java | 31 +- .../handler/RegionReplicaFlushHandler.java | 3 +- .../hbase/replication/ReplicationEndpoint.java | 35 +- .../RegionReplicaReplicationEndpoint.java | 782 +++-- .../regionserver/ReplicationSource.java| 2 +- .../hbase/client/TestAsyncTableNoncedRetry.java| 2 +- .../TestRegionReplicaReplicationEndpoint.java | 56 +- ...stRegionReplicaReplicationEndpointNoMaster.java | 99 ++- 14 files changed, 627 insertions(+), 657 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java index ce6bfac..f6a2149 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java @@ -55,7 +55,6 @@ import org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer; import org.apache.hadoop.hbase.shaded.protobuf.RequestConverter; import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService; -import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsMasterRunningResponse; @@ -65,7 +64,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterServ * The implementation of AsyncConnection. */ @InterfaceAudience.Private -class AsyncConnectionImpl implements AsyncClusterConnection { +class AsyncConnectionImpl implements AsyncConnection { private static final Logger LOG = LoggerFactory.getLogger(AsyncConnectionImpl.class); @@ -85,7 +84,7 @@ class AsyncConnectionImpl implements AsyncClusterConnection { private final int rpcTimeout; - private final RpcClient rpcClient; + protected final RpcClient rpcClient; final RpcControllerFactory rpcControllerFactory; @@ -160,16 +159,10 @@ class AsyncConnectionImpl implements AsyncClusterConnection { } // ditto - @Override - public NonceGenerator getNonceGenerator() { + NonceGenerator getNonceGenerator() { return nonceGenerator; } - @Override - public RpcClient getRpcClient() { -return rpcClient; - } - private ClientService.Interface createRegionServerStub(ServerName serverName) throws IOException { return ClientService.newStub(rpcClient.createRpcChannel(serverName, user, rpcTimeout)); } @@ -360,15 +353,4 @@ class AsyncConnectionImpl implements AsyncClusterConnection { return new HBaseHbck(MasterProtos.HbckService.newBlockingStub( rpcClient.createBlockingRpcChannel(masterServer, user, rpcTimeout)), rpcControllerFactory); } - - public AsyncRegionServerAdmin getRegionServerAdmin(ServerName serverName) { -return new AsyncRegionServerAdmin(serverName, this); - } - - @Override - public CompletableFuture flush(byte[] regionName, - boolean writeFlushWALMarker) { -RawAsyncHBaseAdmin admin = (RawAsyncHBaseAdmin) getAdmin(); -return admin.flushRegionInternal(regionName, writeFlushWALMarker); - } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java similarity index 72% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java rename to hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java index f1f64ca..0ad77ba 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java @@ -17,9 +17,13 @@ */ package org.apache.hadoop.hbase.client; +import java.util.List; import java.util.concurrent.CompletableFuture; +import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.ServerName; +import
[hbase] 06/08: HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection
This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch HBASE-21512 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 0f65f5a8eed3c315317b654acc0582aaad323a8e Author: Duo Zhang AuthorDate: Fri Jan 11 16:22:24 2019 +0800 HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection --- .../hadoop/hbase/client/AsyncConnectionImpl.java | 24 +- .../hbase/client/AsyncClusterConnection.java | 17 + .../hbase/client/AsyncClusterConnectionImpl.java | 80 +++ .../AsyncRegionReplicaReplayRetryingCaller.java| 146 .../hbase/client/AsyncRegionServerAdmin.java | 5 +- .../hbase/client/ClusterConnectionFactory.java | 2 +- .../hbase/protobuf/ReplicationProtbufUtil.java | 31 +- .../handler/RegionReplicaFlushHandler.java | 3 +- .../hbase/replication/ReplicationEndpoint.java | 35 +- .../RegionReplicaReplicationEndpoint.java | 782 +++-- .../regionserver/ReplicationSource.java| 2 +- .../hbase/client/TestAsyncTableNoncedRetry.java| 2 +- .../TestRegionReplicaReplicationEndpoint.java | 56 +- ...stRegionReplicaReplicationEndpointNoMaster.java | 99 ++- 14 files changed, 627 insertions(+), 657 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java index ce6bfac..f6a2149 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java @@ -55,7 +55,6 @@ import org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer; import org.apache.hadoop.hbase.shaded.protobuf.RequestConverter; import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService; -import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsMasterRunningResponse; @@ -65,7 +64,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterServ * The implementation of AsyncConnection. */ @InterfaceAudience.Private -class AsyncConnectionImpl implements AsyncClusterConnection { +class AsyncConnectionImpl implements AsyncConnection { private static final Logger LOG = LoggerFactory.getLogger(AsyncConnectionImpl.class); @@ -85,7 +84,7 @@ class AsyncConnectionImpl implements AsyncClusterConnection { private final int rpcTimeout; - private final RpcClient rpcClient; + protected final RpcClient rpcClient; final RpcControllerFactory rpcControllerFactory; @@ -160,16 +159,10 @@ class AsyncConnectionImpl implements AsyncClusterConnection { } // ditto - @Override - public NonceGenerator getNonceGenerator() { + NonceGenerator getNonceGenerator() { return nonceGenerator; } - @Override - public RpcClient getRpcClient() { -return rpcClient; - } - private ClientService.Interface createRegionServerStub(ServerName serverName) throws IOException { return ClientService.newStub(rpcClient.createRpcChannel(serverName, user, rpcTimeout)); } @@ -360,15 +353,4 @@ class AsyncConnectionImpl implements AsyncClusterConnection { return new HBaseHbck(MasterProtos.HbckService.newBlockingStub( rpcClient.createBlockingRpcChannel(masterServer, user, rpcTimeout)), rpcControllerFactory); } - - public AsyncRegionServerAdmin getRegionServerAdmin(ServerName serverName) { -return new AsyncRegionServerAdmin(serverName, this); - } - - @Override - public CompletableFuture flush(byte[] regionName, - boolean writeFlushWALMarker) { -RawAsyncHBaseAdmin admin = (RawAsyncHBaseAdmin) getAdmin(); -return admin.flushRegionInternal(regionName, writeFlushWALMarker); - } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java similarity index 72% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java rename to hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java index f1f64ca..0ad77ba 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java @@ -17,9 +17,13 @@ */ package org.apache.hadoop.hbase.client; +import java.util.List; import java.util.concurrent.CompletableFuture; +import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.ServerName; +import
[hbase] 06/08: HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection
This is an automated email from the ASF dual-hosted git repository. zhangduo pushed a commit to branch HBASE-21512 in repository https://gitbox.apache.org/repos/asf/hbase.git commit 6786c4952776d3798247bae0a42312e7cfbdca09 Author: Duo Zhang AuthorDate: Fri Jan 11 16:22:24 2019 +0800 HBASE-21671 Rewrite RegionReplicaReplicationEndpoint to use AsyncClusterConnection --- .../hadoop/hbase/client/AsyncConnectionImpl.java | 24 +- .../hbase/client/AsyncClusterConnection.java | 17 + .../hbase/client/AsyncClusterConnectionImpl.java | 80 +++ .../AsyncRegionReplicaReplayRetryingCaller.java| 146 .../hbase/client/AsyncRegionServerAdmin.java | 5 +- .../hbase/client/ClusterConnectionFactory.java | 2 +- .../hbase/protobuf/ReplicationProtbufUtil.java | 31 +- .../handler/RegionReplicaFlushHandler.java | 3 +- .../hbase/replication/ReplicationEndpoint.java | 35 +- .../RegionReplicaReplicationEndpoint.java | 783 +++-- .../regionserver/ReplicationSource.java| 2 +- .../hbase/client/TestAsyncTableNoncedRetry.java| 2 +- .../TestRegionReplicaReplicationEndpoint.java | 56 +- ...stRegionReplicaReplicationEndpointNoMaster.java | 99 ++- 14 files changed, 627 insertions(+), 658 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java index ce6bfac..f6a2149 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncConnectionImpl.java @@ -55,7 +55,6 @@ import org.apache.hbase.thirdparty.io.netty.util.HashedWheelTimer; import org.apache.hadoop.hbase.shaded.protobuf.RequestConverter; import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.AdminService; -import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.FlushRegionResponse; import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.ClientService; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos; import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.IsMasterRunningResponse; @@ -65,7 +64,7 @@ import org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterServ * The implementation of AsyncConnection. */ @InterfaceAudience.Private -class AsyncConnectionImpl implements AsyncClusterConnection { +class AsyncConnectionImpl implements AsyncConnection { private static final Logger LOG = LoggerFactory.getLogger(AsyncConnectionImpl.class); @@ -85,7 +84,7 @@ class AsyncConnectionImpl implements AsyncClusterConnection { private final int rpcTimeout; - private final RpcClient rpcClient; + protected final RpcClient rpcClient; final RpcControllerFactory rpcControllerFactory; @@ -160,16 +159,10 @@ class AsyncConnectionImpl implements AsyncClusterConnection { } // ditto - @Override - public NonceGenerator getNonceGenerator() { + NonceGenerator getNonceGenerator() { return nonceGenerator; } - @Override - public RpcClient getRpcClient() { -return rpcClient; - } - private ClientService.Interface createRegionServerStub(ServerName serverName) throws IOException { return ClientService.newStub(rpcClient.createRpcChannel(serverName, user, rpcTimeout)); } @@ -360,15 +353,4 @@ class AsyncConnectionImpl implements AsyncClusterConnection { return new HBaseHbck(MasterProtos.HbckService.newBlockingStub( rpcClient.createBlockingRpcChannel(masterServer, user, rpcTimeout)), rpcControllerFactory); } - - public AsyncRegionServerAdmin getRegionServerAdmin(ServerName serverName) { -return new AsyncRegionServerAdmin(serverName, this); - } - - @Override - public CompletableFuture flush(byte[] regionName, - boolean writeFlushWALMarker) { -RawAsyncHBaseAdmin admin = (RawAsyncHBaseAdmin) getAdmin(); -return admin.flushRegionInternal(regionName, writeFlushWALMarker); - } } diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java similarity index 72% rename from hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java rename to hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java index f1f64ca..0ad77ba 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/client/AsyncClusterConnection.java @@ -17,9 +17,13 @@ */ package org.apache.hadoop.hbase.client; +import java.util.List; import java.util.concurrent.CompletableFuture; +import org.apache.hadoop.hbase.RegionLocations; import org.apache.hadoop.hbase.ServerName; +import