Search in sources :

Example 1 with MoveServersRequest

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

the class RSGroupAdminClient method moveServers.

/**
 * Move given set of servers to the specified target RegionServer group.
 */
public void moveServers(Set<Address> servers, String targetGroup) throws IOException {
    Set<HBaseProtos.ServerName> hostPorts = Sets.newHashSet();
    for (Address el : servers) {
        hostPorts.add(HBaseProtos.ServerName.newBuilder().setHostName(el.getHostname()).setPort(el.getPort()).build());
    }
    MoveServersRequest request = MoveServersRequest.newBuilder().setTargetGroup(targetGroup).addAllServers(hostPorts).build();
    try {
        stub.moveServers(null, request);
    } catch (ServiceException e) {
        throw ProtobufUtil.handleRemoteException(e);
    }
}
Also used : Address(org.apache.hadoop.hbase.net.Address) ServiceException(org.apache.hbase.thirdparty.com.google.protobuf.ServiceException) MoveServersRequest(org.apache.hadoop.hbase.shaded.protobuf.generated.RSGroupAdminProtos.MoveServersRequest)

Aggregations

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