Skip to content

posix: extract MPUHandler interface for pluggable multipart write strategies#3

Open
riaarora-boop wants to merge 1 commit into
feat/meta-af2descfrom
feat/posix-mpu-handler
Open

posix: extract MPUHandler interface for pluggable multipart write strategies#3
riaarora-boop wants to merge 1 commit into
feat/meta-af2descfrom
feat/posix-mpu-handler

Conversation

@riaarora-boop

Copy link
Copy Markdown

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 initialization
  • UploadPart — write side of a part
  • CompleteMultipartUpload — assembly and reveal of the final object
  • AbortMultipartUpload — cleanup of staging state
  • ListParts — query recorded parts

StandardMPUHandler is the default implementation: it delegates to the existing UploadPartWithPostFunc and CompleteMultipartUploadWithCopy methods unchanged. AbortMultipartUpload and ListParts bodies are extracted to private abortMultipartInternal / listPartsInternal methods.

Posix.mpuHandler defaults to StandardMPUHandler{}. The next PR (feat/posix-af2-mpu-handler) swaps it for Af2MPUHandler when SameDirTmp is true.

Test Plan:

  • go build ./backend/... ./cmd/... passes
  • All existing tests pass unchanged — StandardMPUHandler is behaviorally identical to the previous inline code

JIRA Issues:

CDM-557244 (subtask of CDM-557238)

Revert Plan:

Revert this PR. No observable behavior change — safe to revert independently.

…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>
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.

1 participant