-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Conversation
This commit adds support for reading and writing sets as generic values in stream input and output. closes elastic#54708
Pinging @elastic/es-core-infra (:Core/Infra/Core) |
There was a problem hiding this 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; |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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)
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair point :) LGTM
This commit adds support for reading and writing sets as generic values in stream input and output. closes elastic#54708
This commit adds support for reading and writing sets as generic values
in stream input and output.
closes #54708