-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add zenPings(ImmutableList) again #9099
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
Conversation
Commit 95c2d84 removed `zenPings(ImmutableList<? extends ZenPing> pings)` which actually used by discovery plugins. For example here: https://github.com/elasticsearch/elasticsearch-cloud-aws/blob/master/src/main/java/org/elasticsearch/discovery/ec2/Ec2Discovery.java#L68 This PR add it back.
@@ -68,6 +68,22 @@ public ZenPingService(Settings settings, ThreadPool threadPool, TransportService | |||
return this.zenPings; | |||
} | |||
|
|||
/** | |||
* This method could be used by discovery plugins |
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.
can we explain why it may be useful for discovery plugins? This missing bit is exactly why it got removed in the first place :)
I also wonder if we can find a different way to achieve the same result, avoiding to expose a public method that is used by plugins only. That said I don't know this part of es that much...
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.
Well, we are adding a HostsProvider
to unicastZenPing
. This hosts provider makes AWS/Azure/GCE API calls to get back the list of potential elasticsearch nodes.
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.
By "can we explain" I meant that I would like to see this info in the comment, anything else is going to get lost. Even if I understand it now and I look at the link you provided, this is not going to be useful the next time we wonder why this method is there.
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.
Yeah. I understood your comment as a suggestion to enhance my Java comment. I agree.
I was answering actually to the last part of your comment on how we could do something different in core. :)
Update comment
@javanna PR updated. Let me know. |
@dadoonet, wouldn't it be easier to register this unicast provider in Ec2DiscoveryModule constructor by calling addUnicastHostProvider method of ZenDiscoveryModule instead of fishing for UnicastZenPing? It seems a bit cleaner and simpler to me. What do you think? |
@imotov Agreed. Something like this? https://github.com/dadoonet/elasticsearch-cloud-aws/compare/pr/ec2-host-provider I think this should work fine. |
@imotov Closing this one in favor of elastic/elasticsearch-cloud-aws#160 |
Commit 95c2d84 removed
zenPings(ImmutableList<? extends ZenPing> pings)
which actually used by discovery plugins.For example here: https://github.com/elasticsearch/elasticsearch-cloud-aws/blob/master/src/main/java/org/elasticsearch/discovery/ec2/Ec2Discovery.java#L68
This PR add it back.