Class JobHistoryService
java.lang.Object
org.opensearch.jobscheduler.utils.JobHistoryService
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJobHistoryService(org.opensearch.transport.client.Client client, org.opensearch.cluster.service.ClusterService clusterService) -
Method Summary
Modifier and TypeMethodDescriptionvoidfindHistoryRecord(String jobIndexName, String jobId, Instant startTime, org.opensearch.core.action.ActionListener<org.opensearch.jobscheduler.spi.StatusHistoryModel> listener) booleanvoidrecordJobHistory(String jobIndexName, String jobId, Instant startTime, Instant endTime, Integer status, org.opensearch.core.action.ActionListener<Boolean> listener) Records job execution history to the history index.voidupdateHistoryRecord(org.opensearch.jobscheduler.spi.StatusHistoryModel historyModelupdate, org.opensearch.core.action.ActionListener<org.opensearch.jobscheduler.spi.StatusHistoryModel> listener)
-
Field Details
-
JOB_HISTORY_INDEX_NAME
- See Also:
-
-
Constructor Details
-
JobHistoryService
public JobHistoryService(org.opensearch.transport.client.Client client, org.opensearch.cluster.service.ClusterService clusterService)
-
-
Method Details
-
historyIndexExist
public boolean historyIndexExist() -
recordJobHistory
public void recordJobHistory(String jobIndexName, String jobId, Instant startTime, Instant endTime, Integer status, org.opensearch.core.action.ActionListener<Boolean> listener) Records job execution history to the history index.- Parameters:
startTime- the time when job execution startedendTime- the time when job execution ended (can be null for ongoing jobs)status- the execution status (e.g., "RUNNING", "SUCCESS", "FAILED")listener- callback for handling the response
-
updateHistoryRecord
public void updateHistoryRecord(org.opensearch.jobscheduler.spi.StatusHistoryModel historyModelupdate, org.opensearch.core.action.ActionListener<org.opensearch.jobscheduler.spi.StatusHistoryModel> listener) -
findHistoryRecord
-