use of org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos.MoveRegionResponse in project hbase by apache.
the class MasterRpcServices method moveRegion.
@Override
public MoveRegionResponse moveRegion(RpcController controller, MoveRegionRequest req) throws ServiceException {
final byte[] encodedRegionName = req.getRegion().getValue().toByteArray();
RegionSpecifierType type = req.getRegion().getType();
final byte[] destServerName = (req.hasDestServerName()) ? Bytes.toBytes(ProtobufUtil.toServerName(req.getDestServerName()).getServerName()) : null;
MoveRegionResponse mrr = MoveRegionResponse.newBuilder().build();
if (type != RegionSpecifierType.ENCODED_REGION_NAME) {
LOG.warn("moveRegion specifier type: expected: " + RegionSpecifierType.ENCODED_REGION_NAME + " actual: " + type);
}
try {
master.checkInitialized();
master.move(encodedRegionName, destServerName);
} catch (IOException ioe) {
throw new ServiceException(ioe);
}
return mrr;
}
Aggregations