Skip to content

Add generic Set support to streams#54769

Merged
rjernst merged 6 commits intoelastic:masterfrom
rjernst:stream_set
Apr 13, 2020
Merged

Add generic Set support to streams#54769
rjernst merged 6 commits intoelastic:masterfrom
rjernst:stream_set

Conversation

@rjernst
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
Contributor

@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.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.Consumer;
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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

Development

Successfully merging this pull request may close these issues.

Node exits with org.elasticsearch.bootstrap.ElasticsearchUncaughtExceptionHandler when using HashSet in scripted metric

4 participants