MCPcopy Index your code
hub / github.com/apache/cassandra-python-driver / add_host

Method add_host

cassandra/cluster.py:2070–2083  ·  view source on GitHub ↗

Called when adding initial contact points and when the control connection subsequently discovers a new node. Returns a Host instance, and a flag indicating whether it was new in the metadata. Intended for internal use only.

(self, endpoint, datacenter=None, rack=None, signal=True, refresh_nodes=True)

Source from the content-addressed store, hash-verified

2068 return is_down
2069
2070 def add_host(self, endpoint, datacenter=None, rack=None, signal=True, refresh_nodes=True):
2071 """
2072 Called when adding initial contact points and when the control
2073 connection subsequently discovers a new node.
2074 Returns a Host instance, and a flag indicating whether it was new in
2075 the metadata.
2076 Intended for internal use only.
2077 """
2078 host, new = self.metadata.add_or_return_host(Host(endpoint, self.conviction_policy_factory, datacenter, rack))
2079 if new and signal:
2080 log.info("New Cassandra host %r discovered", host)
2081 self.on_add(host, refresh_nodes)
2082
2083 return host, new
2084
2085 def remove_host(self, host):
2086 """

Callers 2

connectMethod · 0.95

Calls 3

on_addMethod · 0.95
HostClass · 0.90
add_or_return_hostMethod · 0.80

Tested by

no test coverage detected