Class PlanInfo

  • All Implemented Interfaces:
    java.lang.Comparable<PlanInfo>

    @ThreadSafe
    public final class PlanInfo
    extends java.lang.Object
    implements java.lang.Comparable<PlanInfo>
    The job information used by the job master internally.
    • Constructor Detail

      • PlanInfo

        public PlanInfo​(long id,
                        JobConfig jobConfig,
                        java.util.function.Consumer<PlanInfo> statusChangeCallback)
        Creates a new instance of PlanInfo.
        Parameters:
        id - the job id
        jobConfig - the job configuration
        statusChangeCallback - the callback to invoke upon status change
    • Method Detail

      • compareTo

        public int compareTo​(PlanInfo other)
        This method orders jobs using the time their status was last modified. If the status is equal, they are compared by jobId
        Specified by:
        compareTo in interface java.lang.Comparable<PlanInfo>
      • addTask

        public void addTask​(long taskId,
                            alluxio.wire.WorkerInfo workerInfo,
                            java.lang.Object args)
        Registers a task.
        Parameters:
        taskId - the task id
        workerInfo - the worker info
        args - the arguments
      • getId

        public long getId()
        Returns:
        the job id
      • getJobConfig

        public JobConfig getJobConfig()
        Returns:
        the job configuration
      • getLastStatusChangeMs

        public long getLastStatusChangeMs()
        Returns:
        the time when the job status was last changed (in milliseconds)
      • setErrorType

        public void setErrorType​(java.lang.String errorType)
        Parameters:
        errorType - the error type
      • getErrorType

        public java.lang.String getErrorType()
        Returns:
        the error type
      • setErrorMessage

        public void setErrorMessage​(java.lang.String errorMessage)
        Parameters:
        errorMessage - the error message
      • getErrorMessage

        public java.lang.String getErrorMessage()
        Returns:
        the error message
      • getTaskInfo

        public TaskInfo getTaskInfo​(long taskId)
        Parameters:
        taskId - the task ID to get the task info for
        Returns:
        the task info, or null if the task ID doesn't exist
      • setTaskInfo

        public void setTaskInfo​(long taskId,
                                TaskInfo taskInfo)
        Sets the information of a task.
        Parameters:
        taskId - the task id
        taskInfo - the task information
      • getTaskIdList

        public java.util.List<java.lang.Long> getTaskIdList()
        Returns:
        the list of task ids
      • setStatus

        public void setStatus​(Status status)
        Sets the status of a job. A job can only move from one status to another if the job hasn't already finished. If a job is finished and the caller tries to change the status, this method is a no-op.
        Parameters:
        status - the job status
      • getStatus

        public Status getStatus()
        Returns:
        the status of the job
      • setResult

        public void setResult​(java.lang.String result)
        Parameters:
        result - the joined job result
      • getResult

        public java.lang.String getResult()
        Returns:
        the result of the job
      • getTaskInfoList

        public java.util.List<TaskInfo> getTaskInfoList()
        Returns:
        the list of task information
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object