Skip to main content

Checking a job status

With the API

You can see the current job states of all datasources for the app APP_NAME by calling the Jobs API:
If a job has never run, a Jobs API call returns the following:
The value datasource:myDatasource indicates a datasource, myDatasource, is present. The line "status": "ready" indicates the current state of the job, which has never run.
After a job successfully completes, the following is returned:
To see the complete job history, use the following Jobs API call:
The following is returned:
The section How does the Jobs API work? below gives additional details on how the Jobs API retrieves information from Fusion. See the Jobs API reference for more information.

Job history results field definitions

V1 Connector Counters

With the UI

In the Fusion UI, navigate to Indexing > Datasources. Click a datasource to open the datasource panel. Datasource panel Note that the Last run start and Last run stop values are equivalent to the lastStartTime and lastEndTime values from the Jobs API call. (These values are only present if a job has been run at least once.) In the job history panel, there is an icon on each datasource indicating its latest run history. The possible statuses are: Job history panel
The image above shows all possible job statuses.

How does the Jobs API work?

In Checking a job status with the API above, two Jobs API endpoints were used to call the datasource myDatasource:
  • APP_NAME/jobs?type=datasource - Retrieves the current datasource job states for all datasources of a specified app. In this case, the app is specified as APP_NAME.
    You can also use type=spark to retrieve all Spark jobs and type=task for task jobs.
  • /jobs/datasource:myDatasource/history - Retrieves a specific object’s job history. In this case, the object type is a datasource, as selected with datasource:.
    Datasources are not the only object type for jobs. There are also Spark jobs (spark:) and task jobs (task:).
Both of the API calls above send a request to Fusion’s API application, which serves the Jobs API. The API application contains two main components related to job history data, JobController and SolrJobHistoryStore.

The Job Controller

The Job Controller is responsible for getting any active job’s run status, if an active job is running. In the case of V1 connectors classic datasource jobs, it will reach out to Fusion’s connectors-classic application’s connectors API. When the API application calls the connectors-classic Jobs API, it will first use Zookeeper to identify the IP address of the connector-classic node that is assigned to this datasource, if one exists. When the connectors-classic node IP assigned to the job is identified, the API application will call out to the connectors-classic node via http://<connectors-node-ip>:8984/connectors/v1/connectors/jobs/myDatasource. The call reaches the component ConnectorsManagerController to query the job status of currently running jobs with the ID myDatasource.

The Solr Job History Store

SolrJobHistoryStore reads and writes a job’s history data to and from Solr. Fusion’s API application creates a special system Solr collection, system_jobs_history, to store the history. You can also query the job history from Solr directly, if you want: Job history query in Solr