@@ -625,15 +625,15 @@ class ControlConnectionQueryFallback(enum.Enum):
625625 available. Session startup is allowed to proceed even if the initial pool
626626 attempts all fail.
627627
628- ``NoNodePoolFallback `` disables node-pool creation for the session and uses
628+ ``SkipPoolCreation `` disables node-pool creation for the session and uses
629629 the control-connection fallback path for application queries.
630630
631631 The fallback path is not used for requests targeted to an explicit host.
632632 """
633633
634634 Disabled = "Disabled"
635635 Fallback = "Fallback"
636- NoNodePoolFallback = "NoNodePoolFallback "
636+ SkipPoolCreation = "SkipPoolCreation "
637637
638638
639639class Cluster (object ):
@@ -962,7 +962,7 @@ def default_retry_policy(self, policy):
962962
963963 ``Disabled`` keeps the old behavior.
964964 ``Fallback`` enables control-connection fallback when no usable node pools exist.
965- ``NoNodePoolFallback `` skips node-pool creation and uses the control connection fallback path.
965+ ``SkipPoolCreation `` skips node-pool creation and uses the control connection fallback path.
966966 This fallback is still not used for requests targeted to an explicit host.
967967 """
968968
@@ -2668,7 +2668,7 @@ def __init__(self, cluster, hosts, keyspace=None):
26682668 # create connection pools in parallel
26692669 self ._initial_connect_futures = set ()
26702670 fallback_mode = self .cluster .allow_control_connection_query_fallback
2671- if fallback_mode is not ControlConnectionQueryFallback .NoNodePoolFallback :
2671+ if fallback_mode is not ControlConnectionQueryFallback .SkipPoolCreation :
26722672 for host in hosts :
26732673 future = self .add_or_renew_pool (host , is_host_addition = False )
26742674 if future :
@@ -3283,7 +3283,7 @@ def add_or_renew_pool(self, host, is_host_addition):
32833283 """
32843284 For internal use only.
32853285 """
3286- if self .cluster .allow_control_connection_query_fallback is ControlConnectionQueryFallback .NoNodePoolFallback :
3286+ if self .cluster .allow_control_connection_query_fallback is ControlConnectionQueryFallback .SkipPoolCreation :
32873287 return None
32883288
32893289 distance = self ._profile_manager .distance (host )
@@ -3356,7 +3356,7 @@ def update_created_pools(self):
33563356
33573357 For internal use only.
33583358 """
3359- if self .cluster .allow_control_connection_query_fallback is ControlConnectionQueryFallback .NoNodePoolFallback :
3359+ if self .cluster .allow_control_connection_query_fallback is ControlConnectionQueryFallback .SkipPoolCreation :
33603360 return set ()
33613361
33623362 futures = set ()
@@ -4592,7 +4592,7 @@ def _on_timeout(self, _attempts=0):
45924592 self ._connection .orphaned_threshold_reached = True
45934593
45944594 pool .return_connection (self ._connection , stream_was_orphaned = True )
4595- elif getattr ( self ._connection , ' is_control_connection' , False ) :
4595+ elif self ._connection . is_control_connection :
45964596 with self ._connection .lock :
45974597 self ._connection .orphaned_request_ids .add (self ._req_id )
45984598 if len (self ._connection .orphaned_request_ids ) >= self ._connection .orphaned_threshold :
@@ -4682,15 +4682,12 @@ def _has_usable_node_pool(self):
46824682 return any (pool and not pool .is_shutdown for pool in pools )
46834683
46844684 def _fallback_to_control_connection (self ):
4685- fallback_mode = getattr (
4686- self .session .cluster ,
4687- 'allow_control_connection_query_fallback' ,
4688- ControlConnectionQueryFallback .Disabled )
4685+ fallback_mode = self .session .cluster .allow_control_connection_query_fallback
46894686 if fallback_mode is ControlConnectionQueryFallback .Disabled :
46904687 return False
46914688 if self ._host or self ._control_connection_query_attempted :
46924689 return False
4693- if fallback_mode is ControlConnectionQueryFallback .NoNodePoolFallback :
4690+ if fallback_mode is ControlConnectionQueryFallback .SkipPoolCreation :
46944691 return True
46954692 return not self ._has_usable_node_pool ()
46964693
@@ -4886,7 +4883,7 @@ def start_fetching_next_page(self):
48864883
48874884 def _reprepare (self , prepare_message , host , connection , pool ):
48884885 cb = partial (self .session .submit , self ._execute_after_prepare , host , connection , pool )
4889- if pool is None and getattr ( connection , ' is_control_connection' , False ) :
4886+ if pool is None and connection . is_control_connection :
48904887 request_id = self ._query_control_connection (prepare_message , cb = cb ,
48914888 connection = connection , host = host )
48924889 else :
@@ -5110,7 +5107,7 @@ def _execute_after_prepare(self, host, connection, pool, response):
51105107
51115108 # use self._query to re-use the same host and
51125109 # at the same time properly borrow the connection
5113- if pool is None and getattr ( connection , ' is_control_connection' , False ) :
5110+ if pool is None and connection . is_control_connection :
51145111 request_id = self ._query_control_connection (connection = connection , host = host )
51155112 else :
51165113 request_id = self ._query (host )
0 commit comments