MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / get_host

Method get_host

tests/unit/test_control_connection.py:49–56  ·  view source on GitHub ↗
(self, endpoint_or_address, port=None)

Source from the content-addressed store, hash-verified

47 self.token_map = {}
48
49 def get_host(self, endpoint_or_address, port=None):
50 if not isinstance(endpoint_or_address, EndPoint):
51 for host in self.hosts.values():
52 if (host.address == endpoint_or_address and
53 (port is None or host.broadcast_rpc_port is None or host.broadcast_rpc_port == port)):
54 return host
55 else:
56 return self.hosts.get(endpoint_or_address)
57
58 def all_hosts(self):
59 return self.hosts.values()

Calls 2

valuesMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected