:py:mod:`astronomer.providers.amazon.aws.triggers.emr` ====================================================== .. py:module:: astronomer.providers.amazon.aws.triggers.emr Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: astronomer.providers.amazon.aws.triggers.emr.EmrContainerBaseTrigger astronomer.providers.amazon.aws.triggers.emr.EmrContainerSensorTrigger astronomer.providers.amazon.aws.triggers.emr.EmrContainerOperatorTrigger astronomer.providers.amazon.aws.triggers.emr.EmrStepSensorTrigger astronomer.providers.amazon.aws.triggers.emr.EmrJobFlowSensorTrigger .. py:class:: EmrContainerBaseTrigger(virtual_cluster_id, job_id, aws_conn_id = 'aws_default', poll_interval = 10, max_tries = None, **kwargs) Bases: :py:obj:`airflow.triggers.base.BaseTrigger` Poll for the status of EMR container until reaches terminal state :param virtual_cluster_id: Reference Emr cluster id :param job_id: job_id to check the state :param max_tries: maximum try attempts for polling the status :param aws_conn_id: Reference to AWS connection id :param poll_interval: polling period in seconds to check for the status .. py:class:: EmrContainerSensorTrigger(virtual_cluster_id, job_id, aws_conn_id = 'aws_default', poll_interval = 10, max_tries = None, **kwargs) Bases: :py:obj:`EmrContainerBaseTrigger` Poll for the status of EMR container until reaches terminal state .. py:method:: serialize() Serializes EmrContainerSensorTrigger arguments and classpath. .. py:method:: run() :async: Make async connection to EMR container, polls for the job state .. py:class:: EmrContainerOperatorTrigger(virtual_cluster_id, job_id, aws_conn_id = 'aws_default', poll_interval = 10, max_tries = None, **kwargs) Bases: :py:obj:`EmrContainerBaseTrigger` Poll for the status of EMR container until reaches terminal state .. py:attribute:: INTERMEDIATE_STATES :annotation: :List[str] = ['PENDING', 'SUBMITTED', 'RUNNING'] .. py:attribute:: FAILURE_STATES :annotation: :List[str] = ['FAILED', 'CANCELLED', 'CANCEL_PENDING'] .. py:attribute:: SUCCESS_STATES :annotation: :List[str] = ['COMPLETED'] .. py:attribute:: TERMINAL_STATES :annotation: :List[str] = ['COMPLETED', 'FAILED', 'CANCELLED', 'CANCEL_PENDING'] .. py:method:: serialize() Serializes EmrContainerOperatorTrigger arguments and classpath. .. py:method:: run() :async: Run until EMR container reaches the desire state .. py:class:: EmrStepSensorTrigger(job_flow_id, step_id, aws_conn_id, poke_interval, target_states = None, failed_states = None) Bases: :py:obj:`airflow.triggers.base.BaseTrigger` A trigger that fires once AWS EMR cluster step reaches either target or failed state :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 aws_conn_id: aws connection to use, defaults to 'aws_default' :param poke_interval: Time in seconds to wait between two consecutive call to check emr cluster step state :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:: serialize() Serializes EmrStepSensorTrigger arguments and classpath. .. py:method:: run() :async: Run until AWS EMR cluster step reach target or failed state .. py:class:: EmrJobFlowSensorTrigger(job_flow_id, aws_conn_id, poll_interval, target_states = None, failed_states = None) Bases: :py:obj:`airflow.triggers.base.BaseTrigger` EmrJobFlowSensorTrigger is fired as deferred class with params to run the task in trigger worker, when EMR JobFlow is created :param job_flow_id: job_flow_id to check the state of :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 :param poll_interval: polling period in seconds to check for the status .. py:method:: serialize() Serializes EmrJobFlowSensorTrigger arguments and classpath. .. py:method:: run() :async: Make async connection to EMR container, polls for the target job state