use of org.apache.hadoop.hbase.ipc.QosPriority in project hbase by apache.
the class RSRpcServices method getOnlineRegion.
@Override
@QosPriority(priority = HConstants.ADMIN_QOS)
public GetOnlineRegionResponse getOnlineRegion(final RpcController controller, final GetOnlineRegionRequest request) throws ServiceException {
try {
checkOpen();
requestCount.increment();
Map<String, Region> onlineRegions = regionServer.onlineRegions;
List<HRegionInfo> list = new ArrayList<>(onlineRegions.size());
for (Region region : onlineRegions.values()) {
list.add(region.getRegionInfo());
}
Collections.sort(list);
return ResponseConverter.buildGetOnlineRegionResponse(list);
} catch (IOException ie) {
throw new ServiceException(ie);
}
}
use of org.apache.hadoop.hbase.ipc.QosPriority in project hbase by apache.
the class RSRpcServices method getRegionInfo.
@Override
@QosPriority(priority = HConstants.ADMIN_QOS)
public GetRegionInfoResponse getRegionInfo(final RpcController controller, final GetRegionInfoRequest request) throws ServiceException {
try {
checkOpen();
requestCount.increment();
Region region = getRegion(request.getRegion());
HRegionInfo info = region.getRegionInfo();
GetRegionInfoResponse.Builder builder = GetRegionInfoResponse.newBuilder();
builder.setRegionInfo(HRegionInfo.convert(info));
if (request.hasCompactionState() && request.getCompactionState()) {
builder.setCompactionState(region.getCompactionState());
}
builder.setIsRecovering(region.isRecovering());
return builder.build();
} catch (IOException ie) {
throw new ServiceException(ie);
}
}
Aggregations