[core] Clean up constructor for FileStoreCommitImpl#7213
Merged
JingsongLi merged 1 commit intoapache:masterfrom Feb 5, 2026
Merged
[core] Clean up constructor for FileStoreCommitImpl#7213JingsongLi merged 1 commit intoapache:masterfrom
JingsongLi merged 1 commit intoapache:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors the FileStoreCommitImpl constructor to reduce complexity by extracting parameters that can be derived from the CoreOptions object. The refactoring removes 13 constructor parameters and instead accesses these values directly from the options field at the point of use.
Changes:
- Removed static factory method
StrictModeChecker.create()and moved StrictModeChecker instantiation logic into FileStoreCommitImpl constructor - Simplified FileStoreCommitImpl constructor by removing 13 parameters (numBucket, manifestTargetSize, manifestFullCompactionSize, manifestMergeMinCount, dynamicPartitionOverwrite, branchName, manifestReadParallelism, commitMaxRetries, commitTimeout, commitMinRetryWait, commitMaxRetryWait, rowTrackingEnabled, discardDuplicateFiles, strictModeChecker, partitionDefaultName) that can be obtained from CoreOptions
- Updated all usages to call options methods instead of using cached field values
- Fixed minor grammar issue in a comment
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| StrictModeChecker.java | Removed unused static factory method and cleaned up imports (Nullable, Supplier) |
| FileStoreCommitImpl.java | Simplified constructor by removing 13 parameters and 9 fields; replaced field references with options.* method calls; moved StrictModeChecker initialization into constructor; fixed comment grammar |
| AbstractFileStore.java | Updated newCommit method to pass fewer arguments to FileStoreCommitImpl constructor; removed StrictModeChecker pre-construction logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
JingsongLi
reviewed
Feb 5, 2026
| this.strictModeChecker = strictModeChecker; | ||
| this.strictModeChecker = | ||
| options.commitStrictModeLastSafeSnapshot() | ||
| .map(id -> new StrictModeChecker(snapshotManager, commitUser, scan, id)) |
Contributor
There was a problem hiding this comment.
Should not use scan. This may lead to parameter confusion.
e0cf7d9 to
5b1c90c
Compare
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.
Purpose
Many arguments in constructor of
FileStoreCommitImplare extracted fromoptions. This PR cleans up these arguments.Tests
This is a code refactor, no additional tests needed.
API and Format
No format changes.
Documentation
No new feature.