HBASE-22282 Should deal with error in the callback of RawAsyncHBaseAdmin.splitRegion methods
This commit is contained in:
parent
c015c6cac0
commit
38c7ab59a2
|
@ -1371,6 +1371,10 @@ class RawAsyncHBaseAdmin implements AsyncAdmin {
|
||||||
public CompletableFuture<Void> splitRegion(byte[] regionName) {
|
public CompletableFuture<Void> splitRegion(byte[] regionName) {
|
||||||
CompletableFuture<Void> future = new CompletableFuture<>();
|
CompletableFuture<Void> future = new CompletableFuture<>();
|
||||||
addListener(getRegionLocation(regionName), (location, err) -> {
|
addListener(getRegionLocation(regionName), (location, err) -> {
|
||||||
|
if (err != null) {
|
||||||
|
future.completeExceptionally(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
RegionInfo regionInfo = location.getRegion();
|
RegionInfo regionInfo = location.getRegion();
|
||||||
if (regionInfo.getReplicaId() != RegionInfo.DEFAULT_REPLICA_ID) {
|
if (regionInfo.getReplicaId() != RegionInfo.DEFAULT_REPLICA_ID) {
|
||||||
future
|
future
|
||||||
|
@ -1401,6 +1405,10 @@ class RawAsyncHBaseAdmin implements AsyncAdmin {
|
||||||
"splitPoint is null. If you don't specify a splitPoint, use splitRegion(byte[]) instead");
|
"splitPoint is null. If you don't specify a splitPoint, use splitRegion(byte[]) instead");
|
||||||
CompletableFuture<Void> future = new CompletableFuture<>();
|
CompletableFuture<Void> future = new CompletableFuture<>();
|
||||||
addListener(getRegionLocation(regionName), (location, err) -> {
|
addListener(getRegionLocation(regionName), (location, err) -> {
|
||||||
|
if (err != null) {
|
||||||
|
future.completeExceptionally(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
RegionInfo regionInfo = location.getRegion();
|
RegionInfo regionInfo = location.getRegion();
|
||||||
if (regionInfo.getReplicaId() != RegionInfo.DEFAULT_REPLICA_ID) {
|
if (regionInfo.getReplicaId() != RegionInfo.DEFAULT_REPLICA_ID) {
|
||||||
future
|
future
|
||||||
|
|
Loading…
Reference in New Issue