Dell: Implement newInputFile(String, long) to avoid redundant HEAD calls#17056
Open
thswlsqls wants to merge 1 commit into
Open
Dell: Implement newInputFile(String, long) to avoid redundant HEAD calls#17056thswlsqls wants to merge 1 commit into
thswlsqls wants to merge 1 commit into
Conversation
FileIO#newInputFile(String, long) already exists as a default method in api/, but EcsFileIO never overrode it, so the length hint from callers (DataFile/DeleteFile/ManifestFile) was silently dropped and EcsInputFile#getLength() issued a fresh getObjectMetadata() HEAD request every time. S3FileIO/GCSFileIO/ADLSFileIO/OSSFileIO all cache the known length instead. Generated-by: Claude Code
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.
Closes #17054
Summary
EcsFileIOnever overrodeFileIO#newInputFile(String, long), so the known length passed by callers (DataFile/DeleteFile/ManifestFile) fell back to theapi/default and was discarded.EcsInputFile#getLength()had no cached length, so it issued a freshgetObjectMetadata()HEAD request to ECS on every call.S3FileIO/GCSFileIO/ADLSFileIO/OSSFileIO, which all overridenewInputFile(String, long)and cache the length (e.g.aliyun/.../OSSFileIO.java,OSSInputFile.java).Testing done
TestEcsInputFile#testKnownLengthAvoidsHeadRequest(length is returned from cache without the mock backend ever creating the object) andTestEcsInputFile#testNegativeLengthIsRejected(negative length throwsValidationException)../gradlew :iceberg-dell:check— 27 tests passed, 0 failures.