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

Method get_host

cassandra/metadata.py:341–350  ·  view source on GitHub ↗

Find a host in the metadata for a specific endpoint. If a string inet address and port are passed, iterate all hosts to match the :attr:`~.pool.Host.broadcast_rpc_address` and :attr:`~.pool.Host.broadcast_rpc_port`attributes.

(self, endpoint_or_address, port=None)

Source from the content-addressed store, hash-verified

339 return bool(self._hosts.pop(host.endpoint, False))
340
341 def get_host(self, endpoint_or_address, port=None):
342 """
343 Find a host in the metadata for a specific endpoint. If a string inet address and port are passed,
344 iterate all hosts to match the :attr:`~.pool.Host.broadcast_rpc_address` and
345 :attr:`~.pool.Host.broadcast_rpc_port`attributes.
346 """
347 if not isinstance(endpoint_or_address, EndPoint):
348 return self._get_host_by_address(endpoint_or_address, port)
349
350 return self._hosts.get(endpoint_or_address)
351
352 def _get_host_by_address(self, address, port=None):
353 for host in self._hosts.values():

Callers 10

refreshMethod · 0.95
make_query_planMethod · 0.45
connectMethod · 0.45
_handle_status_changeMethod · 0.45
_get_peers_queryMethod · 0.45
_signal_errorMethod · 0.45

Calls 2

_get_host_by_addressMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected