Jobs API
Listing jobs
The List Jobs
API returns your currently initiated jobs. By default, only active jobs, which means the jobs that are currently executing, are returned.
- Python
- Scala
You can provide an additional argument active=False
to return all
jobs. You can also retrieve a specific type of job by specifying the
job_type
parameter.
from featurestore.core.job_types import INGEST, RETRIEVE, EXTRACT_SCHEMA, REVERT_INGEST, MATERIALIZATION_ONLINE
client.jobs.list()
client.jobs.list(active=False, job_type=INGEST)
The active
parameter indicates that the job is currently executing.
You can provide an additional argument active=false
to return all
jobs. You can also retrieve a specific type of job by specifying
jobType
parameter.
import ai.h2o.featurestore.core.JobTypes.{INGEST, RETRIEVE, EXTRACT_SCHEMA, REVERT_INGEST, MATERIALIZATION_ONLINE}
client.jobs.list()
client.jobs.list(active=false, jobType=INGEST)
The active
parameter indicates that the job is currently executing.
Getting a job
- Python
- Scala
job = client.jobs.get("job_id")
val job = client.jobs.get("job_id")
Cancelling a job
To request cancel without waiting for cancellation to complete you need to call
- Python
- Scala
job.cancel()
job.cancel()
- Python
- Scala
job.cancel(wait_for_completion=True)
job.cancel(waitForCompletion=true)
Checking job status
- Python
- Scala
job.is_done()
job.isDone()
Checking if job is cancelled
- Python
- Scala
job.is_cancelled()
job.isCancelled()
Getting job results
- Python
- Scala
job.get_result()
You need to specifically cast the job to the corresponding job type before obtaining the result from it. For this, there are special methods namely:
asIngestJob
- to get a result from Ingest JobasExtractSchemaJob
- to get a result from Extract Schema JobasRetrieveJob
- to get a result from Retrieve JobasMaterializationOnlineJob
- to get a result from Materialization Online JobasComputeStatisticsJob
- to get a result from Compute Statistics JobasComputeRecommendationClassifiersJob
- to get a result from Compute Recommendation Classifiers Job
val ingestJob = job.asIngestJob()
ingestJob.getResult()
Checking job metrics
- Python
- Scala
job.get_metrics()
job.getMetrics()
How to download using RetrieveJob
- Python
- Scala
Unlike other job types, RetrieveJob
also has a download
method which
gives you the option to download retrieved data created by the backend
job.
You can also make use of the download_async
method that downloads the
files asynchronously. More information about asynchronous methods is at
Asynchronous methods.
retrieve_job = client.jobs.get("job_id")
data_path = retrieve_job.download()
Unlike other job types, RetrieveJob
has a download
method which
gives you the option to download retrieved data created by the backend
job.
You can also make use of the downloadAsync
method that downloads the
files asynchronously. More information about asynchronous methods is at
Asynchronous methods.
val retrieveJob = client.jobs.get("job_id")
val dataPath = retrieveJob.download()
Job metadata
Field Name | User Modifiable | Values |
---|---|---|
id | No | - |
jobType | No | Ingest, Retrieve, ExtractSchema, Revert, MaterializationOnline, ComputeStatistics, ComputeRecommendationClassifiers, CreateMLDataset, Backfill |
done | No | true, false |
cancelled | No | true, false |
childJobIds | No | Child job ids |
The done
parameter indicates that the job has completed its execution and the results are available.
- Submit and view feedback for this page
- Send feedback about H2O Feature Store to cloud-feedback@h2o.ai