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

Method _set_new_connection

cassandra/cluster.py:3604–3614  ·  view source on GitHub ↗

Replace existing connection (if there is one) and close it.

(self, conn)

Source from the content-addressed store, hash-verified

3602 self._cluster.metadata.dbaas = self._connection._product_type == dscloud.DATASTAX_CLOUD_PRODUCT_TYPE
3603
3604 def _set_new_connection(self, conn):
3605 """
3606 Replace existing connection (if there is one) and close it.
3607 """
3608 with self._lock:
3609 old = self._connection
3610 self._connection = conn
3611
3612 if old:
3613 log.debug("[control connection] Closing old connection %r, replacing with %r", old, conn)
3614 old.close()
3615
3616 def _reconnect_internal(self):
3617 """

Callers 3

connectMethod · 0.95
_reconnectMethod · 0.95
on_reconnectionMethod · 0.80

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected