@@ -192,15 +192,6 @@ def _connection_reduce_fn(val,import_fn):
192192log = logging .getLogger (__name__ )
193193
194194
195- DEFAULT_MIN_REQUESTS = 5
196- DEFAULT_MAX_REQUESTS = 100
197-
198- DEFAULT_MIN_CONNECTIONS_PER_LOCAL_HOST = 2
199- DEFAULT_MAX_CONNECTIONS_PER_LOCAL_HOST = 8
200-
201- DEFAULT_MIN_CONNECTIONS_PER_REMOTE_HOST = 1
202- DEFAULT_MAX_CONNECTIONS_PER_REMOTE_HOST = 2
203-
204195_GRAPH_PAGING_MIN_DSE_VERSION = Version ('6.8.0' )
205196
206197_NOT_SET = object ()
@@ -1449,18 +1440,6 @@ def __init__(self,
14491440
14501441 self ._user_types = defaultdict (dict )
14511442
1452- self ._core_connections_per_host = {
1453- HostDistance .LOCAL_RACK : DEFAULT_MIN_CONNECTIONS_PER_LOCAL_HOST ,
1454- HostDistance .LOCAL : DEFAULT_MIN_CONNECTIONS_PER_LOCAL_HOST ,
1455- HostDistance .REMOTE : DEFAULT_MIN_CONNECTIONS_PER_REMOTE_HOST
1456- }
1457-
1458- self ._max_connections_per_host = {
1459- HostDistance .LOCAL_RACK : DEFAULT_MAX_CONNECTIONS_PER_LOCAL_HOST ,
1460- HostDistance .LOCAL : DEFAULT_MAX_CONNECTIONS_PER_LOCAL_HOST ,
1461- HostDistance .REMOTE : DEFAULT_MAX_CONNECTIONS_PER_REMOTE_HOST
1462- }
1463-
14641443 self .executor = self ._create_thread_pool_executor (max_workers = executor_threads )
14651444 self .scheduler = _Scheduler (self .executor )
14661445
@@ -1651,73 +1630,6 @@ def add_execution_profile(self, name, profile, pool_wait_timeout=5):
16511630 if not_done :
16521631 raise OperationTimedOut ("Failed to create all new connection pools in the %ss timeout." )
16531632
1654- def get_core_connections_per_host (self , host_distance ):
1655- """
1656- Gets the minimum number of connections per Session that will be opened
1657- for each host with :class:`~.HostDistance` equal to `host_distance`.
1658- The default is 2 for :attr:`~HostDistance.LOCAL` and 1 for
1659- :attr:`~HostDistance.REMOTE`.
1660-
1661- This property is ignored if :attr:`~.Cluster.protocol_version` is
1662- 3 or higher.
1663- """
1664- return self ._core_connections_per_host [host_distance ]
1665-
1666- def set_core_connections_per_host (self , host_distance , core_connections ):
1667- """
1668- Sets the minimum number of connections per Session that will be opened
1669- for each host with :class:`~.HostDistance` equal to `host_distance`.
1670- The default is 2 for :attr:`~HostDistance.LOCAL` and 1 for
1671- :attr:`~HostDistance.REMOTE`.
1672-
1673- Protocol version 1 and 2 are limited in the number of concurrent
1674- requests they can send per connection. The driver implements connection
1675- pooling to support higher levels of concurrency.
1676-
1677- If :attr:`~.Cluster.protocol_version` is set to 3 or higher, this
1678- is not supported (there is always one connection per host, unless
1679- the host is remote and :attr:`connect_to_remote_hosts` is :const:`False`)
1680- and using this will result in an :exc:`~.UnsupportedOperation`.
1681- """
1682- if self .protocol_version >= 3 :
1683- raise UnsupportedOperation (
1684- "Cluster.set_core_connections_per_host() only has an effect "
1685- "when using protocol_version 1 or 2." )
1686- old = self ._core_connections_per_host [host_distance ]
1687- self ._core_connections_per_host [host_distance ] = core_connections
1688- if old < core_connections :
1689- self ._ensure_core_connections ()
1690-
1691- def get_max_connections_per_host (self , host_distance ):
1692- """
1693- Gets the maximum number of connections per Session that will be opened
1694- for each host with :class:`~.HostDistance` equal to `host_distance`.
1695- The default is 8 for :attr:`~HostDistance.LOCAL` and 2 for
1696- :attr:`~HostDistance.REMOTE`.
1697-
1698- This property is ignored if :attr:`~.Cluster.protocol_version` is
1699- 3 or higher.
1700- """
1701- return self ._max_connections_per_host [host_distance ]
1702-
1703- def set_max_connections_per_host (self , host_distance , max_connections ):
1704- """
1705- Sets the maximum number of connections per Session that will be opened
1706- for each host with :class:`~.HostDistance` equal to `host_distance`.
1707- The default is 2 for :attr:`~HostDistance.LOCAL` and 1 for
1708- :attr:`~HostDistance.REMOTE`.
1709-
1710- If :attr:`~.Cluster.protocol_version` is set to 3 or higher, this
1711- is not supported (there is always one connection per host, unless
1712- the host is remote and :attr:`connect_to_remote_hosts` is :const:`False`)
1713- and using this will result in an :exc:`~.UnsupportedOperation`.
1714- """
1715- if self .protocol_version >= 3 :
1716- raise UnsupportedOperation (
1717- "Cluster.set_max_connections_per_host() only has an effect "
1718- "when using protocol_version 1 or 2." )
1719- self ._max_connections_per_host [host_distance ] = max_connections
1720-
17211633 def connection_factory (self , endpoint , host_conn = None , * args , ** kwargs ):
17221634 """
17231635 Called to create a new connection with proper configuration.
0 commit comments