use of org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.BalanceRSGroupResponse 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();
}
use of org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.BalanceRSGroupResponse 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());
}
Aggregations