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();
}
Aggregations