Skip to content

feat(sdk): add distributed map operation - #1

Draft
nvasiu wants to merge 1 commit into
mainfrom
feat/distributed-map
Draft

feat(sdk): add distributed map operation#1
nvasiu wants to merge 1 commit into
mainfrom
feat/distributed-map

Conversation

@nvasiu

@nvasiu nvasiu commented Aug 28, 2026

Copy link
Copy Markdown
Owner

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Issue Link, if available

N/A

Description

Adds the distributed map operation (ctx.distributedMap) to the Java SDK.

A map run processes a bounded dataset in parallel. A customer starts a map run from a durable function, naming a source to read items from, a processor function to invoke per batch, and concurrency, retry, and failure settings. The service reads items from the source, groups them into batches, invokes the processor for each batch, retries failures, tracks progress, routes successful results and failed items to destinations, and reports completion.

Changes:

  • model/: result types (DistributedMapSummary, DistributedMapResult, DistributedMapResultItem, DistributedMapItemError) and the run enums (DistributedMapStatus, DistributedMapCompletionReason).
  • config/: DistributedMapConfig, DistributedMapSource, DistributedMapProcessor, ProcessorRetryConfig, DistributedMapCompletionConfig, the destination types (SuccessDestination, FailureDestination, DistributedMapDestinationConfig, DistributedMapDestination), and CSV options (CsvFormat, CsvDelimiter).
  • DurableContext.java / context/DurableContextImpl.java: the ctx.distributedMap entry point, with overloads for summary vs result-collecting, Class<O> vs TypeToken<O>, blocking vs async, and optional config.
  • DistributedMapHandlers.java (and model/ReaderPage.java): authoring wrappers so a customer can write a plain function and use it as a processor or reader Lambda without hand-writing the item or batch protocol, including durable-execution variants.
  • operation/DistributedMapOperation.java: drives the run so the caller suspends while it executes and resumes with the finished outcome, raising a clear error if the operation itself fails.
  • operation/DistributedMapWire.java: maps config onto DistributedMapOptions and parses DistributedMapDetails back into the result types.
  • exception/: DistributedMapError (run or item failure) and DistributedMapException (the operation itself terminal-failing).
  • util/DistributedMapValidation.java: shared validation and S3 URI parsing.

WIP STATUS: this PR cannot compile yet. We are still waiting for the distributed map wire shapes to be released to the AWS SDK for the Java Lambda client. This code is written against those shapes, but to compile we need to bump the SDK's minimum software.amazon.awssdk:lambda version once the new models are released.

I am looking into building against a local Lambda client updated with the distributed map shapes, so we can run tests ahead of the official AWS SDK release.

Demo/Screenshots

N/A

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change

Testing

Unit Tests

Have unit tests been written for these changes?

TODO

Integration Tests

Have integration tests been written for these changes?

TODO

Examples

Has a new example been added for the change? (if applicable)

TODO

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