public void moveServersAndTables(Set<Address> servers, Set<TableName> tables, String targetGroup)
    throws IOException {
    MoveServersAndTablesRequest.Builder builder =
      MoveServersAndTablesRequest.newBuilder().setTargetGroup(targetGroup);
    for (Address el : servers) {
      builder.addServers(HBaseProtos.ServerName.newBuilder().setHostName(el.getHostname())
        .setPort(el.getPort()).build());
    }
    for (TableName tableName : tables) {
      builder.addTableName(ProtobufUtil.toProtoTableName(tableName));
      if (!admin.tableExists(tableName)) {
        throw new TableNotFoundException(tableName);
      }
    }
    try {
      stub.moveServersAndTables(null, builder.build());
    } catch (ServiceException e) {
      throw ProtobufUtil.handleRemoteException(e);
    }
  }
Move given set of servers and tables to the specified target RegionServer group.
@param servers     set of servers to move
@param tables      set of tables to move
@param targetGroup the target group name
@throws IOException if moving the server and tables fail
hbase-server/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupAdminClient.java