Class Worker

java.lang.Object
co.yellowdog.platform.model.Worker
All Implemented Interfaces:
Identified, Serializable

public class Worker extends Object implements Identified, Serializable
Describes a Worker managed by the YellowDog Scheduler service.
See Also:
  • Method Details

    • builder

      public static Worker.Builder builder()
    • getId

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

      public WorkerStatus getStatus()
      The status of the worker.
      Returns:
      the status of the worker
    • getTaskGroupIds

      public List<String> getTaskGroupIds()
      The IDs of the task groups which have claims on the worker.
      Returns:
      the IDs of the task groups which have claims on the worker
    • getClaimCount

      public int getClaimCount()
      A count of the tasks groups which have claims on the worker. Always identical to the size of taskGroupIds.
      Returns:
      the count of the task groups which have claims on the worker
    • isExclusive

      public boolean isExclusive()
      Indicates if the worker is exclusively claimed by a single task group.
      Returns:
      indicates if the worker is exclusively claimed by a single task group
    • getCurrentTaskId

      public String getCurrentTaskId()
      The ID of the task currently allocated to the worker.
      Returns:
      the ID of the task currently allocated to the worker
    • getRegisteredTime

      public Instant getRegisteredTime()
      The time at which the worker was registered.
      Returns:
      the time at which the worker was registered
    • setId

      public void setId(String id)
    • setStatus

      public void setStatus(WorkerStatus status)
      The status of the worker.
      Parameters:
      status - the status of the worker
    • setTaskGroupIds

      public void setTaskGroupIds(List<String> taskGroupIds)
      The IDs of the task groups which have claims on the worker.
      Parameters:
      taskGroupIds - the IDs of the task groups which have claims on the worker
    • setClaimCount

      public void setClaimCount(int claimCount)
      A count of the tasks groups which have claims on the worker. Always identical to the size of taskGroupIds.
      Parameters:
      claimCount - the count of the task groups which have claims on the worker
    • setExclusive

      public void setExclusive(boolean exclusive)
      Indicates if the worker is exclusively claimed by a single task group.
      Parameters:
      exclusive - indicates if the worker is exclusively claimed by a single task group
    • setCurrentTaskId

      public void setCurrentTaskId(String currentTaskId)
      The ID of the task currently allocated to the worker.
      Parameters:
      currentTaskId - the ID of the task currently allocated to the worker
    • setRegisteredTime

      public void setRegisteredTime(Instant registeredTime)
      The time at which the worker was registered.
      Parameters:
      registeredTime - the time at which the worker was registered
    • 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