airflow.models.pool¶
Module Contents¶
-
class
airflow.models.pool.PoolStats[source]¶ Bases:
airflow.typing_compat.TypedDictDictionary containing Pool Stats
-
class
airflow.models.pool.Pool[source]¶ Bases:
airflow.models.base.Basethe class to get Pool info.
-
static
get_pool(pool_name, session: Session = None)[source]¶ Get the Pool with specific pool name from the Pools.
- Parameters
pool_name – The pool name of the Pool to get.
session – SQLAlchemy ORM Session
- Returns
the pool object
-
static
get_default_pool(session: Session = None)[source]¶ Get the Pool of the default_pool from the Pools.
- Parameters
session – SQLAlchemy ORM Session
- Returns
the pool object
-
static
slots_stats(*, lock_rows: bool = False, session: Session = None)[source]¶ Get Pool stats (Number of Running, Queued, Open & Total tasks)
If
lock_rowsis True, and the database engine in use supports theNOWAITsyntax, then a non-blocking lock will be attempted – if the lock is not available then SQLAlchemy will throw an OperationalError.- Parameters
lock_rows – Should we attempt to obtain a row-level lock on all the Pool rows returns
session – SQLAlchemy ORM Session
-
occupied_slots(self, session: Session)[source]¶ Get the number of slots used by running/queued tasks at the moment.
- Parameters
session – SQLAlchemy ORM Session
- Returns
the used number of slots
-
running_slots(self, session: Session)[source]¶ Get the number of slots used by running tasks at the moment.
- Parameters
session – SQLAlchemy ORM Session
- Returns
the used number of slots
-
static