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

Add generic Set support to streams #54769

Merged
merged 6 commits into from
Apr 13, 2020
Merged

Add generic Set support to streams #54769

merged 6 commits into from
Apr 13, 2020

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Apr 4, 2020

This commit adds support for reading and writing sets as generic values
in stream input and output.

closes #54708

This commit adds support for reading and writing sets as generic values
in stream input and output.

closes elastic#54708
@rjernst rjernst added >bug :Core/Infra/Core Core issues without another label v8.0.0 v7.8.0 v7.7.1 labels Apr 4, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Core)

Copy link
Member

@original-brownbear original-brownbear left a comment

Choose a reason for hiding this comment

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

LGTM

import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.Consumer;
Copy link
Member

Choose a reason for hiding this comment

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

This import still trips checkstyle

case 24:
return readCollection(StreamInput::readGenericValue, LinkedHashSet::new, Collections.emptySet());
case 25:
return readCollection(StreamInput::readGenericValue, HashSet::new, Collections.emptySet());
Copy link
Member

Choose a reason for hiding this comment

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

I think you can just make this readSet(StreamInput::readGenericValue)?

Copy link
Member Author

Choose a reason for hiding this comment

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

It could work for the HashSet version, but I think it is good to have the symmetry with with the LInkedHashSet above.

Copy link
Member

Choose a reason for hiding this comment

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

fair point :) LGTM

@rjernst rjernst merged commit 1e53497 into elastic:master Apr 13, 2020
@rjernst rjernst deleted the stream_set branch April 13, 2020 17:30
rjernst added a commit to rjernst/elasticsearch that referenced this pull request Apr 13, 2020
This commit adds support for reading and writing sets as generic values
in stream input and output.

closes elastic#54708
rjernst added a commit that referenced this pull request Apr 16, 2020
This commit adds support for reading and writing sets as generic values
in stream input and output.

closes #54708
@rjernst rjernst removed the v7.7.1 label Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants