Interface SubTask

All Superinterfaces:
All Known Subinterfaces:
BuildableItem, BuildableItemWithBuildWrappers, ParameterizedJobMixIn.ParameterizedJob<JobT,RunT>, Queue.FlyweightTask, Queue.NonBlockingTask, Queue.Task, Queue.TransientTask, SCMedItem
All Known Implementing Classes:
AbstractProject, AbstractQueueTask, AbstractSubTask, FreeStyleProject, Project, QueueTaskFilter

public interface SubTask extends ResourceActivity
A component of Queue.Task that represents a computation carried out by a single Executor. A Queue.Task consists of a number of SubTask.

Plugins are encouraged to extend from AbstractSubTask instead of implementing this interface directly, to maintain compatibility with future changes to this interface.

  • Method Details

    • getAssignedLabel

      default Label getAssignedLabel()
      If this task needs to be run on a node with a particular label, return that Label. Otherwise null, indicating it can run on anywhere.
      by default, null
    • getLastBuiltOn

      default Node getLastBuiltOn()
      If the previous execution of this task run on a certain node and this task prefers to run on the same node, return that. Otherwise null.
      by default, null
    • getEstimatedDuration

      default long getEstimatedDuration()
      Estimate of how long will it take to execute this task. Measured in milliseconds.
      -1 if it's impossible to estimate (the default)
    • createExecutable

      @CheckForNull Queue.Executable createExecutable() throws IOException
      Creates an object which performs the actual execution of the task.
      executable to be launched or null if the executable cannot be created (e.g. AbstractProject is disabled)
      IOException - executable cannot be created
    • getOwnerTask

      @NonNull default Queue.Task getOwnerTask()
      Gets the task that this subtask belongs to.
      by default, this
      See Also:
    • getOwnerExecutable

      @CheckForNull default Queue.Executable getOwnerExecutable()
      If this task is associated with an executable of getOwnerTask(), finds that.
      by default, null
      See Also:
    • getSameNodeConstraint

      default Object getSameNodeConstraint()
      If a subset of SubTasks of a Queue.Task needs to be collocated with other SubTasks, those SubTasks should return the equal object here. If null, the execution unit isn't under a colocation constraint.
      by default, null