[refactor] Centralize batch ingestion job spec constants into SegmentGenerationJobUtils#18413
Open
Akanksha-kedia wants to merge 1 commit intoapache:masterfrom
Open
Conversation
…obUtils Move 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. This eliminates silent drift between the Hadoop and Spark runners, where the same config keys were independently declared as private literals. The Hadoop runner's public SEGMENT_GENERATION_JOB_SPEC field is retained as a delegating alias for backward compatibility. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18413 +/- ##
============================================
- Coverage 63.52% 63.51% -0.01%
Complexity 1709 1709
============================================
Files 3250 3250
Lines 198949 198949
Branches 30826 30826
============================================
- Hits 126381 126364 -17
- Misses 62488 62496 +8
- Partials 10080 10089 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
Contributor
Author
|
@xiangfu0 please review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Centralizes duplicated string constants (
SEGMENT_GENERATION_JOB_SPEC,DEPENDENCY_JAR_DIR,STAGING_DIR) fromHadoopSegmentGenerationJobRunnerandSparkSegmentGenerationJobRunnerinto the sharedSegmentGenerationJobUtilsclass inpinot-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.extraConfigskeys), having separate copies creates a risk of silent drift if one runner is updated but the other is not.Changes Made
SegmentGenerationJobUtils.java-- added threepublic static final Stringconstants:SEGMENT_GENERATION_JOB_SPEC,DEPENDENCY_JAR_DIR, andSTAGING_DIR.HadoopSegmentGenerationJobRunner.java-- removed the privateDEPS_JAR_DIR_FIELDandSTAGING_DIR_FIELDliterals; replaced all usages withSegmentGenerationJobUtils.DEPENDENCY_JAR_DIRandSegmentGenerationJobUtils.STAGING_DIR. The existing publicSEGMENT_GENERATION_JOB_SPECfield 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 privateDEPS_JAR_DIRandSTAGING_DIRliterals; replaced all usages with the shared constants fromSegmentGenerationJobUtils.Backward Compatibility
HadoopSegmentGenerationJobRunner.SEGMENT_GENERATION_JOB_SPECremains a public field with the same value, so downstream code that references it is unaffected.Testing Done
mvn install -DskipTestson the affected modules)pinot-batch-ingestion-hadoopandpinot-batch-ingestion-spark-3continue to passChecklist