Akanksha-kedia opened a new pull request, #18413: URL: https://github.com/apache/pinot/pull/18413
## Description Centralizes duplicated string constants (`SEGMENT_GENERATION_JOB_SPEC`, `DEPENDENCY_JAR_DIR`, `STAGING_DIR`) from `HadoopSegmentGenerationJobRunner` and `SparkSegmentGenerationJobRunner` into the shared `SegmentGenerationJobUtils` class in `pinot-batch-ingestion-common`. These three config-key strings were independently declared as private literals in each runner. Because they must stay in sync (they reference the same `executionFrameworkSpec.extraConfigs` keys), having separate copies creates a risk of silent drift if one runner is updated but the other is not. ## Changes Made - **`SegmentGenerationJobUtils.java`** -- added three `public static final String` constants: `SEGMENT_GENERATION_JOB_SPEC`, `DEPENDENCY_JAR_DIR`, and `STAGING_DIR`. - **`HadoopSegmentGenerationJobRunner.java`** -- removed the private `DEPS_JAR_DIR_FIELD` and `STAGING_DIR_FIELD` literals; replaced all usages with `SegmentGenerationJobUtils.DEPENDENCY_JAR_DIR` and `SegmentGenerationJobUtils.STAGING_DIR`. The existing **public** `SEGMENT_GENERATION_JOB_SPEC` field is preserved as a delegating alias (`= SegmentGenerationJobUtils.SEGMENT_GENERATION_JOB_SPEC`) so that any external callers continue to compile without changes. - **`SparkSegmentGenerationJobRunner.java`** -- removed the private `DEPS_JAR_DIR` and `STAGING_DIR` literals; replaced all usages with the shared constants from `SegmentGenerationJobUtils`. ## Backward Compatibility - `HadoopSegmentGenerationJobRunner.SEGMENT_GENERATION_JOB_SPEC` remains a public field with the same value, so downstream code that references it is unaffected. - No config key values were changed -- only where the string literals are defined. ## Testing Done - [ ] Verified the project compiles (`mvn install -DskipTests` on the affected modules) - [ ] Existing unit tests for `pinot-batch-ingestion-hadoop` and `pinot-batch-ingestion-spark-3` continue to pass - [ ] Manual inspection confirms all usages now reference the centralized constants ## Checklist - [x] Code follows project style guidelines - [x] Self-review completed - [x] No new warnings introduced - [x] Backward compatible -- no API/config changes -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
