Search in sources :

Example 1 with RemoveServersResponse

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

the class MasterRpcServices method removeServers.

@Override
public RemoveServersResponse removeServers(RpcController controller, RemoveServersRequest request) throws ServiceException {
    RemoveServersResponse.Builder builder = RemoveServersResponse.newBuilder();
    Set<Address> servers = Sets.newHashSet();
    for (HBaseProtos.ServerName el : request.getServersList()) {
        servers.add(Address.fromParts(el.getHostName(), el.getPort()));
    }
    LOG.info(server.getClientIdAuditPrefix() + " remove decommissioned servers from rsgroup: " + servers);
    try {
        if (server.getMasterCoprocessorHost() != null) {
            server.getMasterCoprocessorHost().preRemoveServers(servers);
        }
        server.getRSGroupInfoManager().removeServers(servers);
        if (server.getMasterCoprocessorHost() != null) {
            server.getMasterCoprocessorHost().postRemoveServers(servers);
        }
    } 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) RemoveServersResponse(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.RemoveServersResponse) 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 RemoveServersResponse (org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.RemoveServersResponse)1 ServiceException (org.apache.hbase.thirdparty.com.google.protobuf.ServiceException)1