Search in sources :

Example 1 with GetRSGroupInfoOfServerResponse

use of org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.GetRSGroupInfoOfServerResponse in project hbase by apache.

the class MasterRpcServices method getRSGroupInfoOfServer.

@Override
public GetRSGroupInfoOfServerResponse getRSGroupInfoOfServer(RpcController controller, GetRSGroupInfoOfServerRequest request) throws ServiceException {
    Address hp = Address.fromParts(request.getServer().getHostName(), request.getServer().getPort());
    LOG.info(server.getClientIdAuditPrefix() + " initiates rsgroup info retrieval, server=" + hp);
    try {
        if (server.getMasterCoprocessorHost() != null) {
            server.getMasterCoprocessorHost().preGetRSGroupInfoOfServer(hp);
        }
        RSGroupInfo rsGroupInfo = server.getRSGroupInfoManager().getRSGroupOfServer(hp);
        GetRSGroupInfoOfServerResponse resp;
        if (rsGroupInfo != null) {
            resp = GetRSGroupInfoOfServerResponse.newBuilder().setRSGroupInfo(ProtobufUtil.toProtoGroupInfo(rsGroupInfo)).build();
        } else {
            resp = GetRSGroupInfoOfServerResponse.getDefaultInstance();
        }
        if (server.getMasterCoprocessorHost() != null) {
            server.getMasterCoprocessorHost().postGetRSGroupInfoOfServer(hp);
        }
        return resp;
    } catch (IOException e) {
        throw new ServiceException(e);
    }
}
Also used : Address(org.apache.hadoop.hbase.net.Address) InetAddress(java.net.InetAddress) ServiceException(org.apache.hbase.thirdparty.com.google.protobuf.ServiceException) RSGroupInfo(org.apache.hadoop.hbase.rsgroup.RSGroupInfo) GetRSGroupInfoOfServerResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.GetRSGroupInfoOfServerResponse) IOException(java.io.IOException) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException)

Example 2 with GetRSGroupInfoOfServerResponse

use of org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.GetRSGroupInfoOfServerResponse in project hbase by apache.

the class RSGroupAdminServiceImpl method getRSGroupInfoOfServer.

@Override
public void getRSGroupInfoOfServer(RpcController controller, GetRSGroupInfoOfServerRequest request, RpcCallback<GetRSGroupInfoOfServerResponse> done) {
    GetRSGroupInfoOfServerResponse.Builder builder = GetRSGroupInfoOfServerResponse.newBuilder();
    Address hp = Address.fromParts(request.getServer().getHostName(), request.getServer().getPort());
    LOG.info(master.getClientIdAuditPrefix() + " initiates rsgroup info retrieval, server=" + hp);
    try {
        if (master.getMasterCoprocessorHost() != null) {
            master.getMasterCoprocessorHost().preGetRSGroupInfoOfServer(hp);
        }
        RSGroupInfo info = rsGroupInfoManager.getRSGroupOfServer(hp);
        if (info != null) {
            builder.setRSGroupInfo(ProtobufUtil.toProtoGroupInfo(fillTables(info)));
        }
        if (master.getMasterCoprocessorHost() != null) {
            master.getMasterCoprocessorHost().postGetRSGroupInfoOfServer(hp);
        }
    } catch (IOException e) {
        CoprocessorRpcUtils.setControllerException(controller, e);
    }
    done.run(builder.build());
}
Also used : Address(org.apache.hadoop.hbase.net.Address) GetRSGroupInfoOfServerResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.GetRSGroupInfoOfServerResponse) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)2 Address (org.apache.hadoop.hbase.net.Address)2 GetRSGroupInfoOfServerResponse (org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.GetRSGroupInfoOfServerResponse)2 InetAddress (java.net.InetAddress)1 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)1 RSGroupInfo (org.apache.hadoop.hbase.rsgroup.RSGroupInfo)1 ServiceException (org.apache.hbase.thirdparty.com.google.protobuf.ServiceException)1