Multipart uploads split a large object into independently retryable parts. Completion is a separate commit step that names the exact ordered parts and verifies their checksums.
Design MultipartUploadSession(int minPartSize):
uploadPart(partNumber, sizeBytes, checksum) stores a part. Retrying the same number replaces it. Calls after abort do nothing.complete(partNumbers, checksums) returns total size, or -1 if invalid. The arrays must have equal nonzero length; part numbers must be exactly 1..n; every part and checksum must match; every part except the last must be at least minPartSize.abort() clears all parts and permanently aborts the session.
Example 1:
Example 2:
Constraints
1 <= minPartSize, partNumber <= 10^60 <= sizeBytes <= 10^8; successful totals fit a signed 32-bit integer.- Checksums are non-empty printable ASCII strings.
- At most
10^4 operations are performed per object.