airflow.models.pool¶
Module Contents¶
Classes¶
| Dictionary containing Pool Stats | |
| the class to get Pool info. | 
- class airflow.models.pool.PoolStats[source]¶
- Bases: - airflow.typing_compat.TypedDict- Dictionary containing Pool Stats 
- class airflow.models.pool.Pool[source]¶
- Bases: - airflow.models.base.Base- the class to get Pool info. - static get_pool(pool_name, session=NEW_SESSION)[source]¶
- Get the Pool with specific pool name from the Pools. - Parameters
- pool_name (str) – The pool name of the Pool to get. 
- session (sqlalchemy.orm.session.Session) – SQLAlchemy ORM Session 
 
- Returns
- the pool object 
 
 - static get_default_pool(session=NEW_SESSION)[source]¶
- Get the Pool of the default_pool from the Pools. - Parameters
- session (sqlalchemy.orm.session.Session) – SQLAlchemy ORM Session 
- Returns
- the pool object 
 
 - static is_default_pool(id, session=NEW_SESSION)[source]¶
- Check id if is the default_pool. - Parameters
- id (int) – pool id 
- session (sqlalchemy.orm.session.Session) – SQLAlchemy ORM Session 
 
- Returns
- True if id is default_pool, otherwise False 
- Return type
 
 - static create_or_update_pool(name, slots, description, session=NEW_SESSION)[source]¶
- Create a pool with given parameters or update it if it already exists. 
 - static slots_stats(*, lock_rows=False, session=NEW_SESSION)[source]¶
- Get Pool stats (Number of Running, Queued, Open & Total tasks) - If - lock_rowsis True, and the database engine in use supports the- NOWAITsyntax, then a non-blocking lock will be attempted – if the lock is not available then SQLAlchemy will throw an OperationalError.- Parameters
- lock_rows (bool) – Should we attempt to obtain a row-level lock on all the Pool rows returns 
- session (sqlalchemy.orm.session.Session) – SQLAlchemy ORM Session 
 
 
 - occupied_slots(session=NEW_SESSION)[source]¶
- Get the number of slots used by running/queued tasks at the moment. - Parameters
- session (sqlalchemy.orm.session.Session) – SQLAlchemy ORM Session 
- Returns
- the used number of slots 
 
 - running_slots(session=NEW_SESSION)[source]¶
- Get the number of slots used by running tasks at the moment. - Parameters
- session (sqlalchemy.orm.session.Session) – SQLAlchemy ORM Session 
- Returns
- the used number of slots 
 
 - queued_slots(session=NEW_SESSION)[source]¶
- Get the number of slots used by queued tasks at the moment. - Parameters
- session (sqlalchemy.orm.session.Session) – SQLAlchemy ORM Session 
- Returns
- the used number of slots 
 
 - scheduled_slots(session=NEW_SESSION)[source]¶
- Get the number of slots scheduled at the moment. - Parameters
- session (sqlalchemy.orm.session.Session) – SQLAlchemy ORM Session 
- Returns
- the number of scheduled slots 
 
 - open_slots(session=NEW_SESSION)[source]¶
- Get the number of slots open at the moment. - Parameters
- session (sqlalchemy.orm.session.Session) – SQLAlchemy ORM Session 
- Returns
- the number of slots 
- Return type
 
 
