Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement batch map #132

Merged
merged 7 commits into from
Jul 2, 2024
Merged

feat: implement batch map #132

merged 7 commits into from
Jul 2, 2024

Conversation

kohlisid
Copy link
Contributor

No description provided.

kohlisid added 2 commits June 27, 2024 18:07
Signed-off-by: Sidhant Kohli <[email protected]>
Signed-off-by: Sidhant Kohli <[email protected]>
msg := d.Value()
_ = d.EventTime() // Event time is available
_ = d.Watermark() // Watermark is available
results := mapper.NewBatchResponse(d.Id())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is an empty response valid to ensure prop ACK'ing of message without necessarily assigning a response message to it?

Ex. my batch is a list of JSON, but in my handler I take combine them into a list of JSON (psedo-reduce). One of the NewBatchResponse would align with the new message, but the rest I would want to acknowledge as complete, but they wouldn't have an actual response.

Copy link
Contributor Author

@kohlisid kohlisid Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would still need to add an empty batch response for those IDs with an empty list. We expect that the number of requests in batch and number of responses to be equal.
But for you use case if you pass on an empty response with the correct ID, those should be acked

results := mapper.NewBatchResponse(d.Id())
batchResponses = batchResponses.Append(results)

kohlisid added 5 commits June 30, 2024 21:58
Signed-off-by: Sidhant Kohli <[email protected]>
Signed-off-by: Sidhant Kohli <[email protected]>
Signed-off-by: Sidhant Kohli <[email protected]>
Signed-off-by: Sidhant Kohli <[email protected]>
Signed-off-by: Sidhant Kohli <[email protected]>
@vigith vigith changed the base branch from main to map-batch July 2, 2024 00:24
@vigith vigith marked this pull request as ready for review July 2, 2024 00:24
@vigith
Copy link
Member

vigith commented Jul 2, 2024

merging to a tmp branch

@vigith vigith merged commit 8f15f07 into numaproj:map-batch Jul 2, 2024
3 checks passed
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.

3 participants