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)
| 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 | """ |
no test coverage detected