Class RunningJobsInfoDAO

    • Constructor Detail

      • RunningJobsInfoDAO

        protected RunningJobsInfoDAO()
        Constructor used when creating singleton. Do not call directly.
    • Method Detail

      • store

        public abstract void store​(StartedJobInfo startedJobInfo)
        Stores a StartedJobInfo record to the persistent storage. The record is stored in the monitor table, and if the elapsed time since the last history sample is equal or superior to the history sample rate, also to the history table.
        Parameters:
        startedJobInfo - the record to store.
      • getMostRecentByHarvestName

        public abstract java.util.Map<java.lang.String,​java.util.List<StartedJobInfo>> getMostRecentByHarvestName()
        Returns the most recent record for every job, partitioned by harvest definition name.
        Returns:
        the full listing of started job information, partitioned by harvest definition name.
      • getFullJobHistory

        public abstract StartedJobInfo[] getFullJobHistory​(long jobId)
        Returns an array of all progress records chronologically sorted for the given job ID.
        Parameters:
        jobId - the job id.
        Returns:
        an array of all progress records chronologically sorted for the given job ID.
      • getMostRecentByJobId

        public abstract StartedJobInfo[] getMostRecentByJobId​(long jobId,
                                                              long startTime,
                                                              int limit)
        Returns an array of progress records chronologically sorted for the given job ID, starting at a given crawl time, and limited to a given number of records.
        Parameters:
        jobId - the job id.
        startTime - the crawl time (in seconds) to begin.
        limit - the maximum number of records to fetch.
        Returns:
        an array of progress records chronologically sorted for the given job ID, starting at a given crawl time, and limited to a given number of record.
      • getMostRecentByJobId

        public abstract StartedJobInfo getMostRecentByJobId​(long jobId)
        Returns the most recent progress record for the given job ID.
        Parameters:
        jobId - the job id.
        Returns:
        the most recent progress record for the given job ID.
      • removeInfoForJob

        public abstract int removeInfoForJob​(long jobId)
        Removes all monitor and history records pertaining to the given job ID from the persistent storage.
        Parameters:
        jobId - the job id.
        Returns:
        the number of deleted records.
      • storeFrontierReport

        public abstract int storeFrontierReport​(java.lang.String filterId,
                                                InMemoryFrontierReport report,
                                                java.lang.Long jobId)
        Store frontier report data to the persistent storage.
        Parameters:
        report - the report to store
        filterId - the id of the filter that produced the report
        jobId - The ID of the harvestjob responsible for this report
        Returns:
        the update count
      • getFrontierReport

        public abstract InMemoryFrontierReport getFrontierReport​(long jobId,
                                                                 java.lang.String filterId)
        Retrieve a frontier report from a job id and a given filter class.
        Parameters:
        jobId - the job id
        filterId - the id of the filter that produced the report
        Returns:
        a frontier report
      • getFrontierReport

        public abstract InMemoryFrontierReport getFrontierReport​(long jobId,
                                                                 int limit,
                                                                 boolean sort)
        Retrieve a frontier report from a job id, with limited results and possibility to sort by totalenqueues DESC
        Parameters:
        jobId - the job id
        limit - the limit of result to query
        sort - if true, sort the results by totalenqueues DESC
        Returns:
        a frontier report
      • getFrontierReport

        public abstract InMemoryFrontierReport getFrontierReport​(long jobId,
                                                                 java.lang.String filterId,
                                                                 int limit,
                                                                 boolean sort)
        Retrieve a frontier report from a job id, with limited results and possibility to sort by totalenqueues DESC
        Parameters:
        jobId - the job id
        limit - the limit of result to query
        filterId - the id of the filter that produced the report
        sort - if true, sort the results by totalenqueues DESC
        Returns:
        a frontier report
      • deleteFrontierReports

        public abstract int deleteFrontierReports​(long jobId)
        Deletes all frontier report data pertaining to the given job id from the persistent storage.
        Parameters:
        jobId - the job id
        Returns:
        the update count
      • getHistoryRecordIds

        public abstract java.util.Set<java.lang.Long> getHistoryRecordIds()
        Returns the ids of jobs for which history records exist, as an immutable set.
        Returns:
        the ids of jobs for which history records exist.