Skip to content

Conversation

@johallar
Copy link
Contributor

@johallar johallar commented Oct 30, 2025

Description

Motivation and Context

Impact

With and without a cluster tag configured:

Screenshot 2025-10-30 at 12 02 34 PM Screenshot 2025-10-30 at 12 05 42 PM

Test Plan

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.
  • If adding new dependencies, verified they have an OpenSSF Scorecard score of 5.0 or higher (or obtained explicit TSC approval for lower scores).

Release Notes

Please follow release notes guidelines and fill in the release notes below.

== RELEASE NOTES ==

General Changes
* ... 
* ... 

Hive Connector Changes
* ... 
* ... 

If release note is NOT required, use:

== NO RELEASE NOTE ==
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 30, 2025

Reviewer's Guide

This PR introduces a new clusterTag configuration property, wires it through the cluster stats REST endpoints, extends the ClusterStats model (with serialization tests), and enhances the UI to fetch and display the cluster tag badge in the navbar with updated responsive styling.

Sequence diagram for UI fetching and displaying clusterTag

sequenceDiagram
participant UI
participant Server
UI->>Server: GET /v1/cluster
Server-->>UI: { clusterTag }
UI->>UI: setClusterTag(clusterTag)
UI->>UI: Render clusterTag badge in navbar
Loading

ER diagram for ClusterStats model changes

erDiagram
CLUSTER_STATS {
  string runningQueries
  string blockedQueries
  string queuedQueries
  long totalInputRows
  long totalInputBytes
  long totalCpuTimeSecs
  long adjustedQueueSize
  string clusterTag
}
SERVER_CONFIG {
  string clusterTag
}
SERVER_CONFIG ||--o| CLUSTER_STATS : provides
Loading

Class diagram for updated ClusterStats and ServerConfig classes

classDiagram
class ServerConfig {
  +Duration clusterStatsExpirationDuration
  +boolean nestedDataSerializationEnabled
  +Duration clusterResourceGroupStateInfoExpirationDuration
  +String clusterTag
  +boolean isResourceManager()
  +String getClusterTag()
  +ServerConfig setClusterTag(String clusterTag)
}

class ClusterStats {
  +List runningQueries
  +List blockedQueries
  +List queuedQueries
  +long totalInputRows
  +long totalInputBytes
  +long totalCpuTimeSecs
  +long adjustedQueueSize
  +String clusterTag
  +getClusterTag()
}

ServerConfig <|-- ClusterStats
Loading

File-Level Changes

Change Details Files
Add clusterTag config and propagate through server API
  • Define clusterTag in ServerConfig with @config setter
  • Inject clusterTag into ClusterStatsResource and DistributedClusterStatsResource
  • Bind ServerConfig in ServerMainModule for Guice injection
presto-main-base/src/main/java/com/facebook/presto/server/ServerConfig.java
presto-main/src/main/java/com/facebook/presto/server/ClusterStatsResource.java
presto-main/src/main/java/com/facebook/presto/resourcemanager/DistributedClusterStatsResource.java
presto-main/src/main/java/com/facebook/presto/server/ServerMainModule.java
Extend ClusterStats DTO and tests to include clusterTag
  • Add clusterTag field, constructor parameter, JSON/Thrift annotations in ClusterStats
  • Update TestThriftClusterStats to serialize/deserialize and assert clusterTag
presto-main/src/main/java/com/facebook/presto/server/ClusterStatsResource.java
presto-main/src/main/java/com/facebook/presto/resourcemanager/DistributedClusterStatsResource.java
presto-main/src/main/java/com/facebook/presto/server/ClusterStatsResource.java
presto-main/src/main/java/com/facebook/presto/server/ClusterStatsResource.java
presto-main/src/test/java/com/facebook/presto/server/TestThriftClusterStats.java
Update frontend to fetch and render cluster tag in navbar
  • Add clusterTag state and useEffect to fetch /v1/cluster in PageTitle.jsx
  • Render cluster tag badge under navbar with responsive flex layout
  • Refactor PageTitle component spacing, markup and quotation style
presto-ui/src/components/PageTitle.jsx
Enhance UI styling for responsive badge and navbar layout
  • Add .min-width-0, .flex-basis-40, .flex-basis-20, .truncated-badge classes
  • Adjust .navbar-cluster-info padding
presto-ui/src/static/assets/presto.css

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@johallar
Copy link
Contributor Author

@tdcmeehan WIP as a step 1, lemme know if this is in line with what you were envisioning

Copy link
Contributor

@steveburnett steveburnett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! (docs)

Pull branch, local doc build, looks good. Thanks!

@tdcmeehan
Copy link
Contributor

@tdcmeehan WIP as a step 1, lemme know if this is in line with what you were envisioning

This is almost exactly what I had in mind!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants