MCPcopy Create free account
hub / github.com/apache/impala / cancel_query

Method cancel_query

tests/util/cancel_util.py:145–162  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

143 self.client.log_client('Stop fetching results')
144
145 def cancel_query(self):
146 assert self.handle is not None, \
147 "handle is None. Did the query fail to start?"
148 if self.use_kill_query_statement:
149 # Run kill query using ImpylaHS2Connection.
150 with create_connection(
151 host_port=self.client.get_host_port(),
152 protocol=self.client.get_test_protocol(),
153 ) as kill_client:
154 kill_client.connect()
155 if self.exec_option:
156 kill_client.set_configuration(self.exec_option)
157 assert_kill_ok(kill_client, self.client.handle_id(self.handle))
158 else:
159 # Run cancellation using separate client/connection.
160 with MinimalHS2Connection(IMPALAD_HS2_HOST_PORT) as cancel_client:
161 cancel_resp = cancel_client.cancel(self.handle)
162 assert cancel_resp.status.statusCode == TCLIService.TStatusCode.SUCCESS_STATUS
163
164 def close_query(self):
165 with MinimalHS2Connection(IMPALAD_HS2_HOST_PORT) as close_client:

Callers 2

test_hs2_query_cancelMethod · 0.95

Calls 9

create_connectionFunction · 0.90
assert_kill_okFunction · 0.85
set_configurationMethod · 0.80
get_host_portMethod · 0.45
get_test_protocolMethod · 0.45
connectMethod · 0.45
handle_idMethod · 0.45
cancelMethod · 0.45

Tested by 1

test_hs2_query_cancelMethod · 0.76