@Override
  public void close() throws SQLException {
    List<String> endpoints = new ArrayList<>();
    endpoints.add(writEndpoint);
    endpoints.addAll(readEndpoints);
    RequestDelegate<Void> delegate = new ParallelRequestDelegate<>(endpoints, queryTimeout);
    delegate.addRequest(
        () -> {
          if (writeStatement != null) {
            writeStatement.close();
          }
          return null;
        });

    readStatements.forEach(
        r ->
            delegate.addRequest(
                () -> {
                  if (r != null) {
                    try {
                      r.close();
                    } catch (SQLException e) {
                      // Ignore close exceptions
                    }
                  }
                  return null;
                }));
    delegate.requestAll();
    closed = true;
  }
The implementation of {@link ClusterTestStatement} in cluster test.
integration-test/src/main/java/org/apache/iotdb/itbase/runtime/ClusterTestStatement.java