Class Task
java.lang.Object
co.yellowdog.platform.model.Task
- All Implemented Interfaces:
Identified
,Named
,Tagged
,Serializable
@ValidatedBy(TaskValidator.class)
public class Task
extends Object
implements Identified, Named, Tagged, Serializable
Defines a task 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 Task that is automatically validated on build. -
Field Summary
Fields inherited from interface co.yellowdog.platform.model.Tagged
MAX_TAG_LENGTH
-
Constructor Summary
ConstructorsConstructorDescriptionTask
(String name, String tag, String taskType, List<String> arguments, String taskData, Map<String, String> environment, List<TaskInput> inputs, FlattenPath flattenInputPaths, List<TaskOutput> outputs, Duration timeout, TaskData data) Constructs a new task with the specified values. -
Method Summary
Modifier and TypeMethodDescriptionstatic Task.Builder
builder()
protected boolean
boolean
The time when task abort was requested.A list of arguments that will be passed to the task type run command when the task is executed.getData()
Task data requirement specifications.A map containing environment variable values that will be added to the process environment when the task is executed.The time the task was finished.Indicates if the input objects' paths should be flattened when they are downloaded.The system generated fully qualified name of the task in the form {namespace}/{workRequirementName}/{taskGroupName}/{taskName}.getId()
Returns the IDInput object specifications that determine objects to be downloaded prior to running the task.getName()
The user allocated name used to uniquely identify the task within its task group.List
<@NotNull @Valid TaskOutput> Output object specifications that determine objects to be uploaded after running the task.How many times the task has failed and then been set back to WAITING to be retried.The time the task was last started by a Worker.The task status.getTag()
Gets the user defined tagThe data to be passed to the Worker when the task is started.The type of the task, used to identify the program to use to execute the task.The maximum time that a worker should attempt to execute the task for before failing it.int
hashCode()
void
setAbortRequestedTime
(Instant abortRequestedTime) The time when task abort was requested.void
setArguments
(List<@NotNull String> arguments) A list of arguments that will be passed to the task type run command when the task is executed.void
Task data requirement specifications.void
setEnvironment
(Map<@NotBlank String, String> environment) A map containing environment variable values that will be added to the process environment when the task is executed.void
void
setFinishedTime
(Instant finishedTime) The time the task was finished.void
setFlattenInputPaths
(FlattenPath flattenInputPaths) Indicates if the input objects' paths should be flattened when they are downloaded.void
setFullyQualifiedName
(String fullyQualifiedName) The system generated fully qualified name of the task in the form {namespace}/{workRequirementName}/{taskGroupName}/{taskName}.void
void
Input object specifications that determine objects to be downloaded prior to running the task.void
The user allocated name used to uniquely identify the task within its task group.void
setOutputs
(List<@NotNull @Valid TaskOutput> outputs) Output object specifications that determine objects to be uploaded after running the task.void
setRetryCount
(Integer retryCount) How many times the task has failed and then been set back to WAITING to be retried.void
setStartedTime
(Instant startedTime) The time the task was last started by a Worker.void
setStatus
(TaskStatus status) The task status.void
Sets the user defined tagvoid
setTaskData
(String taskData) The data to be passed to the Worker when the task is started.void
setTaskGroupId
(String taskGroupId) void
setTaskType
(String taskType) The type of the task, used to identify the program to use to execute the task.void
setTimeout
(Duration timeout) The maximum time that a worker should attempt to execute the task for before failing it.void
setWorkerId
(String workerId) toString()
-
Constructor Details
-
Task
public Task(String name, String tag, String taskType, List<String> arguments, String taskData, Map<String, String> environment, List<TaskInput> inputs, FlattenPath flattenInputPaths, List<TaskOutput> outputs, Duration timeout, TaskData data) Constructs a new task with the specified values.- Parameters:
name
- the task nametag
- the task tagtaskType
- the task typetaskData
- the task initialisation dataenvironment
- the task environmentinputs
- the task inputsflattenInputPaths
- how input paths should be flattenedoutputs
- the task outputstimeout
- the task timeout
-
-
Method Details
-
builder
-
toBuilder
-
getId
Description copied from interface:Identified
Returns the ID- Specified by:
getId
in interfaceIdentified
- Returns:
- the ID
-
getName
-
getFullyQualifiedName
The system generated fully qualified name of the task in the form {namespace}/{workRequirementName}/{taskGroupName}/{taskName}. This is only generated if all ancestor entities are named.- Returns:
- the fully qualified task name
-
getTag
-
getTaskType
The type of the task, used to identify the program to use to execute the task.- Returns:
- the task type
-
getStatus
-
getRetryCount
How many times the task has failed and then been set back to WAITING to be retried.- Returns:
- the current task retry count
-
getArguments
-
getTaskData
The data to be passed to the Worker when the task is started.- Returns:
- the task input data
-
getEnvironment
-
getStartedTime
The time the task was last started by a Worker.- Returns:
- the time the task was last started
-
getFinishedTime
The time the task was finished.- Returns:
- the time the task was finished
-
getAbortRequestedTime
The time when task abort was requested.- Returns:
- the time when task abort was requested
-
getInputs
-
getFlattenInputPaths
Indicates if the input objects' paths should be flattened when they are downloaded.- Returns:
- if the input objects' paths should be flattened
-
getOutputs
Output object specifications that determine objects to be uploaded after running the task.- Returns:
- output object specifications for the task
-
getData
Task data requirement specifications. -
getTimeout
The maximum time that a worker should attempt to execute the task for before failing it.- Returns:
- the maximum time that a worker should attempt to execute the task for before failing it
-
getTaskGroupId
-
getWorkerId
-
getErrors
-
setId
-
setName
The user allocated name used to uniquely identify the task within its task group.- Parameters:
name
- the task name
This should not be changed once the requirement has been submitted to YellowDog Scheduler.
-
setFullyQualifiedName
The system generated fully qualified name of the task in the form {namespace}/{workRequirementName}/{taskGroupName}/{taskName}. This is only generated if all ancestor entities are named.- Parameters:
fullyQualifiedName
- This should not be set outside of the YellowDog Scheduler service.
-
setTag
-
setTaskType
The type of the task, used to identify the program to use to execute the task.- Parameters:
taskType
- the task type
This should not be changed once the requirement has been submitted to YellowDog Scheduler.
-
setStatus
The task status.- Parameters:
status
- This should not be set outside of the YellowDog Scheduler service.
-
setRetryCount
How many times the task has failed and then been set back to WAITING to be retried.- Parameters:
retryCount
- This should not be set outside of the YellowDog Scheduler service.
-
setArguments
-
setTaskData
The data to be passed to the Worker when the task is started.- Parameters:
taskData
- the task input data
-
setEnvironment
-
setStartedTime
The time the task was last started by a Worker.- Parameters:
startedTime
- This should not be set outside of the YellowDog Scheduler service.
-
setFinishedTime
The time the task was finished.- Parameters:
finishedTime
- This should not be set outside of the YellowDog Scheduler service.
-
setAbortRequestedTime
The time when task abort was requested.- Parameters:
abortRequestedTime
- This should not be set outside of the YellowDog Scheduler service.
-
setInputs
-
setFlattenInputPaths
Indicates if the input objects' paths should be flattened when they are downloaded.- Parameters:
flattenInputPaths
- if the input objects' paths should be flattened
-
setOutputs
Output object specifications that determine objects to be uploaded after running the task.- Parameters:
outputs
- output object specifications for the task
-
setData
Task data requirement specifications. -
setTimeout
The maximum time that a worker should attempt to execute the task for before failing it.- Parameters:
timeout
- the maximum time that a worker should attempt to execute the task for before failing it
-
setTaskGroupId
-
setWorkerId
-
setErrors
-
equals
-
canEqual
-
hashCode
-
toString
-