-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Send discovered_nodes in bulk from control connection #299
Send discovered_nodes in bulk from control connection #299
Conversation
@harunzengin no need for a new Telemetry event. Let't just fire a bunch of |
lib/xandra/cluster.ex
Outdated
@@ -627,6 +627,20 @@ defmodule Xandra.Cluster do | |||
{:noreply, state} | |||
end | |||
|
|||
def handle_info({:discovered_hosts, hosts}, %__MODULE__{} = state) when is_list(hosts) do | |||
Logger.debug( | |||
"Discovered hosts: #{Enum.map(hosts, &Host.format_address/1) |> Enum.join(", ")}" |
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.
Nitpick:
"Discovered hosts: #{Enum.map(hosts, &Host.format_address/1) |> Enum.join(", ")}" | |
"Discovered hosts: #{Enum.map_join(hosts, ", ", &Host.format_address/1)}" |
discovered_hosts = | ||
Map.values(discovered_peers) |> Enum.map(fn %{host: %Host{} = host} -> host end) |
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.
If we don't care about the :status
, why don't we store the discovered peers as a list of %Host{}
directly
Shouldn't we fire |
Sorry yes that's what I meant @harunzengin |
@whatyouhide Done! |
Introduces a new message
{:discovered_hosts, [Host.t()]}
. I wasn't so sure about whether we should introduce a new telemetry event for this, like:host_discovered
. Not sure how useful it would be to be able to distinguish between a:host_added
(from cassandra gossip) and:host_discovered
(from peers table).Closes #296