posix: extract MPUHandler interface for pluggable multipart write strategies#3
Open
riaarora-boop wants to merge 1 commit into
Open
posix: extract MPUHandler interface for pluggable multipart write strategies#3riaarora-boop wants to merge 1 commit into
riaarora-boop wants to merge 1 commit into
Conversation
…ategies
Defines MPUHandler, an interface that abstracts the multipart upload write
strategy for a Posix backend. The default StandardMPUHandler delegates to
the existing staging-and-concat methods (UploadPartWithPostFunc,
CompleteMultipartUploadWithCopy) — no behavior change for any existing user.
AbortMultipartUpload and ListParts body extracted to abortMultipartInternal /
listPartsInternal so the public methods become thin dispatchers. The
mpuHandler field on Posix defaults to StandardMPUHandler{} and can be
swapped at construction time to plug in an alternative write strategy
(e.g. Af2MPUHandler for write-at-offset semantics on AF2/SDFS).
Jira: CDM-557244
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
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:
Pure refactor — no behavior change for any existing user.
Defines
MPUHandler, an interface that abstracts the multipart upload write strategy for the posix backend:CreateMultipartUpload— per-upload state initializationUploadPart— write side of a partCompleteMultipartUpload— assembly and reveal of the final objectAbortMultipartUpload— cleanup of staging stateListParts— query recorded partsStandardMPUHandleris the default implementation: it delegates to the existingUploadPartWithPostFuncandCompleteMultipartUploadWithCopymethods unchanged.AbortMultipartUploadandListPartsbodies are extracted to privateabortMultipartInternal/listPartsInternalmethods.Posix.mpuHandlerdefaults toStandardMPUHandler{}. The next PR (feat/posix-af2-mpu-handler) swaps it forAf2MPUHandlerwhenSameDirTmpis true.Test Plan:
go build ./backend/... ./cmd/...passesStandardMPUHandleris behaviorally identical to the previous inline codeJIRA Issues:
CDM-557244 (subtask of CDM-557238)
Revert Plan:
Revert this PR. No observable behavior change — safe to revert independently.