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

Conflict resolution when collecting into a Map #880

Closed
wants to merge 2 commits into from

Conversation

indalaterre
Copy link
Contributor

@indalaterre indalaterre commented Mar 20, 2022

Hi all
this PR is just to add the mergeFunction supported by Java Map collector for streams.
This happen in case a collect to a non multimap is requested.

@jponge If you agree to this it would be possible to have this in the 2.8CR of quarkus?

@indalaterre indalaterre changed the title Conflict resolution when collect into a Map Conflict resolution when collecting into a Map Mar 20, 2022
Copy link
Contributor

@cescoffier cescoffier left a comment

Choose a reason for hiding this comment

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

LGTM, but let's wait for @jponge's review.

@codecov
Copy link

codecov bot commented Mar 20, 2022

Codecov Report

Merging #880 (1a734c2) into main (0674f47) will increase coverage by 0.26%.
The diff coverage is 100.00%.

❗ Current head 1a734c2 differs from pull request most recent head 174824a. Consider uploading reports for the commit 174824a to get more accurate results

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #880      +/-   ##
============================================
+ Coverage     89.08%   89.35%   +0.26%     
- Complexity     3086     3098      +12     
============================================
  Files           391      391              
  Lines         12475    12479       +4     
  Branches       1589     1591       +2     
============================================
+ Hits          11113    11150      +37     
+ Misses          714      692      -22     
+ Partials        648      637      -11     
Impacted Files Coverage Δ
...n/java/io/smallrye/mutiny/groups/MultiCollect.java 100.00% <100.00%> (ø)
...perators/multi/processors/SerializedProcessor.java 92.07% <0.00%> (-2.98%) ⬇️
...tiny/operators/multi/MultiBufferWithTimeoutOp.java 73.10% <0.00%> (-1.69%) ⬇️
...mallrye/mutiny/operators/multi/MultiFlatMapOp.java 85.10% <0.00%> (ø)
...lrye/mutiny/operators/uni/builders/UniJoinAll.java 95.83% <0.00%> (+1.38%) ⬆️
...subscription/SwitchableSubscriptionSubscriber.java 97.60% <0.00%> (+1.59%) ⬆️
...mallrye/mutiny/helpers/queues/MpscLinkedQueue.java 98.38% <0.00%> (+1.61%) ⬆️
...java/io/smallrye/mutiny/helpers/Subscriptions.java 80.66% <0.00%> (+1.65%) ⬆️
...erators/multi/builders/SerializedMultiEmitter.java 80.48% <0.00%> (+2.43%) ⬆️
...lrye/mutiny/subscription/SerializedSubscriber.java 88.07% <0.00%> (+2.75%) ⬆️
... and 7 more

Copy link
Member

@jponge jponge left a comment

Choose a reason for hiding this comment

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

Great idea, see my comments for improvement requests in docs + tests.

@jponge jponge added this to the 1.5.0 milestone Mar 21, 2022
@jponge jponge added the enhancement New feature or request label Mar 21, 2022
@jponge
Copy link
Member

jponge commented Mar 21, 2022

💡

BTW I see that your commits get reported as "unverified" on GitHub ("No user is associated with the committer email.")

Note that for authenticity purposes we require signed commits https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

@jponge
Copy link
Member

jponge commented Mar 21, 2022 via email

@indalaterre
Copy link
Contributor Author

Ok just pushed the code and the commits are signed with a GPG key

@jponge
Copy link
Member

jponge commented Mar 21, 2022

Thanks but the commits still show as unverified (email is missing, etc) :-)

Also, could you add a test for the case when the function returns null?

@indalaterre
Copy link
Contributor Author

Added a test that checks the removal of the key in case of mergeFunction returns null
And I finally got the "verified" :D

@jponge jponge enabled auto-merge (squash) March 21, 2022 10:26
Signed-off-by: mauroantonio.depalma <[email protected]>
Signed-off-by: mauroantonio.depalma <[email protected]>
@jponge
Copy link
Member

jponge commented Mar 21, 2022

I'll have to do a manual merge because it looks a weird on my side

jponge added a commit that referenced this pull request Mar 21, 2022
Manual merge of #880

Signed-off-by: Julien Ponge <[email protected]>
@jponge
Copy link
Member

jponge commented Mar 21, 2022

Merged manually in main, thanks @indalaterre

@jponge jponge closed this Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants