#NEWLINE# def __init__( self , host = '127.0.0.1' , port = 9042 , authenticator = None , ssl_options = None , sockopts = None , compression = True , cql_version = None , protocol_version = MAX_SUPPORTED_VERSION , is_control_connection = False , user_type_map = None , connect_timeout = None ) : #NEWLINE# #INDENT# self . host = host #NEWLINE# self . port = port #NEWLINE# self . authenticator = authenticator #NEWLINE# self . ssl_options = ( ssl_options . copy ( ) if ssl_options else None ) #NEWLINE# self . sockopts = sockopts #NEWLINE# self . compression = compression #NEWLINE# self . cql_version = cql_version #NEWLINE# self . protocol_version = protocol_version #NEWLINE# self . is_control_connection = is_control_connection #NEWLINE# self . user_type_map = user_type_map #NEWLINE# self . connect_timeout = connect_timeout #NEWLINE# self . _push_watchers = defaultdict ( set ) #NEWLINE# self . _requests = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . _iobuf = io . BytesIO ( ) #NEWLINE# if ssl_options : #NEWLINE# #INDENT# self . _check_hostname = bool ( self . ssl_options . pop ( 'check_hostname' , False ) ) #NEWLINE# if self . _check_hostname : #NEWLINE# #INDENT# if ( not getattr ( ssl , 'match_hostname' , None ) ) : #NEWLINE# #INDENT# raise RuntimeError ( "ssl_options specify 'check_hostname', but ssl.match_hostname is not provided. Patch or upgrade Python to use this option." ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( protocol_version >= 3 ) : #NEWLINE# #INDENT# self . max_request_id = min ( ( self . max_in_flight - 1 ) , ( ( 2 ** 15 ) - 1 ) ) #NEWLINE# initial_size = min ( 300 , self . max_in_flight ) #NEWLINE# self . request_ids = deque ( range ( initial_size ) ) #NEWLINE# self . highest_request_id = ( initial_size - 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . max_request_id = min ( self . max_in_flight , ( ( 2 ** 7 ) - 1 ) ) #NEWLINE# self . request_ids = deque ( range ( ( self . max_request_id + 1 ) ) ) #NEWLINE# self . highest_request_id = self . max_request_id #NEWLINE# #UNINDENT# self . lock = RLock ( ) #NEWLINE# self . connected_event = Event ( )