目录
Kent Yao

[SPARK-55837][UI] Render Environment page tables client-side via REST API

What changes were proposed in this pull request?

Switches the Environment page from server-side Scala XML table rendering to client-side DataTables populated via the existing REST API endpoint (/api/v1/applications/{appId}/environment).

EnvironmentPage.scala:

  • Remove all UIUtils.listingTable calls and server-side data preparation
  • Remove badge counts from tabs (JS adds them dynamically after data loads)
  • Add loading spinner placeholders in each tab pane
  • Include environmentpage.js and utils.js as ES modules
  • Enable DataTables via useDataTables = true in headerSparkPage

environmentpage.js:

  • Rewrite as ES module importing getStandAloneAppId and setDataTableDefaults from utils.js
  • Fetch environment data via REST API on page load
  • Create DataTables with sorting, searching, and pagination for each section
  • Use deferRender: true for performance with 1000+ row tables (e.g., Hadoop Properties)
  • Format Resource Profiles with structured executor/task resource text
  • Dynamically update badge counts on tabs after data loads
  • Persist active tab state in localStorage
  • Adjust DataTable columns on tab switch for correct rendering in hidden panes

Why are the changes needed?

This continues the modernization of the Spark UI Environment page started in SPARK-55834. Moving to client-side rendering:

  • Reduces server-side HTML payload significantly (especially for 1000+ Hadoop properties)
  • Adds built-in search, sort, and pagination via DataTables
  • Follows the same pattern used by the Executors page
  • Improves user experience for environments with many properties

Does this PR introduce any user-facing change?

Yes. The Environment page tables now render client-side with DataTables, providing:

  • Built-in search/filter across all columns
  • Column sorting
  • Pagination (important for large property sets)
  • Loading spinners while data fetches

How was this patch tested?

  • ./dev/lint-js — passed
  • ./dev/scalastyle — passed
  • ./build/sbt core/compile — passed

Was this patch authored or co-authored using generative AI tooling?

Yes, GitHub Copilot.

Closes #54632 from yaooqinn/SPARK-55837.

Authored-by: Kent Yao kentyao@microsoft.com Signed-off-by: Kent Yao kentyao@microsoft.com

1个月前47333次提交
#x27; | grep -v 'org/apache/spark' | grep -v 'org/sparkproject' | grep -v 'META-INF' javax/annotation/CheckForNull.class javax/annotation/CheckForSigned.class ... ``` after (this PR) ``` $ jar tf jars/connect-repl/spark-connect-client-jvm_2.13-4.2.0-SNAPSHOT.jar | grep '.class
#x27; | grep -v 'org/apache/spark' | grep -v 'org/sparkproject' | grep -v 'META-INF' <no-output> ``` ### Does this PR introduce _any_ user-facing change? Reduce potential class conflict issues for users who use `spark-connect-jvm-client`. ### How was this patch tested? Manually checked, see the above section. Also, manually tested the Connect Server, and Connect JVM client via BeeLine. ``` $ dev/make-distribution.sh --tgz --name guava -Pyarn -Pkubernetes -Phadoop-3 -Phive -Phive-thriftserver $ cd dist $ SPARK_NO_DAEMONIZE=1 sbin/start-connect-server.sh ``` ``` $ SPARK_CONNECT_BEELINE=1 bin/beeline -u jdbc:sc://localhost:15002 -e "select 'Hello, Spark Connect!', version() as server_version;" WARNING: Using incubator modules: jdk.incubator.vector Connecting to jdbc:sc://localhost:15002 Connected to: Apache Spark Connect Server (version 4.2.0-SNAPSHOT) Driver: Apache Spark Connect JDBC Driver (version 4.2.0-SNAPSHOT) Error: Requested transaction isolation level REPEATABLE_READ is not supported (state=,code=0) Using Spark's default log4j profile: org/apache/spark/log4j2-defaults.properties 25/11/05 13:30:03 WARN Utils: Your hostname, H27212-MAC-01.local, resolves to a loopback address: 127.0.0.1; using 10.242.159.140 instead (on interface en0) 25/11/05 13:30:03 WARN Utils: Set SPARK_LOCAL_IP if you need to bind to another address +------------------------+-------------------------------------------------+ | Hello, Spark Connect! | server_version | +------------------------+-------------------------------------------------+ | Hello, Spark Connect! | 4.2.0 0ea7f5599c5dcc169b0724caa48d5530c39dbefb | +------------------------+-------------------------------------------------+ 1 row selected (0.09 seconds) Beeline version 2.3.10 by Apache Hive Closing: 0: jdbc:sc://localhost:15002 ``` ### Was this patch authored or co-authored using generative AI tooling? No. Closes #52873 from pan3793/guava-govern. Authored-by: Cheng Pan <chengpan@apache.org> Signed-off-by: yangjie01 <yangjie01@baidu.com> " href="/mirrors/spark/commits/a8d128c7ac">[SPARK-54190][BUILD] Guava dependency governance
5个月前
  • bin[SPARK-53149][CORE] Fix testing whether BeeLine process run in background6个月前
  • binder[SPARK-54882][PYTHON] Remove legacy PYARROW_IGNORE_TIMEZONE4个月前
  • build[SPARK-55710][BUILD] Use Google Mirror of Maven Central for SBT bootstrap2个月前
  • common[SPARK-55826][SQL] Rename `_LEGACY_ERROR_TEMP_0006` to `MERGE_INSERT_VALUE_COUNT_MISMATCH`1个月前
  • conf[SPARK-55237][SQL] Suppress annoying messages when looking up nonexistent DBs3个月前
  • connector[SPARK-55699][SS][FOLLOWUP] Inconsistent reading of LowLatencyClock when used together with ManualClock2个月前
  • core[SPARK-55837][UI] Render Environment page tables client-side via REST API1个月前
  • data[SPARK-43612][PYTHON][CONNECT][FOLLOW-UP] Copy dependent data files to data directory2年前
  • dev[SPARK-55841][BUILD] Upgrade jackson to 2.21.11个月前
  • docs[SPARK-55831][YARN] Support `spark.yarn.am.defaultJavaOptions`1个月前
  • examples[SPARK-55586][EXAMPLE] Add `jdbc.py` Example2个月前
  • graphx[SPARK-54133][BUILD] Setting version to 4.2.0-SNAPSHOT6个月前
  • hadoop-cloud[SPARK-54133][BUILD] Setting version to 4.2.0-SNAPSHOT6个月前
  • launcher[SPARK-55670][BUILD] Add `-Dio.netty.noUnsafe=false` to enable Java 25 support2个月前
  • licenses-binary
  • #x27; | grep -v 'org/apache/spark' | grep -v 'org/sparkproject' | grep -v 'META-INF' javax/annotation/CheckForNull.class javax/annotation/CheckForSigned.class ... ``` after (this PR) ``` $ jar tf jars/connect-repl/spark-connect-client-jvm_2.13-4.2.0-SNAPSHOT.jar | grep '.class
    #x27; | grep -v 'org/apache/spark' | grep -v 'org/sparkproject' | grep -v 'META-INF' <no-output> ``` ### Does this PR introduce _any_ user-facing change? Reduce potential class conflict issues for users who use `spark-connect-jvm-client`. ### How was this patch tested? Manually checked, see the above section. Also, manually tested the Connect Server, and Connect JVM client via BeeLine. ``` $ dev/make-distribution.sh --tgz --name guava -Pyarn -Pkubernetes -Phadoop-3 -Phive -Phive-thriftserver $ cd dist $ SPARK_NO_DAEMONIZE=1 sbin/start-connect-server.sh ``` ``` $ SPARK_CONNECT_BEELINE=1 bin/beeline -u jdbc:sc://localhost:15002 -e "select 'Hello, Spark Connect!', version() as server_version;" WARNING: Using incubator modules: jdk.incubator.vector Connecting to jdbc:sc://localhost:15002 Connected to: Apache Spark Connect Server (version 4.2.0-SNAPSHOT) Driver: Apache Spark Connect JDBC Driver (version 4.2.0-SNAPSHOT) Error: Requested transaction isolation level REPEATABLE_READ is not supported (state=,code=0) Using Spark's default log4j profile: org/apache/spark/log4j2-defaults.properties 25/11/05 13:30:03 WARN Utils: Your hostname, H27212-MAC-01.local, resolves to a loopback address: 127.0.0.1; using 10.242.159.140 instead (on interface en0) 25/11/05 13:30:03 WARN Utils: Set SPARK_LOCAL_IP if you need to bind to another address +------------------------+-------------------------------------------------+ | Hello, Spark Connect! | server_version | +------------------------+-------------------------------------------------+ | Hello, Spark Connect! | 4.2.0 0ea7f5599c5dcc169b0724caa48d5530c39dbefb | +------------------------+-------------------------------------------------+ 1 row selected (0.09 seconds) Beeline version 2.3.10 by Apache Hive Closing: 0: jdbc:sc://localhost:15002 ``` ### Was this patch authored or co-authored using generative AI tooling? No. Closes #52873 from pan3793/guava-govern. Authored-by: Cheng Pan <chengpan@apache.org> Signed-off-by: yangjie01 <yangjie01@baidu.com> " href="/mirrors/spark/commits/a8d128c7ac">[SPARK-54190][BUILD] Guava dependency governance
    5个月前
  • licenses[SPARK-49234][BUILD] Upgrade `xz` to `1.10`1年前
  • mllib-local[SPARK-55745][TESTS] Add GHA benchmark reports for JDK 252个月前
  • mllib[SPARK-54807][SQL] Allow qualified names for built-in and session functions2个月前
  • project[SPARK-55841][BUILD][FOLLOWUP] Update `SparkBuild.scala` consistently1个月前
  • python[SPARK-55821][PYTHON] Enforce keyword-only arguments in serializer __init__ methods1个月前
  • repl[SPARK-47086][SPARK-48022][BUILD][CORE][WEBUI] Upgrade Jetty to 12.1.5, Jersey to 3.1.11 and Servlet to 6.03个月前
  • resource-managers[SPARK-55831][YARN] Support `spark.yarn.am.defaultJavaOptions`1个月前
  • sbin[SPARK-51146][INFRA][FOLLOW-UP] Explicitly disable Spark Connect in server side scripts1年前
  • sql[SPARK-55832][SQL][TESTS] Reduce periodic GC interval in ThriftServerQueryTestSuite to mitigate OOM1个月前
  • streaming[SPARK-55772][UI] Replace jQuery show/hide with Bootstrap 5 d-none utility class1个月前
  • tools[SPARK-54133][BUILD] Setting version to 4.2.0-SNAPSHOT6个月前
  • ui-test[SPARK-55740][TESTS] Fix npm vulnerabilities by `npm audit fix`2个月前
  • .asf.yaml[SPARK-55547][INFRA] Enable `GitHub Issues` feature2个月前
  • .gitattributes[SPARK-30653][INFRA][SQL] EOL character enforcement for java/scala/xml/py/R files6年前
  • .gitignore[SPARK-55369][SPARK-55332][PYTHON][INFRA] Setup ASV benchmark2个月前
  • .nojekyll[MINOR][INFRA] Disable 'pages build and deployment' action1年前
  • .pre-commit-config.yaml[SPARK-55266][INFRA] Add pre-commit hooks for format/lint3个月前
  • .sbtopts[SPARK-54830][CORE] Enable checksum based indeterminate shuffle retry by default3个月前
  • AGENTS.md[SPARK-55614][BUILD] Add AGENTS.MD2个月前
  • CONTRIBUTING.md[MINOR][DOCS] Tighten up some key links to the project and download pages to use HTTPS7年前
  • LICENSE[SPARK-53088][BUILD] Remove `scala-collection-compat` dependency9个月前
  • LICENSE-binary[SPARK-54916][K8S][BUILD] Enable `volcano` profile by default3个月前
  • NOTICE[SPARK-29674][CORE] Update dropwizard metrics to 4.1.x for JDK 9+6年前
  • NOTICE-binary[SPARK-54602][BUILD] Update `NOTICE-binary` with `Netty` `4.2.7.Final` license4个月前
  • README.md[SPARK-55678][BUILD][FOLLOWUP] Add Maven Java 25 daily CI and update badges2个月前
  • pom.xml[SPARK-55841][BUILD] Upgrade jackson to 2.21.11个月前
  • pyproject.toml[SPARK-55621][PYTHON] Fix ambiguous and unnecessary unicode usage2个月前
  • scalastyle-config.xml[SPARK-54260][CORE][K8S] Unify K8s cluster checks to use the single regex via `SparkMasterRegex.isK8s` methods5个月前
  • Apache Spark

    Spark is a unified analytics engine for large-scale data processing. It provides high-level APIs in Scala, Java, Python, and R (Deprecated), and an optimized engine that supports general computation graphs for data analysis. It also supports a rich set of higher-level tools including Spark SQL for SQL and DataFrames, pandas API on Spark for pandas workloads, MLlib for machine learning, GraphX for graph processing, and Structured Streaming for stream processing.

    License Maven Central Java GitHub Actions Build PySpark Coverage PyPI Downloads

    Online Documentation

    You can find the latest Spark documentation, including a programming guide, on the project web page. This README file only contains basic setup instructions.

    Build Pipeline Status

    Branch Status
    master GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    branch-4.1 GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    branch-4.0 GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    GitHub Actions Build
    branch-3.5 GitHub Actions Build
    GitHub Actions Build

    Building Spark

    Spark is built using Apache Maven. To build Spark and its example programs, run:

    ./build/mvn -DskipTests clean package

    (You do not need to do this if you downloaded a pre-built package.)

    More detailed documentation is available from the project site, at “Building Spark”.

    For general development tips, including info on developing Spark using an IDE, see “Useful Developer Tools”.

    Interactive Scala Shell

    The easiest way to start using Spark is through the Scala shell:

    ./bin/spark-shell

    Try the following command, which should return 1,000,000,000:

    scala> spark.range(1000 * 1000 * 1000).count()

    Interactive Python Shell

    Alternatively, if you prefer Python, you can use the Python shell:

    ./bin/pyspark

    And run the following command, which should also return 1,000,000,000:

    >>> spark.range(1000 * 1000 * 1000).count()

    Example Programs

    Spark also comes with several sample programs in the examples directory. To run one of them, use ./bin/run-example <class> [params]. For example:

    ./bin/run-example SparkPi

    will run the Pi example locally.

    You can set the MASTER environment variable when running examples to submit examples to a cluster. This can be spark:// URL, “yarn” to run on YARN, and “local” to run locally with one thread, or “local[N]” to run locally with N threads. You can also use an abbreviated class name if the class is in the examples package. For instance:

    MASTER=spark://host:7077 ./bin/run-example SparkPi

    Many of the example programs print usage help if no params are given.

    Running Tests

    Testing first requires building Spark. Once Spark is built, tests can be run using:

    ./dev/run-tests

    Please see the guidance on how to run tests for a module, or individual tests.

    There is also a Kubernetes integration test, see resource-managers/kubernetes/integration-tests/README.md

    A Note About Hadoop Versions

    Spark uses the Hadoop core library to talk to HDFS and other Hadoop-supported storage systems. Because the protocols have changed in different versions of Hadoop, you must build Spark against the same version that your cluster runs.

    Please refer to the build documentation at “Specifying the Hadoop Version and Enabling YARN” for detailed guidance on building for a particular distribution of Hadoop, including building for particular Hive and Hive Thriftserver distributions.

    Configuration

    Please refer to the Configuration Guide in the online documentation for an overview on how to configure Spark.

    Contributing

    Please review the Contribution to Spark guide for information on how to get started contributing to the project.

    邀请码
      Gitlink(确实开源)
    • 加入我们
    • 官网邮箱:gitlink@ccf.org.cn
    • QQ群
    • QQ群
    • 公众号
    • 公众号

    版权所有:中国计算机学会技术支持:开源发展技术委员会
    京ICP备13000930号-9 京公网安备 11010802032778号