Class JobHistoryService

java.lang.Object
org.opensearch.jobscheduler.utils.JobHistoryService

public class JobHistoryService extends Object
  • Field Details

  • 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 started
      endTime - 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

      public void findHistoryRecord(String jobIndexName, String jobId, Instant startTime, org.opensearch.core.action.ActionListener<org.opensearch.jobscheduler.spi.StatusHistoryModel> listener)