Search in sources :

Example 1 with BalanceRequest

use of org.apache.hadoop.hbase.client.BalanceRequest in project hbase by apache.

the class MasterRpcServices method balanceRSGroup.

@Override
public BalanceRSGroupResponse balanceRSGroup(RpcController controller, BalanceRSGroupRequest request) throws ServiceException {
    BalanceRequest balanceRequest = ProtobufUtil.toBalanceRequest(request);
    BalanceRSGroupResponse.Builder builder = BalanceRSGroupResponse.newBuilder().setBalanceRan(false);
    LOG.info(server.getClientIdAuditPrefix() + " balance rsgroup, group=" + request.getRSGroupName());
    try {
        if (server.getMasterCoprocessorHost() != null) {
            server.getMasterCoprocessorHost().preBalanceRSGroup(request.getRSGroupName(), balanceRequest);
        }
        BalanceResponse response = server.getRSGroupInfoManager().balanceRSGroup(request.getRSGroupName(), balanceRequest);
        ProtobufUtil.populateBalanceRSGroupResponse(builder, response);
        if (server.getMasterCoprocessorHost() != null) {
            server.getMasterCoprocessorHost().postBalanceRSGroup(request.getRSGroupName(), balanceRequest, response);
        }
    } catch (IOException e) {
        throw new ServiceException(e);
    }
    return builder.build();
}
Also used : BalanceRequest(org.apache.hadoop.hbase.client.BalanceRequest) BalanceRSGroupResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.BalanceRSGroupResponse) BalanceResponse(org.apache.hadoop.hbase.client.BalanceResponse) ServiceException(org.apache.hbase.thirdparty.com.google.protobuf.ServiceException) IOException(java.io.IOException) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException)

Example 2 with BalanceRequest

use of org.apache.hadoop.hbase.client.BalanceRequest in project hbase by apache.

the class RSGroupAdminServiceImpl method balanceRSGroup.

@Override
public void balanceRSGroup(RpcController controller, BalanceRSGroupRequest request, RpcCallback<BalanceRSGroupResponse> done) {
    BalanceRequest balanceRequest = ProtobufUtil.toBalanceRequest(request);
    BalanceRSGroupResponse.Builder builder = BalanceRSGroupResponse.newBuilder().setBalanceRan(false);
    LOG.info(master.getClientIdAuditPrefix() + " balance rsgroup, group=" + request.getRSGroupName());
    try {
        if (master.getMasterCoprocessorHost() != null) {
            master.getMasterCoprocessorHost().preBalanceRSGroup(request.getRSGroupName(), balanceRequest);
        }
        BalanceResponse response = rsGroupInfoManager.balanceRSGroup(request.getRSGroupName(), balanceRequest);
        ProtobufUtil.populateBalanceRSGroupResponse(builder, response);
        if (master.getMasterCoprocessorHost() != null) {
            master.getMasterCoprocessorHost().postBalanceRSGroup(request.getRSGroupName(), balanceRequest, response);
        }
    } catch (IOException e) {
        CoprocessorRpcUtils.setControllerException(controller, e);
    }
    done.run(builder.build());
}
Also used : BalanceRequest(org.apache.hadoop.hbase.client.BalanceRequest) BalanceRSGroupResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.BalanceRSGroupResponse) BalanceResponse(org.apache.hadoop.hbase.client.BalanceResponse) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)2 BalanceRequest (org.apache.hadoop.hbase.client.BalanceRequest)2 BalanceResponse (org.apache.hadoop.hbase.client.BalanceResponse)2 BalanceRSGroupResponse (org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.BalanceRSGroupResponse)2 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)1 ServiceException (org.apache.hbase.thirdparty.com.google.protobuf.ServiceException)1