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

Class DefaultEndPoint

cassandra/connection.py:182–216  ·  view source on GitHub ↗

Default EndPoint implementation, basically just an address and port.

Source from the content-addressed store, hash-verified

180
181@total_ordering
182class DefaultEndPoint(EndPoint):
183 """
184 Default EndPoint implementation, basically just an address and port.
185 """
186
187 def __init__(self, address, port=9042):
188 self._address = address
189 self._port = port
190
191 @property
192 def address(self):
193 return self._address
194
195 @property
196 def port(self):
197 return self._port
198
199 def resolve(self):
200 return self._address, self._port
201
202 def __eq__(self, other):
203 return isinstance(other, DefaultEndPoint) and \
204 self.address == other.address and self.port == other.port
205
206 def __hash__(self):
207 return hash((self.address, self.port))
208
209 def __lt__(self, other):
210 return (self.address, self.port) < (other.address, other.port)
211
212 def __str__(self):
213 return str("%s:%d" % (self.address, self.port))
214
215 def __repr__(self):
216 return "<%s: %s:%d>" % (self.__class__.__name__, self.address, self.port)
217
218
219class DefaultEndPointFactory(EndPointFactory):

Callers 15

validate_ssl_optionsFunction · 0.90
test_host_resolutionMethod · 0.90
make_connectionMethod · 0.90
test_timeoutMethod · 0.90
test_endpoint_resolveMethod · 0.90
__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by 15

validate_ssl_optionsFunction · 0.72
test_host_resolutionMethod · 0.72
make_connectionMethod · 0.72
test_timeoutMethod · 0.72
test_endpoint_resolveMethod · 0.72
__init__Method · 0.72
__init__Method · 0.72