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

Method wait_for_progress

tests/common/impala_test_suite.py:1610–1624  ·  view source on GitHub ↗

Waits for the given query handle to reach expected progress rate

(self, client, handle, expected_progress, timeout)

Source from the content-addressed store, hash-verified

1608 return actual_state
1609
1610 def wait_for_progress(self, client, handle, expected_progress, timeout):
1611 """Waits for the given query handle to reach expected progress rate"""
1612 start_time = time.time()
1613 summary = client.get_exec_summary(handle)
1614 while time.time() - start_time < timeout and \
1615 self.__get_query_progress_rate(summary.progress) <= expected_progress:
1616 summary = client.get_exec_summary(handle)
1617 time.sleep(0.5)
1618 actual_progress = self.__get_query_progress_rate(summary.progress)
1619 if actual_progress <= expected_progress:
1620 timeout_msg = "query '{0}' did not reach the expected progress {1}, current " \
1621 "progress {2}".format(client.handle_id(handle),
1622 expected_progress, actual_progress)
1623 raise Timeout(timeout_msg)
1624 return actual_progress
1625
1626 def __get_query_progress_rate(self, progress):
1627 if progress is None:

Calls 5

TimeoutClass · 0.90
get_exec_summaryMethod · 0.45
formatMethod · 0.45
handle_idMethod · 0.45

Tested by

no test coverage detected