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

Method wait_for

tests/common/impala_connection.py:1074–1085  ·  view source on GitHub ↗

Wait until the query is in a terminal state.

(self, operation_handle, timeout_s=60)

Source from the content-addressed store, hash-verified

1072 return self.__get_operation(operation_handle).get_status()
1073
1074 def wait_for(self, operation_handle, timeout_s=60):
1075 """
1076 Wait until the query is in a terminal state.
1077 """
1078 start_time = time.time()
1079 while True:
1080 operation_state = self.get_state(operation_handle)
1081 if operation_state not in ("PENDING_STATE", "INITIALIZED_STATE", "RUNNING_STATE"):
1082 return operation_state
1083 if time.time() - start_time > timeout_s:
1084 raise Exception("Timed out waiting for the query")
1085 time.sleep(0.1)
1086
1087 def cancel(self, operation_handle):
1088 self.log_handle(operation_handle, "canceling operation")

Callers 4

test_interrupt_sleepMethod · 0.80
execute_asyncMethod · 0.80
WaitForRpcLockedMethod · 0.80

Calls 1

get_stateMethod · 0.95

Tested by 1

test_interrupt_sleepMethod · 0.64