Skip to content

Conversation

@yjyolandeyan
Copy link
Contributor

Summary: as title

Reviewed By: kewang1024

Differential Revision: D86237359

@yjyolandeyan yjyolandeyan requested a review from a team as a code owner November 11, 2025 17:30
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 11, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Introduces a new session configuration property max_split_preload_per_driver to control how many splits are preloaded per driver, by adding its constant, registering it in the session properties constructor, and providing a getter.

Class diagram for updated SystemSessionProperties with max_split_preload_per_driver

classDiagram
    class SystemSessionProperties {
        +String MAX_SPLIT_PRELOAD_PER_DRIVER
        +int getMaxSplitPreloadPerDriver(Session session)
    }
    SystemSessionProperties --> Session : uses
Loading

File-Level Changes

Change Details Files
Define and register new system/session property for split preloading
  • Add constant MAX_SPLIT_PRELOAD_PER_DRIVER
  • Register integerProperty with default value, description, and visibility
  • Add static getter getMaxSplitPreloadPerDriver
presto-main-base/src/main/java/com/facebook/presto/SystemSessionProperties.java

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

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `presto-main-base/src/main/java/com/facebook/presto/SystemSessionProperties.java:194` </location>
<code_context>
     public static final String IGNORE_STATS_CALCULATOR_FAILURES = "ignore_stats_calculator_failures";
     public static final String PRINT_STATS_FOR_NON_JOIN_QUERY = "print_stats_for_non_join_query";
     public static final String MAX_DRIVERS_PER_TASK = "max_drivers_per_task";
+    public static final String MAX_SPLIT_PRELOAD_PER_DRIVER = "max_split_preload_per_driver";
     public static final String MAX_TASKS_PER_STAGE = "max_tasks_per_stage";
     public static final String DEFAULT_FILTER_FACTOR_ENABLED = "default_filter_factor_enabled";
</code_context>

<issue_to_address>
**suggestion:** Consider validating the value for MAX_SPLIT_PRELOAD_PER_DRIVER.

This property currently lacks validation for acceptable values. Please ensure it cannot be set to negative or unreasonably high numbers, following the approach used for similar properties.

Suggested implementation:

```java
                integerProperty(
                        MAX_SPLIT_PRELOAD_PER_DRIVER,
                        "Maximum number of splits to preload per driver. Set to 0 to disable preloading",
                        0,
                        false,
                        value -> min(taskManagerConfig.getMaxDriversPerTask(), validateNullablePositiveIntegerValue(value, MAX_SPLIT_PRELOAD_PER_DRIVER)),
                        object -> object),

```

If `validateNullablePositiveIntegerValue` or a similar helper does not exist for this property, you may need to:
1. Ensure that the helper method is available and imported.
2. Adjust the upper bound as appropriate for your system (e.g., define a new constant if `taskManagerConfig.getMaxDriversPerTask()` is not suitable).
3. If the property registration method signature differs, adapt the validation lambda accordingly.
</issue_to_address>

### Comment 2
<location> `presto-main-base/src/main/java/com/facebook/presto/SystemSessionProperties.java:1030` </location>
<code_context>
                         object -> object),
+                integerProperty(
+                        MAX_SPLIT_PRELOAD_PER_DRIVER,
+                        "Maximum number of splits to preload per driver. Set to 0 to disable preloading",
+                        0,
+                        false),
</code_context>

<issue_to_address>
**suggestion:** Clarify behavior for negative values in the property description.

If negative values are invalid, please update the description to explicitly state this.

```suggestion
                        "Maximum number of splits to preload per driver. Set to 0 to disable preloading. Negative values are not allowed.",
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

yjyolandeyan added a commit to yjyolandeyan/presto that referenced this pull request Nov 11, 2025
…m config (prestodb#26583)

Summary:

as title

Reviewed By: kewang1024

Differential Revision: D86237359
yjyolandeyan added a commit to yjyolandeyan/presto that referenced this pull request Nov 11, 2025
…m config (prestodb#26583)

Summary:

as title

Reviewed By: kewang1024

Differential Revision: D86237359
yjyolandeyan added a commit to yjyolandeyan/presto that referenced this pull request Nov 11, 2025
…ig (prestodb#26583)

Summary:

as title

Reviewed By: kewang1024

Differential Revision: D86237359
yjyolandeyan added a commit to yjyolandeyan/presto that referenced this pull request Nov 11, 2025
Summary:

as title

Reviewed By: kewang1024

Differential Revision: D86237359
yjyolandeyan added a commit to yjyolandeyan/presto that referenced this pull request Nov 11, 2025
…b#26583)

Summary:

as title

Reviewed By: kewang1024

Differential Revision: D86237359
@stevechuck stevechuck changed the title [presto][native] Add max_split_preload_per_driver to java system config feat: Add max_split_preload_per_driver to java system config Nov 11, 2025
…b#26583)

Summary:

as title

Reviewed By: kewang1024

Differential Revision: D86237359
@steveburnett
Copy link
Contributor

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants