Enum WorkerStatus
- java.lang.Object
-
- java.lang.Enum<WorkerStatus>
-
- com.snowflake.connectors.taskreactor.worker.status.WorkerStatus
-
- All Implemented Interfaces:
Serializable
,Comparable<WorkerStatus>
public enum WorkerStatus extends Enum<WorkerStatus>
Status describingWorkerLifecycleStatus.ACTIVE
workers. This status determines whether a worker is considered as available for dispatcher to assign work to or not.Those statuses are stored in
WORKER_STATUS
table. This table is append-only to prevent from excessive table locking when the status is updated by multiple workers at the same time. Status for a worker is computed as the newest row for givenWORKER_ID
in the table.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AVAILABLE
Worker is operational and work could be assigned to it.IN_PROGRESS
Worker
class sets this status on the beginning of execution.SCHEDULED_FOR_CANCELLATION
If a new row withcancelOngoingExecution: true
flag is added to the input queue, worker gets this status assigned by theDispatcher
.WORK_ASSIGNED
Worker gets this status assigned once theDispatcher
assigns work to it.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static WorkerStatus
valueOf(String name)
Returns the enum constant of this type with the specified name.static WorkerStatus[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
AVAILABLE
public static final WorkerStatus AVAILABLE
Worker is operational and work could be assigned to it.This status is assigned to worker right after creation of the worker, or when the
Worker
finishes the execution.
-
WORK_ASSIGNED
public static final WorkerStatus WORK_ASSIGNED
Worker gets this status assigned once theDispatcher
assigns work to it.
-
IN_PROGRESS
public static final WorkerStatus IN_PROGRESS
Worker
class sets this status on the beginning of execution.
-
SCHEDULED_FOR_CANCELLATION
public static final WorkerStatus SCHEDULED_FOR_CANCELLATION
If a new row withcancelOngoingExecution: true
flag is added to the input queue, worker gets this status assigned by theDispatcher
. Then theWorker
, in each iteration, checks if it needs to stop its execution.
-
-
Method Detail
-
values
public static WorkerStatus[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (WorkerStatus c : WorkerStatus.values()) System.out.println(c);
- 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 nameNullPointerException
- if the argument is null
-
-