Search in sources :

Example 1 with CloseRegionForSplitOrMergeRequest

use of org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CloseRegionForSplitOrMergeRequest in project hbase by apache.

the class ProtobufUtil method buildCloseRegionForSplitOrMergeRequest.

/**
   * Create a CloseRegionForSplitOrMergeRequest for given regions
   *
   * @param server the RS server that hosts the region
   * @param regionsToClose the info of the regions to close
   * @return a CloseRegionForSplitRequest
   */
public static CloseRegionForSplitOrMergeRequest buildCloseRegionForSplitOrMergeRequest(final ServerName server, final HRegionInfo... regionsToClose) {
    CloseRegionForSplitOrMergeRequest.Builder builder = CloseRegionForSplitOrMergeRequest.newBuilder();
    for (int i = 0; i < regionsToClose.length; i++) {
        RegionSpecifier regionToClose = RequestConverter.buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionsToClose[i].getRegionName());
        builder.addRegion(regionToClose);
    }
    return builder.build();
}
Also used : CloseRegionForSplitOrMergeRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CloseRegionForSplitOrMergeRequest) RegionSpecifier(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier)

Aggregations

CloseRegionForSplitOrMergeRequest (org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.CloseRegionForSplitOrMergeRequest)1 RegionSpecifier (org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier)1