HBASE-22282 Should deal with error in the callback of RawAsyncHBaseAdmin.splitRegion methods
This commit is contained in:
parent
8207886d07
commit
16cc2a3dfd
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue