@@ -203,6 +203,7 @@ class Connection(object):
203203 out_buffer_size = 4096
204204
205205 cql_version = None
206+ no_compact = False
206207 protocol_version = ProtocolVersion .MAX_SUPPORTED
207208
208209 keyspace = None
@@ -259,7 +260,7 @@ class Connection(object):
259260 def __init__ (self , host = '127.0.0.1' , port = 9042 , authenticator = None ,
260261 ssl_options = None , sockopts = None , compression = True ,
261262 cql_version = None , protocol_version = ProtocolVersion .MAX_SUPPORTED , is_control_connection = False ,
262- user_type_map = None , connect_timeout = None , allow_beta_protocol_version = False ):
263+ user_type_map = None , connect_timeout = None , allow_beta_protocol_version = False , no_compact = False ):
263264 self .host = host
264265 self .port = port
265266 self .authenticator = authenticator
@@ -272,6 +273,7 @@ def __init__(self, host='127.0.0.1', port=9042, authenticator=None,
272273 self .user_type_map = user_type_map
273274 self .connect_timeout = connect_timeout
274275 self .allow_beta_protocol_version = allow_beta_protocol_version
276+ self .no_compact = no_compact
275277 self ._push_watchers = defaultdict (set )
276278 self ._requests = {}
277279 self ._iobuf = io .BytesIO ()
@@ -637,7 +639,7 @@ def _send_options_message(self):
637639 "specified" , id (self ), self .host )
638640 self ._compressor = None
639641 self .cql_version = DEFAULT_CQL_VERSION
640- self ._send_startup_message ()
642+ self ._send_startup_message (no_compact = self . no_compact )
641643 else :
642644 log .debug ("Sending initial options message for new connection (%s) to %s" , id (self ), self .host )
643645 self .send_msg (OptionsMessage (), self .get_request_id (), self ._handle_options_response )
@@ -703,14 +705,16 @@ def _handle_options_response(self, options_response):
703705 self ._compressor , self .decompressor = \
704706 locally_supported_compressions [compression_type ]
705707
706- self ._send_startup_message (compression_type )
708+ self ._send_startup_message (compression_type , no_compact = self . no_compact )
707709
708710 @defunct_on_error
709- def _send_startup_message (self , compression = None ):
711+ def _send_startup_message (self , compression = None , no_compact = False ):
710712 log .debug ("Sending StartupMessage on %s" , self )
711713 opts = {}
712714 if compression :
713715 opts ['COMPRESSION' ] = compression
716+ if no_compact :
717+ opts ['NO_COMPACT' ] = 'true'
714718 sm = StartupMessage (cqlversion = self .cql_version , options = opts )
715719 self .send_msg (sm , self .get_request_id (), cb = self ._handle_startup_response )
716720 log .debug ("Sent StartupMessage on %s" , self )
0 commit comments