Search in sources :

Example 16 with QosPriority

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);
    }
}
Also used : HRegionInfo(org.apache.hadoop.hbase.HRegionInfo) ServiceException(org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException) ArrayList(java.util.ArrayList) ByteString(org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString) InterruptedIOException(java.io.InterruptedIOException) IOException(java.io.IOException) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException) HBaseIOException(org.apache.hadoop.hbase.HBaseIOException) QosPriority(org.apache.hadoop.hbase.ipc.QosPriority)

Example 17 with QosPriority

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);
    }
}
Also used : HRegionInfo(org.apache.hadoop.hbase.HRegionInfo) ServiceException(org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException) GetRegionInfoResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse) InterruptedIOException(java.io.InterruptedIOException) IOException(java.io.IOException) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException) HBaseIOException(org.apache.hadoop.hbase.HBaseIOException) QosPriority(org.apache.hadoop.hbase.ipc.QosPriority)

Aggregations

QosPriority (org.apache.hadoop.hbase.ipc.QosPriority)17 IOException (java.io.IOException)15 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)15 ServiceException (org.apache.hadoop.hbase.shaded.com.google.protobuf.ServiceException)15 InterruptedIOException (java.io.InterruptedIOException)13 HBaseIOException (org.apache.hadoop.hbase.HBaseIOException)13 ByteString (org.apache.hadoop.hbase.shaded.com.google.protobuf.ByteString)8 ArrayList (java.util.ArrayList)5 HRegionInfo (org.apache.hadoop.hbase.HRegionInfo)4 TableName (org.apache.hadoop.hbase.TableName)4 CellScanner (org.apache.hadoop.hbase.CellScanner)2 DroppedSnapshotException (org.apache.hadoop.hbase.DroppedSnapshotException)2 HBaseRpcController (org.apache.hadoop.hbase.ipc.HBaseRpcController)2 GetRegionInfoResponse (org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse)2 WALEntry (org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.WALEntry)2 HashMap (java.util.HashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 HTableDescriptor (org.apache.hadoop.hbase.HTableDescriptor)1 NotServingRegionException (org.apache.hadoop.hbase.NotServingRegionException)1 ServerName (org.apache.hadoop.hbase.ServerName)1