Enum WorkerStatus

java.lang.Object
java.lang.Enum<WorkerStatus>
co.yellowdog.platform.model.WorkerStatus
All Implemented Interfaces:
Serializable, Comparable<WorkerStatus>, java.lang.constant.Constable

public enum WorkerStatus extends Enum<WorkerStatus>
Describes the current status of a Worker.
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The Worker has become claimed for batch allocation.
    The Worker has been instructed to execute a task.
    Deprecated.
    Workers can no longer be FOUND once LOST.
    The Worker's heartbeat is late.
    The Worker's heartbeat has not been received for long enough that the Worker is considered to have been lost.
    The Worker has been instructed to shut down.
    The Worker is claimed by one or more task groups but has been instructed to sleep as no tasks are READY for it.
    The Worker has become claimed and the Agent has been instructed to start the Worker.
    The Worker is not claimed and has been instructed to stop.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromAction(@NonNull WorkerAction action)
    Returns a WorkerStatus value based on the specified WorkerAction value.
    boolean
    Returns true, if the status indicates the Worker is currently available; otherwise, false.
    boolean
    Returns true, if the status indicates the Worker is currently healthy; otherwise, false.
    Returns the enum constant of this type with the specified name.
    static WorkerStatus[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • DOING_TASK

      public static final WorkerStatus DOING_TASK
      The Worker has been instructed to execute a task.
    • SLEEPING

      public static final WorkerStatus SLEEPING
      The Worker is claimed by one or more task groups but has been instructed to sleep as no tasks are READY for it.
    • STOPPED

      public static final WorkerStatus STOPPED
      The Worker is not claimed and has been instructed to stop.
    • STARTING

      public static final WorkerStatus STARTING
      The Worker has become claimed and the Agent has been instructed to start the Worker.
    • BATCH_ALLOCATION

      public static final WorkerStatus BATCH_ALLOCATION
      The Worker has become claimed for batch allocation. Its status is now monitored locally to the node.
    • LATE

      public static final WorkerStatus LATE
      The Worker's heartbeat is late.
    • LOST

      public static final WorkerStatus LOST
      The Worker's heartbeat has not been received for long enough that the Worker is considered to have been lost.
    • FOUND

      @Deprecated public static final WorkerStatus FOUND
      Deprecated.
      Workers can no longer be FOUND once LOST. Status can be removed when all clients >= v9.3.0
      The Worker was considered to be lost but its heartbeat has returned, however it has not yet requested instruction.
    • SHUTDOWN

      public static final WorkerStatus SHUTDOWN
      The Worker has been instructed to shut down.
  • Method Details

    • values

      public static WorkerStatus[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static WorkerStatus valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • fromAction

      public static WorkerStatus fromAction(@NonNull @NonNull WorkerAction action)
      Returns a WorkerStatus value based on the specified WorkerAction value.
      Parameters:
      action - the WorkerAction value
      Returns:
      a WorkerStatus value based on the specified WorkerAction value
    • isAvailable

      public boolean isAvailable()
      Returns true, if the status indicates the Worker is currently available; otherwise, false.
      Returns:
      true, if the status indicates the Worker is currently available; otherwise, false
    • isHealthy

      public boolean isHealthy()
      Returns true, if the status indicates the Worker is currently healthy; otherwise, false.
      Returns:
      true, if the status indicates the Worker is currently healthy; otherwise, false