Search in sources :

Example 1 with MoveServersRequest

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

the class RSGroupAdminClient method moveServers.

@Override
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(com.google.protobuf.ServiceException) MoveServersRequest(org.apache.hadoop.hbase.protobuf.generated.RSGroupAdminProtos.MoveServersRequest)

Aggregations

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