@Override
  public CompletableFuture<Void> setRSGroup(Set<TableName> tables, String groupName) {
    CompletableFuture<Void> future = new CompletableFuture<>();
    for (TableName tableName : tables) {
      addListener(tableExists(tableName), (exist, err) -> {
        if (err != null) {
          future.completeExceptionally(err);
          return;
        }
        if (!exist) {
          future.completeExceptionally(new TableNotFoundException(tableName));
          return;
        }
      });
    }
    addListener(listTableDescriptors(new ArrayList<>(tables)), (tableDescriptions, err) -> {
      if (err != null) {
        future.completeExceptionally(err);
        return;
      }
      if (tableDescriptions == null || tableDescriptions.isEmpty()) {
        future.complete(null);
        return;
      }
      List<TableDescriptor> newTableDescriptors = new ArrayList<>();
      for (TableDescriptor td : tableDescriptions) {
        newTableDescriptors
          .add(TableDescriptorBuilder.newBuilder(td).setRegionServerGroup(groupName).build());
      }
      addListener(
        CompletableFuture.allOf(
          newTableDescriptors.stream().map(this::modifyTable).toArray(CompletableFuture[]::new)),
        (v, e) -> {
          if (e != null) {
            future.completeExceptionally(e);
          } else {
            future.complete(v);
          }
        });
    });
    return future;
  }
Set the table's replication switch if the table's replication switch is already not set.
@param tableName name of the table
@param enableRep is replication switch enable or disable
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RawAsyncHBaseAdmin.java