Class RunSpecification.Builder
java.lang.Object
co.yellowdog.platform.model.builders.ValidatedBuilder<RunSpecification>
co.yellowdog.platform.model.RunSpecification.Builder
- Enclosing class:
RunSpecification
A builder that can be used to build a new RunSpecification that is automatically validated on build.
-
Method Summary
Modifier and TypeMethodDescriptionBuilds the object without enforcing validation constraints.exclusiveWorkers
(Boolean exclusiveWorkers) If true, then do not allow claimed Workers to be shared with other task groups; otherwise, Workers can be shared.instanceType
(@NotBlank String instanceType) instanceTypes
(Collection<? extends @NotBlank String> instanceTypes) maximumTaskRetries
(int maximumTaskRetries) The maximum number of times a task can be retried after it has failed.maxWorkers
(Integer maxWorkers) The maximum number of Workers that can be claimed for the associated TaskGroup.minWorkers
(Integer minWorkers) The minimum number of Workers that the associated TaskGroup requires.namespace
(@NotBlank @Namespace String namespace) namespaces
(Collection<? extends @NotBlank @Namespace String> namespaces) provider
(@NotNull CloudProvider provider) providers
(Collection<? extends @NotNull CloudProvider> providers) ram
(DoubleRange ram) Range constraint on GB of RAM that are required to execute tasksregions
(Collection<? extends @NotBlank String> regions) tasksPerWorker
(Integer tasksPerWorker) Determines the number of worker claims based on splitting the number of unfinished tasks across workers.taskTimeout
(Duration taskTimeout) The maximum time that a worker should attempt to execute a task for before failing it.taskTypes
(Collection<? extends @NotBlank String> taskTypes) toString()
vcpus
(DoubleRange vcpus) Range constraint on number of vCPUs that are required to execute tasksworkerTags
(Collection<? extends @NotBlank @Size(max=200) String> workerTags) Methods inherited from class co.yellowdog.platform.model.builders.ValidatedBuilder
build, validate
-
Method Details
-
instanceType
-
instanceTypes
-
clearInstanceTypes
-
vcpus
Range constraint on number of vCPUs that are required to execute tasks- Parameters:
vcpus
- range constraint on required number of vCPUs- Returns:
this
.
-
ram
Range constraint on GB of RAM that are required to execute tasks- Parameters:
ram
- range constraint on GB of RAM- Returns:
this
.
-
taskType
-
taskTypes
-
clearTaskTypes
-
minWorkers
The minimum number of Workers that the associated TaskGroup requires. This many workers must be claimed before the associated TaskGroup will start running.- Parameters:
minWorkers
- defines the minimum number of Workers required- Returns:
this
.
-
maxWorkers
The maximum number of Workers that can be claimed for the associated TaskGroup.- Parameters:
maxWorkers
- defines the maximum number of Workers that can be claimed- Returns:
this
.
-
tasksPerWorker
Determines the number of worker claims based on splitting the number of unfinished tasks across workers.- Parameters:
tasksPerWorker
- how many unfinished tasks per worker to determine the number of worker claims- Returns:
this
.
-
exclusiveWorkers
If true, then do not allow claimed Workers to be shared with other task groups; otherwise, Workers can be shared.- Parameters:
exclusiveWorkers
- if true, then do not allow claimed Workers to be shared with other task groups; otherwise, Workers can be shared- Returns:
this
.
-
maximumTaskRetries
The maximum number of times a task can be retried after it has failed.- Parameters:
maximumTaskRetries
- the maximum number of times a task can be retried after it has failed- Returns:
this
.
-
taskTimeout
The maximum time that a worker should attempt to execute a task for before failing it. NB: This value can be overridden on individual tasks when they are added.- Parameters:
taskTimeout
- the maximum time that a worker should attempt to execute a task for before failing it- Returns:
this
.
-
provider
-
providers
-
clearProviders
-
region
-
regions
-
clearRegions
-
workerTag
public RunSpecification.Builder workerTag(@NotBlank @Size(max=200) @NotBlank @Size(max=200) String workerTag) -
workerTags
public RunSpecification.Builder workerTags(Collection<? extends @NotBlank @Size(max=200) String> workerTags) -
clearWorkerTags
-
namespace
public RunSpecification.Builder namespace(@NotBlank @Namespace @NotBlank @Namespace String namespace) -
namespaces
public RunSpecification.Builder namespaces(Collection<? extends @NotBlank @Namespace String> namespaces) -
clearNamespaces
-
buildUnchecked
Description copied from class:ValidatedBuilder
Builds the object without enforcing validation constraints. This should only be used for testing purposes- Overrides:
buildUnchecked
in classValidatedBuilder<RunSpecification>
- Returns:
- the object being built
-
toString
-