Skip to content

[core] Clean up constructor for FileStoreCommitImpl#7213

Merged
JingsongLi merged 1 commit intoapache:masterfrom
tsreaper:commit-argument
Feb 5, 2026
Merged

[core] Clean up constructor for FileStoreCommitImpl#7213
JingsongLi merged 1 commit intoapache:masterfrom
tsreaper:commit-argument

Conversation

@tsreaper
Copy link
Contributor

@tsreaper tsreaper commented Feb 5, 2026

Purpose

Many arguments in constructor of FileStoreCommitImpl are extracted from options. 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.

Copy link

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

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.

this.strictModeChecker = strictModeChecker;
this.strictModeChecker =
options.commitStrictModeLastSafeSnapshot()
.map(id -> new StrictModeChecker(snapshotManager, commitUser, scan, id))
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not use scan. This may lead to parameter confusion.

Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit 7ec86cb into apache:master Feb 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants