Class TaskGroup

java.lang.Object
co.yellowdog.platform.model.TaskGroup
All Implemented Interfaces:
Identified, Named, Tagged, Serializable

public class TaskGroup extends Object implements Identified, Named, Tagged, Serializable
Defines a group of tasks to be executed as part of a WorkRequirement.
See Also:
  • 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 name
      tag - the task group tag
      runSpecification - the task group run specification
      priority - the task group priority
      dependentOn - the name of the task group that this task group is dependent on
      finishIfAllTasksFinished - if the task group should finish if all contained tasks are finished
      finishIfAnyTaskFailed - if the task group should finish if any contained task fails
      completedTaskTtl - the completed task TTL
  • Method Details

    • builder

      public static TaskGroup.Builder builder()
    • toBuilder

      public TaskGroup.Builder toBuilder()
    • getId

      public String getId()
      Description copied from interface: Identified
      Returns the ID
      Specified by:
      getId in interface Identified
      Returns:
      the ID
    • getTag

      public String getTag()
      Description copied from interface: Tagged
      Gets the user defined tag
      Specified by:
      getTag in interface Tagged
      Returns:
      the user defined tag
    • getName

      public String getName()
      The user allocated name used to uniquely identify the task group within its work requirement.
      Specified by:
      getName in interface Named
      Returns:
      the task group name
    • getStatus

      public TaskGroupStatus getStatus()
      The task group status.
      Returns:
      the task group status
    • getStatusChangedTime

      public Instant 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

      public String 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

      public Duration 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

      public RunSpecification 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

      public TaskSummary getTaskSummary()
    • setId

      public void setId(String id)
    • setTag

      public void setTag(String tag)
      Description copied from interface: Tagged
      Sets the user defined tag
      Specified by:
      setTag in interface Tagged
      Parameters:
      tag - the user defined tag
    • setName

      public void setName(String name)
      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

      public void setStatus(TaskGroupStatus status)
      The task group status.
      Parameters:
      status - This should not be set outside of the YellowDog Scheduler service.
    • setStatusChangedTime

      public void setStatusChangedTime(Instant statusChangedTime)
      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

      public 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.
      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

      public void setCompletedTaskTtl(Duration completedTaskTtl)
      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

      public void setRunSpecification(RunSpecification runSpecification)
      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

      public void setTaskSummary(TaskSummary taskSummary)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object