class_docstr: Abstract base class that defines how users develop AnalyticDB Spark.
class_docstr_tok: ["Abstract","base","class","that","defines","how","users","develop","AnalyticDB","Spark","."]
docstr: Pool for spark application termination.
  
  :param app_id: id of the spark application to monitor
docstr_tok: ["Pool","for","spark","application","termination",".",":","param","app_id",":","id","of","the","spark","application","to","monitor"]
code: def poll_for_termination(self, app_id: str) -> None:
      """
      Pool for spark application termination.
  
      :param app_id: id of the spark application to monitor
      """
      state = self.hook.get_spark_state(app_id)
      while AppState(state) not in AnalyticDBSparkHook.TERMINAL_STATES:
          self.log.debug(
              "Application with id %s is in state: %s", app_id, state
          )
          time.sleep(self.polling_interval)
          state = self.hook.get_spark_state(app_id)
      self.log.info(
          "Application with id %s terminated with state: %s",
          app_id,
          state,
      )
      self.log.info(
          "Web ui address is %s for application with id %s",
          self.hook.get_spark_web_ui_address(app_id),
          app_id,
      )
      self.log.info(self.hook.get_spark_log(app_id))
      if AppState(state) != AppState.COMPLETED:
          raise AirflowException(
              f"Application {app_id} did not succeed"
          )
  
imports: from __future__ import annotations
  import time
  from functools import cached_property
  from typing import TYPE_CHECKING, Any, Sequence
  from deprecated.classic import deprecated
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.models import BaseOperator
  from airflow.providers.alibaba.cloud.hooks.analyticdb_spark import AnalyticDBSparkHook, AppState
label_desc: Use image node_id 6 for calling the AnalyticDBSparkBaseOperator obj's underlying member method code with example usage: obj.poll_for_termination(app_id) without return types