Class TaskGroup
java.lang.Object
co.yellowdog.platform.model.TaskGroup
- All Implemented Interfaces:
Identified
,Named
,Tagged
,Serializable
Defines a group of tasks to be executed as part of a WorkRequirement.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder that can be used to build a new TaskGroup that is automatically validated on build. -
Field Summary
Fields inherited from interface co.yellowdog.platform.model.Tagged
MAX_TAG_LENGTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TaskGroup.Builder
builder()
protected boolean
boolean
The time to live for completed tasks.The name of another task group within the same WorkRequirement that must be successfully completed before the task group is started.getId()
Returns the IDgetName()
The user allocated name used to uniquely identify the task group within its work requirement.double
The task group priority.The run specification which determines the YellowDog Scheduler behaviours when it is executing the tasks within the task group.The task group status.The date and time when the status last changedgetTag()
Gets the user defined tagint
hashCode()
boolean
If true, the task group will finish automatically once all contained tasks are finished.boolean
If true, the task group will finish automatically if any contained tasks fail.boolean
Indicates if the task group is unable to claim any workers.boolean
Indicates if the task group is waiting for a dependency task group to finish.void
setCompletedTaskTtl
(Duration completedTaskTtl) The time to live for completed tasks.void
setDependentOn
(String dependentOn) The name of another task group within the same WorkRequirement that must be successfully completed before the task group is started.void
setFinishIfAllTasksFinished
(boolean finishIfAllTasksFinished) If true, the task group will finish automatically once all contained tasks are finished.void
setFinishIfAnyTaskFailed
(boolean finishIfAnyTaskFailed) If true, the task group will finish automatically if any contained tasks fail.void
void
The user allocated name used to uniquely identify the task group within its work requirement.void
setPriority
(double priority) The task group priority.void
setRunSpecification
(RunSpecification runSpecification) The run specification which determines the YellowDog Scheduler behaviours when it is executing the tasks within the task group.void
setStarved
(boolean starved) Indicates if the task group is unable to claim any workers.void
setStatus
(TaskGroupStatus status) The task group status.void
setStatusChangedTime
(Instant statusChangedTime) The date and time when the status last changedvoid
Sets the user defined tagvoid
setTaskSummary
(TaskSummary taskSummary) void
setWaitingOnDependency
(boolean waitingOnDependency) Indicates if the task group is waiting for a dependency task group to finish.toString()
-
Constructor Details
-
TaskGroup
public TaskGroup(String name, String tag, RunSpecification runSpecification, Double priority, String dependentOn, Boolean finishIfAllTasksFinished, Boolean finishIfAnyTaskFailed, Duration completedTaskTtl) Constructs a new task group with the specified values.- Parameters:
name
- the task group nametag
- the task group tagrunSpecification
- the task group run specificationpriority
- the task group prioritydependentOn
- the name of the task group that this task group is dependent onfinishIfAllTasksFinished
- if the task group should finish if all contained tasks are finishedfinishIfAnyTaskFailed
- if the task group should finish if any contained task failscompletedTaskTtl
- the completed task TTL
-
-
Method Details
-
builder
-
toBuilder
-
getId
Description copied from interface:Identified
Returns the ID- Specified by:
getId
in interfaceIdentified
- Returns:
- the ID
-
getTag
-
getName
-
getStatus
-
getStatusChangedTime
The date and time when the status last changed- Returns:
- the date and time when the status last changed
-
getPriority
public double getPriority()The task group priority.- Returns:
- the task group priority
-
getDependentOn
The name of another task group within the same WorkRequirement that must be successfully completed before the task group is started.- Returns:
- the name of another task group that the task group is dependent on
-
isStarved
public boolean isStarved()Indicates if the task group is unable to claim any workers.- Returns:
- if the task group is unable to claim any workers
-
isWaitingOnDependency
public boolean isWaitingOnDependency()Indicates if the task group is waiting for a dependency task group to finish.- Returns:
- if the task group is waiting for a dependency task group to finish
-
isFinishIfAllTasksFinished
public boolean isFinishIfAllTasksFinished()If true, the task group will finish automatically once all contained tasks are finished.- Returns:
- true, if the task group should finish once all contained tasks are finished; otherwise, false
-
isFinishIfAnyTaskFailed
public boolean isFinishIfAnyTaskFailed()If true, the task group will finish automatically if any contained tasks fail.- Returns:
- true, if the task group should finish if any contained tasks fail; otherwise, false
-
getCompletedTaskTtl
The time to live for completed tasks. If set, tasks that have been completed for longer than this period will be deleted.- Returns:
- the completed task TTL
-
getRunSpecification
The run specification which determines the YellowDog Scheduler behaviours when it is executing the tasks within the task group.- Returns:
- the run specification
-
getTaskSummary
-
setId
-
setTag
-
setName
The user allocated name used to uniquely identify the task group within its work requirement.- Parameters:
name
- the task group name
This should not be changed once the requirement has been submitted to YellowDog Scheduler.
-
setStatus
The task group status.- Parameters:
status
- This should not be set outside of the YellowDog Scheduler service.
-
setStatusChangedTime
The date and time when the status last changed- Parameters:
statusChangedTime
- This should not be set outside of the YellowDog Scheduler service.
-
setPriority
public void setPriority(double priority) The task group priority.- Parameters:
priority
- the task group priority
-
setDependentOn
The name of another task group within the same WorkRequirement that must be successfully completed before the task group is started.- Parameters:
dependentOn
- the name of another task group that the task group is dependent on
This should not be changed once the requirement has been submitted to YellowDog Scheduler.
-
setStarved
public void setStarved(boolean starved) Indicates if the task group is unable to claim any workers.- Parameters:
starved
- This should not be set outside of the YellowDog Scheduler service.
-
setWaitingOnDependency
public void setWaitingOnDependency(boolean waitingOnDependency) Indicates if the task group is waiting for a dependency task group to finish.- Parameters:
waitingOnDependency
- This should not be set outside of the YellowDog Scheduler service.
-
setFinishIfAllTasksFinished
public void setFinishIfAllTasksFinished(boolean finishIfAllTasksFinished) If true, the task group will finish automatically once all contained tasks are finished.- Parameters:
finishIfAllTasksFinished
- true, if the task group should finish once all contained tasks are finished; otherwise, false
-
setFinishIfAnyTaskFailed
public void setFinishIfAnyTaskFailed(boolean finishIfAnyTaskFailed) If true, the task group will finish automatically if any contained tasks fail.- Parameters:
finishIfAnyTaskFailed
- true, if the task group should finish if any contained tasks fail; otherwise, false
-
setCompletedTaskTtl
The time to live for completed tasks. If set, tasks that have been completed for longer than this period will be deleted.- Parameters:
completedTaskTtl
- the completed task TTL
-
setRunSpecification
The run specification which determines the YellowDog Scheduler behaviours when it is executing the tasks within the task group.- Parameters:
runSpecification
- the run specification
This should not be changed once the requirement has been submitted to YellowDog Scheduler.
-
setTaskSummary
-
equals
-
canEqual
-
hashCode
-
toString
-