use of org.apache.hadoop.hbase.shaded.protobuf.generated.RegionServerStatusProtos.SplitTableRegionRequest in project hbase by apache.
the class HRegionServer method requestRegionSplit.
@Override
public long requestRegionSplit(final HRegionInfo regionInfo, final byte[] splitRow) {
NonceGenerator ng = clusterConnection.getNonceGenerator();
final long nonceGroup = ng.getNonceGroup();
final long nonce = ng.newNonce();
long procId = -1;
SplitTableRegionRequest request = RequestConverter.buildSplitTableRegionRequest(regionInfo, splitRow, nonceGroup, nonce);
while (keepLooping()) {
RegionServerStatusService.BlockingInterface rss = rssStub;
try {
if (rss == null) {
createRegionServerStatusStub();
continue;
}
SplitTableRegionResponse response = rss.splitRegion(null, request);
//TODO: should we limit the retry number before quitting?
if (response == null || (procId = response.getProcId()) == -1) {
LOG.warn("Failed to split " + regionInfo + " retrying...");
continue;
}
break;
} catch (ServiceException se) {
// TODO: retry or just fail
IOException ioe = ProtobufUtil.getRemoteException(se);
LOG.info("Failed to split region, will retry", ioe);
if (rssStub == rss) {
rssStub = null;
}
}
}
return procId;
}
Aggregations