feat(sdk): add distributed map operation - #1
Draft
nvasiu wants to merge 1 commit into
Draft
Conversation
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.
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: thectx.distributedMapentry point, with overloads for summary vs result-collecting,Class<O>vsTypeToken<O>, blocking vs async, and optional config.DistributedMapHandlers.java(andmodel/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 ontoDistributedMapOptionsand parsesDistributedMapDetailsback into the result types.exception/:DistributedMapError(run or item failure) andDistributedMapException(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:lambdaversion 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
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