:py:mod:`astronomer.providers.amazon.aws.sensors.emr` ===================================================== .. py:module:: astronomer.providers.amazon.aws.sensors.emr Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: astronomer.providers.amazon.aws.sensors.emr.EmrContainerSensorAsync astronomer.providers.amazon.aws.sensors.emr.EmrStepSensorAsync astronomer.providers.amazon.aws.sensors.emr.EmrJobFlowSensorAsync .. py:class:: EmrContainerSensorAsync(*, virtual_cluster_id, job_id, max_retries = None, aws_conn_id = 'aws_default', poll_interval = 10, **kwargs) Bases: :py:obj:`airflow.providers.amazon.aws.sensors.emr.EmrContainerSensor` EmrContainerSensorAsync is async version of EmrContainerSensor, Asks for the state of the job run until it reaches a failure state or success state. If the job run fails, the task will fail. :param virtual_cluster_id: Reference Emr cluster id :param job_id: job_id to check the state :param max_retries: Number of times to poll for query state before returning the current state, defaults to None :param aws_conn_id: aws connection to use, defaults to ``aws_default`` :param poll_interval: Time in seconds to wait between two consecutive call to check query status on athena, defaults to 10 .. py:method:: execute(context) Defers trigger class to poll for state of the job run until it reaches a failure state or success state .. py:method:: execute_complete(context, event) Callback for when the trigger fires - returns immediately. Relies on trigger to throw an exception, otherwise it assumes execution was successful. .. py:class:: EmrStepSensorAsync(*, job_flow_id, step_id, target_states = None, failed_states = None, **kwargs) Bases: :py:obj:`airflow.providers.amazon.aws.sensors.emr.EmrStepSensor` Async (deferring) version of EmrStepSensor Asks for the state of the step until it reaches any of the target states. If the sensor errors out, then the task will fail With the default target states, sensor waits step to be COMPLETED. For more details see - https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/emr.html#EMR.Client.describe_step :param job_flow_id: job_flow_id which contains the step check the state of :param step_id: step to check the state of :param target_states: the target states, sensor waits until step reaches any of these states :param failed_states: the failure states, sensor fails when step reaches any of these states .. py:method:: execute(context) Deferred and give control to trigger .. py:method:: execute_complete(context, event) Callback for when the trigger fires - returns immediately. Relies on trigger to throw an exception, otherwise it assumes execution was successful. .. py:class:: EmrJobFlowSensorAsync(*, poll_interval = 5, **kwargs) Bases: :py:obj:`airflow.providers.amazon.aws.sensors.emr.EmrJobFlowSensor` Async EMR Job flow sensor polls for the cluster state until it reaches any of the target states. If it fails the sensor errors, failing the task. With the default target states, sensor waits cluster to be terminated. When target_states is set to ['RUNNING', 'WAITING'] sensor waits until job flow to be ready (after 'STARTING' and 'BOOTSTRAPPING' states) :param job_flow_id: job_flow_id to check the state of cluster :param target_states: the target states, sensor waits until job flow reaches any of these states :param failed_states: the failure states, sensor fails when job flow reaches any of these states .. py:method:: execute(context) Defers trigger class to poll for state of the job run until it reaches a failure state or success state .. py:method:: execute_complete(context, event) Callback for when the trigger fires - returns immediately. Relies on trigger to throw an exception, otherwise it assumes execution was successful.