Search in sources :

Example 1 with MoveServersResponse

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

the class MasterRpcServices method moveServers.

@Override
public MoveServersResponse moveServers(RpcController controller, MoveServersRequest request) throws ServiceException {
    Set<Address> hostPorts = Sets.newHashSet();
    MoveServersResponse.Builder builder = MoveServersResponse.newBuilder();
    for (HBaseProtos.ServerName el : request.getServersList()) {
        hostPorts.add(Address.fromParts(el.getHostName(), el.getPort()));
    }
    LOG.info(server.getClientIdAuditPrefix() + " move servers " + hostPorts + " to rsgroup " + request.getTargetGroup());
    try {
        if (server.getMasterCoprocessorHost() != null) {
            server.getMasterCoprocessorHost().preMoveServers(hostPorts, request.getTargetGroup());
        }
        server.getRSGroupInfoManager().moveServers(hostPorts, request.getTargetGroup());
        if (server.getMasterCoprocessorHost() != null) {
            server.getMasterCoprocessorHost().postMoveServers(hostPorts, request.getTargetGroup());
        }
    } catch (IOException e) {
        throw new ServiceException(e);
    }
    return builder.build();
}
Also used : Address(org.apache.hadoop.hbase.net.Address) InetAddress(java.net.InetAddress) ServiceException(org.apache.hbase.thirdparty.com.google.protobuf.ServiceException) MoveServersResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.MoveServersResponse) IOException(java.io.IOException) DoNotRetryIOException(org.apache.hadoop.hbase.DoNotRetryIOException) HBaseProtos(org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos)

Aggregations

IOException (java.io.IOException)1 InetAddress (java.net.InetAddress)1 DoNotRetryIOException (org.apache.hadoop.hbase.DoNotRetryIOException)1 Address (org.apache.hadoop.hbase.net.Address)1 HBaseProtos (org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos)1 MoveServersResponse (org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.MoveServersResponse)1 ServiceException (org.apache.hbase.thirdparty.com.google.protobuf.ServiceException)1