use of org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.OpenRegionRequest in project hbase by apache.
the class ServerManager method sendRegionOpen.
// RPC methods to region servers
/**
* Sends an OPEN RPC to the specified server to open the specified region.
* <p>
* Open should not fail but can if server just crashed.
* <p>
* @param server server to open a region
* @param region region to open
* @param favoredNodes
*/
public RegionOpeningState sendRegionOpen(final ServerName server, HRegionInfo region, List<ServerName> favoredNodes) throws IOException {
AdminService.BlockingInterface admin = getRsAdmin(server);
if (admin == null) {
throw new IOException("Attempting to send OPEN RPC to server " + server.toString() + " failed because no RPC connection found to this server");
}
OpenRegionRequest request = RequestConverter.buildOpenRegionRequest(server, region, favoredNodes, (RecoveryMode.LOG_REPLAY == this.master.getMasterWalManager().getLogRecoveryMode()));
try {
OpenRegionResponse response = admin.openRegion(null, request);
return ResponseConverter.getRegionOpeningState(response);
} catch (ServiceException se) {
checkForRSznode(server, se);
throw ProtobufUtil.getRemoteException(se);
}
}
use of org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.OpenRegionRequest in project hbase by apache.
the class ServerManager method sendRegionOpen.
/**
* Sends an OPEN RPC to the specified server to open the specified region.
* <p>
* Open should not fail but can if server just crashed.
* <p>
* @param server server to open a region
* @param regionOpenInfos info of a list of regions to open
* @return a list of region opening states
*/
public List<RegionOpeningState> sendRegionOpen(ServerName server, List<Pair<HRegionInfo, List<ServerName>>> regionOpenInfos) throws IOException {
AdminService.BlockingInterface admin = getRsAdmin(server);
if (admin == null) {
throw new IOException("Attempting to send OPEN RPC to server " + server.toString() + " failed because no RPC connection found to this server");
}
OpenRegionRequest request = RequestConverter.buildOpenRegionRequest(server, regionOpenInfos, (RecoveryMode.LOG_REPLAY == this.master.getMasterWalManager().getLogRecoveryMode()));
try {
OpenRegionResponse response = admin.openRegion(null, request);
return ResponseConverter.getRegionOpeningStateList(response);
} catch (ServiceException se) {
checkForRSznode(server, se);
throw ProtobufUtil.getRemoteException(se);
}
}
Aggregations