Interface Job<T extends Task<?>>

  • Type Parameters:
    T - the type of the task of the job

    public interface Job<T extends Task<?>>
    interface for job that can be scheduled by Alluxio scheduler.
    • Method Detail

      • getDescription

        alluxio.job.JobDescription getDescription()
        Returns:
        the job description, which is used to identify the intention of the job. We don't allow multiple jobs with the same description to be run on the scheduler at the same time. When submitting a job when there is already a job with the same description, scheduler will update the job instead of submitting a new job.
      • getEndTime

        java.util.OptionalLong getEndTime()
        Returns:
        job end time if finished, otherwise empty
      • needVerification

        boolean needVerification()
        Returns:
        whether the job need verification
      • getJobState

        JobState getJobState()
        Returns:
        job state
      • setJobState

        void setJobState​(JobState state)
        set job state.
        Parameters:
        state - job state
      • getJobId

        java.lang.String getJobId()
        Returns:
        job id. unique id for the job
      • continueJob

        void continueJob()
        Request the job to continue.
      • failJob

        void failJob​(alluxio.exception.runtime.AlluxioRuntimeException reason)
        set job as failure with exception.
        Parameters:
        reason - exception
      • setJobSuccess

        void setJobSuccess()
        set job as success.
      • getProgress

        java.lang.String getProgress​(alluxio.grpc.JobProgressReportFormat format,
                                     boolean verbose)
        Get job progress.
        Parameters:
        format - progress report format
        verbose - whether to include detailed information
        Returns:
        job progress report
        Throws:
        java.lang.IllegalArgumentException - if the format is not supported
      • isHealthy

        boolean isHealthy()
        Check whether the job is healthy.
        Returns:
        true if the job is healthy, false if not
      • isRunning

        boolean isRunning()
        Check whether the job is still running.
        Returns:
        true if the job is running, false if not
      • isDone

        boolean isDone()
        Check whether the job is finished.
        Returns:
        true if the job is finished, false if not
      • isCurrentPassDone

        boolean isCurrentPassDone()
        Check whether the current pass is finished.
        Returns:
        true if the current pass of job is finished, false if not
      • initiateVerification

        void initiateVerification()
        Initiate a verification pass. This will re-list the directory and find any unfinished files / tasks and try to execute them again.
      • getNextTask

        java.util.Optional<T> getNextTask​(alluxio.wire.WorkerInfo worker)
        Parameters:
        worker - blocker to worker
        Returns:
        the next task to run. If there is no more task to run, return empty
        Throws:
        alluxio.exception.runtime.AlluxioRuntimeException - if any error occurs when getting next task
      • toJournalEntry

        alluxio.proto.journal.Journal.JournalEntry toJournalEntry()
        Returns:
        job journal entry
      • processResponse

        boolean processResponse​(T task)
        process task result.
        Parameters:
        task - task containing result future
        Returns:
        success if successfully process task result, otherwise return failure
      • updateJob

        void updateJob​(Job<?> job)
        update job configs.
        Parameters:
        job - the job to update from. Must be the same job type