@@ -731,9 +731,6 @@ def auth_provider(self):
731731 be an instance of a subclass of :class:`~cassandra.auth.AuthProvider`,
732732 such as :class:`~.PlainTextAuthProvider`.
733733
734- When :attr:`~.Cluster.protocol_version` is 1, this should be
735- a function that accepts one argument, the IP address of a node,
736- and returns a dict of credentials for that node.
737734
738735 When not using authentication, this should be left as :const:`None`.
739736 """
@@ -1452,18 +1449,6 @@ def __init__(self,
14521449
14531450 self ._user_types = defaultdict (dict )
14541451
1455- self ._min_requests_per_connection = {
1456- HostDistance .LOCAL_RACK : DEFAULT_MIN_REQUESTS ,
1457- HostDistance .LOCAL : DEFAULT_MIN_REQUESTS ,
1458- HostDistance .REMOTE : DEFAULT_MIN_REQUESTS
1459- }
1460-
1461- self ._max_requests_per_connection = {
1462- HostDistance .LOCAL_RACK : DEFAULT_MAX_REQUESTS ,
1463- HostDistance .LOCAL : DEFAULT_MAX_REQUESTS ,
1464- HostDistance .REMOTE : DEFAULT_MAX_REQUESTS
1465- }
1466-
14671452 self ._core_connections_per_host = {
14681453 HostDistance .LOCAL_RACK : DEFAULT_MIN_CONNECTIONS_PER_LOCAL_HOST ,
14691454 HostDistance .LOCAL : DEFAULT_MIN_CONNECTIONS_PER_LOCAL_HOST ,
@@ -1666,48 +1651,6 @@ def add_execution_profile(self, name, profile, pool_wait_timeout=5):
16661651 if not_done :
16671652 raise OperationTimedOut ("Failed to create all new connection pools in the %ss timeout." )
16681653
1669- def get_min_requests_per_connection (self , host_distance ):
1670- return self ._min_requests_per_connection [host_distance ]
1671-
1672- def set_min_requests_per_connection (self , host_distance , min_requests ):
1673- """
1674- Sets a threshold for concurrent requests per connection, below which
1675- connections will be considered for disposal (down to core connections;
1676- see :meth:`~Cluster.set_core_connections_per_host`).
1677-
1678- Pertains to connection pool management in protocol versions {1,2}.
1679- """
1680- if self .protocol_version >= 3 :
1681- raise UnsupportedOperation (
1682- "Cluster.set_min_requests_per_connection() only has an effect "
1683- "when using protocol_version 1 or 2." )
1684- if min_requests < 0 or min_requests > 126 or \
1685- min_requests >= self ._max_requests_per_connection [host_distance ]:
1686- raise ValueError ("min_requests must be 0-126 and less than the max_requests for this host_distance (%d)" %
1687- (self ._min_requests_per_connection [host_distance ],))
1688- self ._min_requests_per_connection [host_distance ] = min_requests
1689-
1690- def get_max_requests_per_connection (self , host_distance ):
1691- return self ._max_requests_per_connection [host_distance ]
1692-
1693- def set_max_requests_per_connection (self , host_distance , max_requests ):
1694- """
1695- Sets a threshold for concurrent requests per connection, above which new
1696- connections will be created to a host (up to max connections;
1697- see :meth:`~Cluster.set_max_connections_per_host`).
1698-
1699- Pertains to connection pool management in protocol versions {1,2}.
1700- """
1701- if self .protocol_version >= 3 :
1702- raise UnsupportedOperation (
1703- "Cluster.set_max_requests_per_connection() only has an effect "
1704- "when using protocol_version 1 or 2." )
1705- if max_requests < 1 or max_requests > 127 or \
1706- max_requests <= self ._min_requests_per_connection [host_distance ]:
1707- raise ValueError ("max_requests must be 1-127 and greater than the min_requests for this host_distance (%d)" %
1708- (self ._min_requests_per_connection [host_distance ],))
1709- self ._max_requests_per_connection [host_distance ] = max_requests
1710-
17111654 def get_core_connections_per_host (self , host_distance ):
17121655 """
17131656 Gets the minimum number of connections per Session that will be opened
@@ -3101,13 +3044,11 @@ def _create_response_future(self, query, parameters, trace, custom_payload,
31013044 spec_exec_policy = execution_profile .speculative_execution_policy
31023045
31033046 fetch_size = query .fetch_size
3104- if fetch_size is FETCH_SIZE_UNSET and self . _protocol_version >= 2 :
3047+ if fetch_size is FETCH_SIZE_UNSET :
31053048 fetch_size = self .default_fetch_size
3106- elif self ._protocol_version == 1 :
3107- fetch_size = None
31083049
31093050 start_time = time .time ()
3110- if self ._protocol_version >= 3 and self . use_client_timestamp :
3051+ if self .use_client_timestamp :
31113052 timestamp = self .cluster .timestamp_generator ()
31123053 else :
31133054 timestamp = None
@@ -3378,11 +3319,7 @@ def add_or_renew_pool(self, host, is_host_addition):
33783319
33793320 def run_add_or_renew_pool ():
33803321 try :
3381- if self ._protocol_version >= 3 :
3382- new_pool = HostConnection (host , distance , self )
3383- else :
3384- # TODO remove host pool again ???
3385- new_pool = HostConnectionPool (host , distance , self )
3322+ new_pool = HostConnection (host , distance , self )
33863323 except AuthenticationFailed as auth_exc :
33873324 conn_exc = ConnectionException (str (auth_exc ), endpoint = host )
33883325 self .cluster .signal_connection_failure (host , conn_exc , is_host_addition )
0 commit comments