3737 _JobManagerWorkerThreadPool ,
3838 _JobStartTask ,
3939)
40+ from openeo .extra .job_management .job_db import JobDatabaseInterface
4041from openeo .internal .processes .parse import (
4142 Parameter ,
4243 Process ,
@@ -64,67 +65,6 @@ class _Backend(NamedTuple):
6465_UNSET = object ()
6566
6667
67- class JobDatabaseInterface (metaclass = abc .ABCMeta ):
68- """
69- Interface for a database of job metadata to use with the :py:class:`MultiBackendJobManager`,
70- allowing to regularly persist the job metadata while polling the job statuses
71- and resume/restart the job tracking after it was interrupted.
72-
73- .. versionadded:: 0.31.0
74- """
75-
76- @abc .abstractmethod
77- def exists (self ) -> bool :
78- """Does the job database already exist, to read job data from?"""
79- ...
80-
81- @abc .abstractmethod
82- def persist (self , df : pd .DataFrame ):
83- """
84- Store (now or updated) job data to the database.
85-
86- The provided dataframe may only cover a subset of all the jobs ("rows") of the whole database,
87- so it should be merged with the existing data (if any) instead of overwriting it completely.
88-
89- :param df: job data to store.
90- """
91- ...
92-
93- @abc .abstractmethod
94- def count_by_status (self , statuses : Iterable [str ] = ()) -> dict :
95- """
96- Retrieve the number of jobs per status.
97-
98- :param statuses: List/set of statuses to include. If empty, all statuses are included.
99-
100- :return: dictionary with status as key and the count as value.
101- """
102- ...
103-
104- @abc .abstractmethod
105- def get_by_status (self , statuses : List [str ], max = None ) -> pd .DataFrame :
106- """
107- Returns a dataframe with jobs, filtered by status.
108-
109- :param statuses: List of statuses to include.
110- :param max: Maximum number of jobs to return.
111-
112- :return: DataFrame with jobs filtered by status.
113- """
114- ...
115-
116- @abc .abstractmethod
117- def get_by_indices (self , indices : Iterable [Union [int , str ]]) -> pd .DataFrame :
118- """
119- Returns a dataframe with jobs based on their (dataframe) index
120-
121- :param indices: List of indices to include.
122-
123- :return: DataFrame with jobs filtered by indices.
124- """
125- ...
126-
127-
12868def _start_job_default (row : pd .Series , connection : Connection , * args , ** kwargs ):
12969 raise NotImplementedError ("No 'start_job' callable provided" )
13070
@@ -367,7 +307,7 @@ def start_job_thread(self, start_job: Callable[[], BatchJob], job_db: JobDatabas
367307 :param job_db:
368308 Job database to load/store existing job status data and other metadata from/to.
369309 Can be specified as a path to CSV or Parquet file,
370- or as a custom database object following the :py:class:`JobDatabaseInterface` interface.
310+ or as a custom database object following the :py:class:`job_db. JobDatabaseInterface` interface.
371311
372312 .. note::
373313 Support for Parquet files depends on the ``pyarrow`` package
@@ -472,7 +412,7 @@ def run_jobs(
472412 :param job_db:
473413 Job database to load/store existing job status data and other metadata from/to.
474414 Can be specified as a path to CSV or Parquet file,
475- or as a custom database object following the :py:class:`JobDatabaseInterface` interface.
415+ or as a custom database object following the :py:class:`job_db. JobDatabaseInterface` interface.
476416
477417 .. note::
478418 Support for Parquet files depends on the ``pyarrow`` package
@@ -488,7 +428,7 @@ def run_jobs(
488428 .. versionchanged:: 0.31.0
489429 Replace ``output_file`` argument with ``job_db`` argument,
490430 which can be a path to a CSV or Parquet file,
491- or a user-defined :py:class:`JobDatabaseInterface` object.
431+ or a user-defined :py:class:`job_db. JobDatabaseInterface` object.
492432 The deprecated ``output_file`` argument is still supported for now.
493433
494434 .. versionchanged:: 0.33.0
@@ -998,7 +938,7 @@ class CsvJobDatabase(FullDataFrameJobDatabase):
998938 """
999939 Persist/load job metadata with a CSV file.
1000940
1001- :implements: :py:class:`JobDatabaseInterface`
941+ :implements: :py:class:`job_db. JobDatabaseInterface`
1002942 :param path: Path to local CSV file.
1003943
1004944 .. note::
@@ -1053,7 +993,7 @@ class ParquetJobDatabase(FullDataFrameJobDatabase):
1053993 """
1054994 Persist/load job metadata with a Parquet file.
1055995
1056- :implements: :py:class:`JobDatabaseInterface`
996+ :implements: :py:class:`job_db. JobDatabaseInterface`
1057997 :param path: Path to the Parquet file.
1058998
1059999 .. note::
0 commit comments