【wip】[common][core][s3] Add provider-neutral FileIO contract suite - #9161
Open
sundapeng wants to merge 7 commits into
Open
【wip】[common][core][s3] Add provider-neutral FileIO contract suite#9161sundapeng wants to merge 7 commits into
sundapeng wants to merge 7 commits into
Conversation
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.
Summary
This PR adds a provider-neutral, opt-in contract suite for
FileIOand applies it to local, Hadoop-local, HDFS, and S3 providers. It follows the layered “Scheme B” design so provider behavior, default-method behavior, API ownership, returned-object behavior, and consumer assumptions are tested independently.The public
FileIOinterface, its Javadocs, and the existingFileIOBehaviorTestBaseare unchanged.Changes
FileIOinto exactly one owner: provider core, default methods, provider lifecycle, factories, or optional capabilities. Factory selection/discovery and unsupported-capability behavior are covered separately.FileStatusdefaults andSeekableInputStream.wrapforwarding and unsupported positioning.StrictContractFileIOconsumer guard. It rejects non-portable caller assumptions such as listing non-directories or renaming to an existing destination, and is exercised by catalog, commit/abort, branch, and tag workflows.Production fixes exposed by the contract
LocalFileIO.copyFile(..., false)now reports an existing destination instead of silently succeeding.tryToWriteAtomicnow preserves an existing target and returnsfalse; object-store schemes do not gain this preflight.FormatTableCommitrolls back writer-owned UUID targets even when a remote commit publishes and then throws.WriteOperationHelperfrom the owningS3AFileSystem, including Hadoop's required multipart callbacks and filesystem context.Contract boundaries
The suite deliberately leaves provider-specific edge cases unspecified, including ambiguous rename shapes such as a missing source, an existing destination, identical paths, or an invalid destination parent. It also allows missing-file input failure either while opening or on the first read, does not define listing order or pre-close visibility, and does not prescribe exact timestamp precision.
Request-aware tests constrain logical
FileIOdelegation where it affects behavior, but do not freeze backend-specific HTTPHEAD/LISTrequest counts or ordering. No provider profile, vendor flag, or new production capability API is introduced.Testing
paimon-common.paimon-core.S3FileIOTestsuite was not rerun locally because Docker was unavailable; the pushed PR runs it in CI.