Search in sources :

Example 1 with RemoveServersRequest

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

the class RSGroupAdminClient method removeServers.

/**
 * Remove decommissioned servers from rsgroup. 1. Sometimes we may find the server aborted due to
 * some hardware failure and we must offline the server for repairing. Or we need to move some
 * servers to join other clusters. So we need to remove these servers from the rsgroup. 2.
 * Dead/recovering/live servers will be disallowed.
 * @param servers set of servers to remove
 */
public void removeServers(Set<Address> servers) throws IOException {
    Set<HBaseProtos.ServerName> hostPorts = Sets.newHashSet();
    for (Address el : servers) {
        hostPorts.add(HBaseProtos.ServerName.newBuilder().setHostName(el.getHostname()).setPort(el.getPort()).build());
    }
    RemoveServersRequest request = RemoveServersRequest.newBuilder().addAllServers(hostPorts).build();
    try {
        stub.removeServers(null, request);
    } catch (ServiceException e) {
        throw ProtobufUtil.handleRemoteException(e);
    }
}
Also used : RemoveServersRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.RemoveServersRequest) Address(org.apache.hadoop.hbase.net.Address) ServiceException(org.apache.hbase.thirdparty.com.google.protobuf.ServiceException)

Aggregations

Address (org.apache.hadoop.hbase.net.Address)1 RemoveServersRequest (org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.RemoveServersRequest)1 ServiceException (org.apache.hbase.thirdparty.com.google.protobuf.ServiceException)1