Skip to content

feat(sdk): add distributed map processor and reader wire types - #918

Draft
nvasiu wants to merge 1 commit into
feat/distributed-map-resultsfrom
feat/distributed-map-wire-types
Draft

nvasiu wants to merge 1 commit into
feat/distributed-map-resultsfrom
feat/distributed-map-wire-types

Conversation

@nvasiu

@nvasiu nvasiu commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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

#912

Description

Adds the events the service sends to a processor or reader Lambda, and the responses it expects back. PR 3 of 6 (see the issue). It needs no new Lambda model and depends on PR 1 (#915), for DistributedMapError.

dmap/

  • ProcessorEvent, ProcessorRecord and ReaderEvent: the events the service sends to a processor or reader Lambda.
  • ItemHandlerResponse, ItemResult, ItemFailure and ReaderResponse: the responses the service expects back.
  • The events validate the invocation input and reject a record that carries no item id, since every outcome is reported against an item id.

sdk/pom.xml

  • Adds the test-only aws-lambda-java-serialization dependency, so a test checks that the Lambda runtime's own serializer reads the events.

Demo/Screenshots

N/A

Design

See Rules for every change.

  • Design note (rule 3), for a new feature, a new option or a public API change: Feature planned internally.
  • Simpler options considered (rule 2), if the change adds logic: N/A
  • Root cause (rule 5), for a bug fix: N/A
  • Net change in source lines and in public API members:
    • +151 lines in src/main and +312 in src/test.
    • New public members: 7 records in dmap/.

Assumptions

Each assumption about the service, Lambda, the runtime or another library, with its evidence, or marked "unverified" (rule 6):

  • A processor invocation payload carries distributedMapRunArn and a records list, each record holding a non-empty string itemId and a body the customer's serdes decodes. Unverified.
  • The service matches a reported outcome back to its item by the itemId the processor echoes, and accepts the batch-failure and item-outcome response shapes. Unverified.
  • A reader invocation payload carries distributedMapRunArn, an integer maxItemsPerPage, and state as the reader last returned it. Unverified.

Decisions not covered by the issue or the design note

One line each, with the reason (rule 7):

  • The record body is an opaque string, so a customer serdes other than JSON works without an SDK change.

Checklist

  • I have filled out every section of the PR template
  • I have thoroughly tested this change
  • Every new branch has a test that fails without it (rule 4)
  • For a bug fix: the description or commit order shows the regression test failing before the fix and passing after it (rule 5)
  • Every edited test expectation is listed in the description, with the reason (rule 5)

Testing

Unit Tests

Have unit tests been written for these changes?

Yes. One test class per record in dmap/, checking the validation and the JSON each response writes.

Integration Tests

Have integration tests been written for these changes?

No. LocalDurableTestRunner does not support distributed map yet.

Examples

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

No.

Add the records for the JSON the service sends to a processor or reader
Lambda and the responses it expects back. Each event checks its own
fields when it is read.
@nvasiu
nvasiu force-pushed the feat/distributed-map-wire-types branch from ec9537b to 3c2216a Compare December 4, 2026 22:35

This branch has not been deployed

No deployments
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