Package hudson.model.queue
Interface SubTask
-
- All Superinterfaces:
ResourceActivity
- 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 ofQueue.Task
that represents a computation carried out by a singleExecutor
. AQueue.Task
consists of a number ofSubTask
.Plugins are encouraged to extend from
AbstractSubTask
instead of implementing this interface directly, to maintain compatibility with future changes to this interface.- Since:
- 1.377
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Queue.Executable
createExecutable()
CreatesQueue.Executable
, which performs the actual execution of the task.default Label
getAssignedLabel()
If this task needs to be run on a node with a particular label, return thatLabel
.default long
getEstimatedDuration()
Estimate of how long will it take to execute this task.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.default Queue.Task
getOwnerTask()
Gets theQueue.Task
that this subtask belongs to.default Object
getSameNodeConstraint()
If a subset ofSubTask
s of aQueue.Task
needs to be collocated with otherSubTask
s, thoseSubTask
s should return the equal object here.-
Methods inherited from interface hudson.model.ResourceActivity
getDisplayName, getResourceList
-
-
-
-
Method Detail
-
getAssignedLabel
default Label getAssignedLabel()
If this task needs to be run on a node with a particular label, return thatLabel
. Otherwise null, indicating it can run on anywhere.- Returns:
- 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.- Returns:
- by default, null
-
getEstimatedDuration
default long getEstimatedDuration()
Estimate of how long will it take to execute this task. Measured in milliseconds.- Returns:
- -1 if it's impossible to estimate (the default)
-
createExecutable
@CheckForNull Queue.Executable createExecutable() throws IOException
CreatesQueue.Executable
, which performs the actual execution of the task.- Returns:
Queue.Executable
to be launched or null if the executable cannot be created (e.g.AbstractProject
is disabled)- Throws:
IOException
-Queue.Executable
cannot be created
-
getOwnerTask
@NonNull default Queue.Task getOwnerTask()
Gets theQueue.Task
that this subtask belongs to.- Returns:
- by default,
this
-
getSameNodeConstraint
default Object getSameNodeConstraint()
If a subset ofSubTask
s of aQueue.Task
needs to be collocated with otherSubTask
s, thoseSubTask
s should return the equal object here. If null, the execution unit isn't under a colocation constraint.- Returns:
- by default, null
-
-