airflow.providers.amazon.aws.utils.waiter¶
屬性¶
類¶
用於控制 EMRClusterJobFlowOperator 中的等待行為。 |
函式¶
|
呼叫 get_state_callable 直到達到 desired_state 或 failure_states。 |
|
模組內容¶
- airflow.providers.amazon.aws.utils.waiter.waiter(get_state_callable, get_state_args, parse_response, desired_state, failure_states, object_type, action, countdown=25 * 60, check_interval_seconds=60)[原始碼]¶
呼叫 get_state_callable 直到達到 desired_state 或 failure_states。
- 請注意:雖然尚未棄用,但我們正在逐步淘汰此方法
並鼓勵使用自定義 boto waiter,具體請參閱 https://github.com/apache/airflow/tree/main/airflow/providers/amazon/aws/waiters
- 引數:
get_state_callable (Callable) – 一個可呼叫物件,將一直執行直到返回 True
get_state_args (dict) – 傳遞給 get_state_callable 的引數
parse_response (list) – 從 get_state_callable 的響應中提取狀態的字典鍵
desired_state (set) – 等待直到獲取器返回此值
failure_states (set) – 一組表示失敗的狀態,如果在達到 desired_state 之前達到其中任何一個,則應丟擲異常
object_type (str) – 用於報告字串。你在等待什麼?(應用程式、任務等)
action (str) – 用於報告字串。你在等待什麼操作?(建立、刪除等)
countdown (int | float | None) – waiter 應等待所需狀態的秒數,超時前。預設為 25 * 60 秒。None = 無限。
check_interval_seconds (int) – waiter 在嘗試重新呼叫 get_state_callable 之前應等待的秒數。預設為 60 秒。
- class airflow.providers.amazon.aws.utils.waiter.WaitPolicy[原始碼]¶
-
用於控制 EMRClusterJobFlowOperator 中的等待行為。
選項: - WAIT_FOR_COMPLETION - 將等待叢集報告“Running”狀態 - WAIT_FOR_STEPS_COMPLETION - 將等待叢集報告“Terminated”狀態
-
airflow.providers.amazon.aws.utils.waiter.WAITER_POLICY_NAME_MAPPING:
dict[WaitPolicy,str][原始碼]¶