Class Worker
java.lang.Object
co.yellowdog.platform.model.Worker
- All Implemented Interfaces:
Identified, Serializable
Describes a Worker managed by the YellowDog Scheduler service.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Worker.Builderbuilder()protected booleanbooleanintA count of the tasks groups which have claims on the worker.The ID of the task currently allocated to the worker.getId()Returns the IDThe time at which the worker was registered.The status of the worker.The IDs of the task groups which have claims on the worker.inthashCode()booleanIndicates if the worker has been claimed by a task group for batch allocation.booleanIndicates if the worker is exclusively claimed by a single task group.voidsetBatchAllocation(boolean batchAllocation) Indicates if the worker has been claimed by a task group for batch allocation.voidsetClaimCount(int claimCount) A count of the tasks groups which have claims on the worker.voidsetCurrentTaskId(String currentTaskId) The ID of the task currently allocated to the worker.voidsetExclusive(boolean exclusive) Indicates if the worker is exclusively claimed by a single task group.voidvoidsetRegisteredTime(Instant registeredTime) The time at which the worker was registered.voidsetStatus(WorkerStatus status) The status of the worker.voidsetTaskGroupIds(List<String> taskGroupIds) The IDs of the task groups which have claims on the worker.toString()
-
Method Details
-
builder
-
getId
Description copied from interface:IdentifiedReturns the ID- Specified by:
getIdin interfaceIdentified- Returns:
- the ID
-
getStatus
-
getTaskGroupIds
-
getClaimCount
public int getClaimCount()A count of the tasks groups which have claims on the worker. Always identical to the size oftaskGroupIds.- 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
-
isBatchAllocation
public boolean isBatchAllocation()Indicates if the worker has been claimed by a task group for batch allocation. Tasks will be allocated to the worker's node in batches before being distributed to the worker.- Returns:
- indicates if the worker has been claimed by a task group for batch allocation
-
getCurrentTaskId
The ID of the task currently allocated to the worker.- Returns:
- the ID of the task currently allocated to the worker
-
getRegisteredTime
The time at which the worker was registered.- Returns:
- the time at which the worker was registered
-
setId
-
setStatus
The status of the worker.- Parameters:
status- the status of the worker
-
setTaskGroupIds
-
setClaimCount
public void setClaimCount(int claimCount) A count of the tasks groups which have claims on the worker. Always identical to the size oftaskGroupIds.- 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
-
setBatchAllocation
public void setBatchAllocation(boolean batchAllocation) Indicates if the worker has been claimed by a task group for batch allocation. Tasks will be allocated to the worker's node in batches before being distributed to the worker.- Parameters:
batchAllocation- indicates if the worker has been claimed by a task group for batch
-
setCurrentTaskId
The ID of the task currently allocated to the worker.- Parameters:
currentTaskId- the ID of the task currently allocated to the worker
-
setRegisteredTime
The time at which the worker was registered.- Parameters:
registeredTime- the time at which the worker was registered
-
equals
-
canEqual
-
hashCode
-
toString
-