HBASE-22282 Should deal with error in the callback of RawAsyncHBaseAdmin.splitRegion methods

This commit is contained in:
zhangduo 2019-04-21 23:03:05 +08:00 committed by Duo Zhang
parent 8207886d07
commit 16cc2a3dfd
1 changed files with 8 additions and 0 deletions

View File

@ -1314,6 +1314,10 @@ class RawAsyncHBaseAdmin implements AsyncAdmin {
public CompletableFuture<Void> splitRegion(byte[] regionName) {
CompletableFuture<Void> future = new CompletableFuture<>();
addListener(getRegionLocation(regionName), (location, err) -> {
if (err != null) {
future.completeExceptionally(err);
return;
}
RegionInfo regionInfo = location.getRegion();
if (regionInfo.getReplicaId() != RegionInfo.DEFAULT_REPLICA_ID) {
future
@ -1344,6 +1348,10 @@ class RawAsyncHBaseAdmin implements AsyncAdmin {
"splitPoint is null. If you don't specify a splitPoint, use splitRegion(byte[]) instead");
CompletableFuture<Void> future = new CompletableFuture<>();
addListener(getRegionLocation(regionName), (location, err) -> {
if (err != null) {
future.completeExceptionally(err);
return;
}
RegionInfo regionInfo = location.getRegion();
if (regionInfo.getReplicaId() != RegionInfo.DEFAULT_REPLICA_ID) {
future