use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier in project hbase by apache.
the class ProtobufUtil method buildGetStoreFileRequest.
/**
* Create a protocol buffer GetStoreFileRequest for a given region name
*
* @param regionName the name of the region to get info
* @param family the family to get store file list
* @return a protocol buffer GetStoreFileRequest
*/
public static GetStoreFileRequest buildGetStoreFileRequest(final byte[] regionName, final byte[] family) {
GetStoreFileRequest.Builder builder = GetStoreFileRequest.newBuilder();
RegionSpecifier region = RequestConverter.buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionName);
builder.setRegion(region);
builder.addFamily(UnsafeByteOperations.unsafeWrap(family));
return builder.build();
}
use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier 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();
}
use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier in project hbase by apache.
the class ProtobufUtil method buildCloseRegionRequest.
/**
* Create a CloseRegionRequest for a given encoded region name
*
* @param encodedRegionName the name of the region to close
* @return a CloseRegionRequest
*/
public static CloseRegionRequest buildCloseRegionRequest(ServerName server, final String encodedRegionName) {
CloseRegionRequest.Builder builder = CloseRegionRequest.newBuilder();
RegionSpecifier region = RequestConverter.buildRegionSpecifier(RegionSpecifierType.ENCODED_REGION_NAME, Bytes.toBytes(encodedRegionName));
builder.setRegion(region);
if (server != null) {
builder.setServerStartCode(server.getStartcode());
}
return builder.build();
}
use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier in project hbase by apache.
the class RequestConverter method buildGetRegionInfoRequest.
/**
* Create a protocol buffer GetRegionInfoRequest for a given region name
*
* @param regionName the name of the region to get info
* @param includeCompactionState indicate if the compaction state is requested
* @return a protocol buffer GetRegionInfoRequest
*/
public static GetRegionInfoRequest buildGetRegionInfoRequest(final byte[] regionName, final boolean includeCompactionState) {
GetRegionInfoRequest.Builder builder = GetRegionInfoRequest.newBuilder();
RegionSpecifier region = buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionName);
builder.setRegion(region);
if (includeCompactionState) {
builder.setCompactionState(includeCompactionState);
}
return builder.build();
}
use of org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.RegionSpecifier in project hbase by apache.
the class RequestConverter method getRegionActionBuilderWithRegion.
private static RegionAction.Builder getRegionActionBuilderWithRegion(final RegionAction.Builder regionActionBuilder, final byte[] regionName) {
RegionSpecifier region = buildRegionSpecifier(RegionSpecifierType.REGION_NAME, regionName);
regionActionBuilder.setRegion(region);
return regionActionBuilder;
}
Aggregations