Search in sources :

Example 1 with SplitTableRegionRequest

use of org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SplitTableRegionRequest in project hbase by apache.

the class RawAsyncHBaseAdmin method split.

private CompletableFuture<Void> split(final RegionInfo hri, byte[] splitPoint) {
    CompletableFuture<Void> future = new CompletableFuture<>();
    TableName tableName = hri.getTable();
    final SplitTableRegionRequest request;
    try {
        request = RequestConverter.buildSplitTableRegionRequest(hri, splitPoint, ng.getNonceGroup(), ng.newNonce());
    } catch (DeserializationException e) {
        future.completeExceptionally(e);
        return future;
    }
    addListener(this.procedureCall(tableName, request, MasterService.Interface::splitRegion, SplitTableRegionResponse::getProcId, new SplitTableRegionProcedureBiConsumer(tableName)), (ret, err2) -> {
        if (err2 != null) {
            future.completeExceptionally(err2);
        } else {
            future.complete(ret);
        }
    });
    return future;
}
Also used : TableName(org.apache.hadoop.hbase.TableName) CompletableFuture(java.util.concurrent.CompletableFuture) SplitTableRegionRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SplitTableRegionRequest) MasterService(org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterService) DeserializationException(org.apache.hadoop.hbase.exceptions.DeserializationException)

Aggregations

CompletableFuture (java.util.concurrent.CompletableFuture)1 TableName (org.apache.hadoop.hbase.TableName)1 DeserializationException (org.apache.hadoop.hbase.exceptions.DeserializationException)1 MasterService (org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MasterService)1 SplitTableRegionRequest (org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.SplitTableRegionRequest)1