Skip to content

Add quickstart process-specific config override hooks.#17959

Open
gortiz wants to merge 1 commit intoapache:masterfrom
gortiz:oss/quickstart-config-overrides
Open

Add quickstart process-specific config override hooks.#17959
gortiz wants to merge 1 commit intoapache:masterfrom
gortiz:oss/quickstart-config-overrides

Conversation

@gortiz
Copy link
Contributor

@gortiz gortiz commented Mar 24, 2026

Summary

  • Adds process-specific config override hooks to quickstart startup wiring.
  • Enables supplying different config maps for broker and server processes at launch time.
  • Keeps existing quickstart behavior intact when no overrides are provided.

Why

Quickstart currently uses mostly shared/default process config at startup. To support extension scenarios and targeted local testing, we need a simple way to inject per-process overrides (for example, different broker/server settings) without rewriting quickstart flows.

This, for example, opens the ability to explicitly set the ports used by each service.

Changes Included (with effect)

  • pinot-tools/src/main/java/org/apache/pinot/tools/Quickstart.java

    • Added wiring to pass broker/server-specific override maps into runner startup.
    • Introduced/used hooks to construct per-process override config when launching components.
    • Effect: quickstart can now customize broker and server runtime properties independently.
  • pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/QuickstartRunner.java

    • Added constructor/path support for functional config providers (e.g., IntFunction<Map<String, Object>>) for broker/server process overrides.
    • Integrated override maps into process launch config assembly.
    • Preserved existing constructor/default behavior for call sites that do not provide overrides.
    • Effect: extends quickstart runner in a backward-compatible way while enabling more flexible local startup configuration.

Behavior / Compatibility

  • Backward compatible: existing quickstart commands behave the same unless override hooks are used.
  • No query engine semantics change; this is tooling/startup configuration plumbing.
  • Improves local dev/test ergonomics for scenarios requiring role-specific settings.

Test Plan

  • Build affected module:
    • ./mvnw -pl pinot-tools -am -DskipTests compile
  • Run quickstart command(s) without overrides and verify unchanged startup behavior.
  • Run quickstart command(s) with broker/server override maps and verify the overrides are applied to the intended process only.
Allow quickstart wiring to provide broker and server scoped configuration maps when launching local components. Made-with: Cursor
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds per-process (broker/server) config override hooks to Pinot quickstart startup wiring, enabling role-specific runtime properties while preserving existing behavior when no overrides are provided.

Changes:

  • Extend QuickstartRunner with optional IntFunction<Map<String, Object>> providers to supply per-broker and per-server override maps.
  • Apply per-instance override maps when assembling broker/server launch config overrides.
  • Add override hook methods in Quickstart and wire them into the runner constructor.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/QuickstartRunner.java Adds per-broker/server override providers and merges them into process config overrides during startup.
pinot-tools/src/main/java/org/apache/pinot/tools/Quickstart.java Introduces protected override hooks for per-broker/server config and passes them to QuickstartRunner.
Comment on lines +131 to +132
_individualBrokerConfigOverridesFunction = individualBrokerConfigOverridesFunction;
_individualServerConfigOverridesFunction = individualServerConfigOverridesFunction;
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

The new constructor stores individualBrokerConfigOverridesFunction / individualServerConfigOverridesFunction without null-checking. If a caller passes null, quickstart will later throw an NPE in startBrokers()/startServers(). Consider validating these parameters (e.g., require non-null) or defaulting null to an empty-map provider to keep the API robust.

Suggested change
_individualBrokerConfigOverridesFunction = individualBrokerConfigOverridesFunction;
_individualServerConfigOverridesFunction = individualServerConfigOverridesFunction;
_individualBrokerConfigOverridesFunction = individualBrokerConfigOverridesFunction != null
? individualBrokerConfigOverridesFunction
: i -> Collections.emptyMap();
_individualServerConfigOverridesFunction = individualServerConfigOverridesFunction != null
? individualServerConfigOverridesFunction
: i -> Collections.emptyMap();
Copilot uses AI. Check for mistakes.
Comment on lines +216 to +219
Map<String, Object> individualControllerConfigOverrides = _individualServerConfigOverridesFunction.apply(i);
if (!individualControllerConfigOverrides.isEmpty()) {
Map<String, Object> config = new HashMap<>(_configOverrides);
config.putAll(individualControllerConfigOverrides);
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

In startServers(), the local variable is named individualControllerConfigOverrides but it actually holds per-server overrides from _individualServerConfigOverridesFunction. Renaming it to reflect 'server' would avoid confusion and copy/paste mistakes during future edits.

Suggested change
Map<String, Object> individualControllerConfigOverrides = _individualServerConfigOverridesFunction.apply(i);
if (!individualControllerConfigOverrides.isEmpty()) {
Map<String, Object> config = new HashMap<>(_configOverrides);
config.putAll(individualControllerConfigOverrides);
Map<String, Object> individualServerConfigOverrides = _individualServerConfigOverridesFunction.apply(i);
if (!individualServerConfigOverrides.isEmpty()) {
Map<String, Object> config = new HashMap<>(_configOverrides);
config.putAll(individualServerConfigOverrides);
Copilot uses AI. Check for mistakes.
Comment on lines +119 to +120
IntFunction<Map<String, Object>> individualServerConfigOverridesFunction
) throws Exception {
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

Constructor formatting is inconsistent with the other constructors in this class: the closing ) is on its own line before throws Exception. Consider aligning it with the established style used above (closing parenthesis on the same line as the last parameter) to keep diffs and formatting consistent.

Suggested change
IntFunction<Map<String, Object>> individualServerConfigOverridesFunction
) throws Exception {
IntFunction<Map<String, Object>> individualServerConfigOverridesFunction) throws Exception {
Copilot uses AI. Check for mistakes.
Comment on lines +61 to +66
protected Map<String, Object> getIndividualBrokerConfigOverridesFunction(int brokerId) {
return Map.of();
}

protected Map<String, Object> getIndividualServerConfigOverridesFunction(int serverId) {
return Map.of();
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

The new hook methods getIndividualBrokerConfigOverridesFunction(int) / getIndividualServerConfigOverridesFunction(int) return a config Map, but their names suggest they return a function. Consider renaming them to something like getIndividualBrokerConfigOverrides(int) / getIndividualServerConfigOverrides(int) to make the override contract clearer for subclasses.

Copilot uses AI. Check for mistakes.
@codecov-commenter
Copy link

codecov-commenter commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.23%. Comparing base (5b7d6fd) to head (cd4c07e).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@ ## master #17959 +/- ## ============================================ - Coverage 63.30% 63.23% -0.07%  Complexity 1525 1525 ============================================ Files 3193 3193 Lines 193330 193330 Branches 29732 29732 ============================================ - Hits 122381 122253 -128  - Misses 61356 61491 +135  + Partials 9593 9586 -7 
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 63.21% <ø> (+0.01%) ⬆️
java-21 63.18% <ø> (-0.08%) ⬇️
temurin 63.23% <ø> (-0.07%) ⬇️
unittests 63.23% <ø> (-0.07%) ⬇️
unittests1 55.52% <ø> (-0.01%) ⬇️
unittests2 34.20% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@yashmayya yashmayya added enhancement Improvement to existing functionality quickstart Related to quickstart guides or examples labels Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement to existing functionality quickstart Related to quickstart guides or examples

4 participants