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

Method _fetch_profile_loop

tests/hs2/test_hs2.py:1216–1242  ·  view source on GitHub ↗
(self, exception_array, query_uuid, op_handle)

Source from the content-addressed store, hash-verified

1214 assert num_successful == 1, "Only one client should have been able to unregister"
1215
1216 def _fetch_profile_loop(self, exception_array, query_uuid, op_handle):
1217 try:
1218 # This thread will keep fetching the profile to make sure that the
1219 # ClientRequestState object can be continually accessed during unregistration.
1220 get_profile_req = ImpalaHiveServer2Service.TGetRuntimeProfileReq()
1221 get_profile_req.operationHandle = op_handle
1222 get_profile_req.sessionHandle = self.session_handle
1223
1224 def find_query(array):
1225 """Find the query for this test in a JSON array returned from web UI."""
1226 return [q for q in array if query_uuid in q['stmt']]
1227 # Loop until the query has been unregistered and moved out of in-flight
1228 # queries.
1229 registered = True
1230 while registered:
1231 get_profile_resp = self.hs2_client.GetRuntimeProfile(get_profile_req)
1232 TestHS2.check_response(get_profile_resp)
1233 if "Unregister query" in get_profile_resp.profile:
1234 json = self.impalad_test_service.get_queries_json()
1235 inflight_query = find_query(json['in_flight_queries'])
1236 completed_query = find_query(json['completed_queries'])
1237 # Query should only be in one list.
1238 assert len(inflight_query) + len(completed_query) == 1
1239 if completed_query:
1240 registered = False
1241 except BaseException as e:
1242 exception_array[0] = e
1243
1244 def _unregister_query(self, thread_num, exceptions, client, op_handle):
1245 # Add some delay/jitter so that unregisters come in at different times.

Callers

nothing calls this directly

Calls 3

check_responseMethod · 0.80
get_queries_jsonMethod · 0.80
GetRuntimeProfileMethod · 0.45

Tested by

no test coverage detected