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.Deprecated.disablePreallocation(Boolean disablePreallocation) If true, tasks are only allocated to nodes as workers become idle and are not queued on the node.failurePolicy(FailurePolicy failurePolicy) An optionalFailurePolicyforTasks.instancePricingPreference(InstancePricingPreference instancePricingPreference) The preferredInstancePricingof the machine instances to use.instanceType(@NotBlank String instanceType) instanceTypes(Collection<? extends @NotBlank String> instanceTypes) maximumTaskRetries(Integer maximumTaskRetries) Deprecated.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) retryableError(TaskErrorMatcher retryableError) Deprecated.retryableErrors(Collection<? extends TaskErrorMatcher> retryableErrors) Deprecated.retryPolicy(RetryPolicy retryPolicy) ARetryPolicyforTasks.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 ValidatedBuilder
build, validate
-
Method Details
-
instanceType
-
instanceTypes
-
clearInstanceTypes
-
instancePricingPreference
public RunSpecification.Builder instancePricingPreference(InstancePricingPreference instancePricingPreference) The preferredInstancePricingof the machine instances to use.- Parameters:
instancePricingPreference- the preferredInstancePricingof the machine instances to use- Returns:
this.
-
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.
-
maximumTaskRetries
Deprecated.UseretryPolicyinsteadThe maximum number of times a task can be retried after it has failed.To restrict which tasks can be retried based on the last error that was encountered, see
retryableErrors- 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
-
retryableError
Deprecated. -
retryableErrors
@Deprecated public RunSpecification.Builder retryableErrors(Collection<? extends TaskErrorMatcher> retryableErrors) Deprecated. -
clearRetryableErrors
Deprecated. -
disablePreallocation
If true, tasks are only allocated to nodes as workers become idle and are not queued on the node.- Parameters:
disablePreallocation- true, if tasks are only allocated to nodes as workers become idle; otherwise, false- Returns:
this.
-
retryPolicy
ARetryPolicyforTasks. This must not be used in combination with the deprecatedretryableErrors, this always overridesmaximumTaskRetries.- Parameters:
retryPolicy- Policy describing howTasks should be retried, can be null ifTasks should not be retried using theRetryPolicy- Returns:
this.
-
failurePolicy
An optionalFailurePolicyforTasks.- Parameters:
Policy- describing what to do when aTaskfails, can be null if no further actions should be taken.- Returns:
this.
-
buildUnchecked
Description copied from class:ValidatedBuilderBuilds the object without enforcing validation constraints. This should only be used for testing purposes- Overrides:
buildUncheckedin classValidatedBuilder<RunSpecification>- Returns:
- the object being built
-
toString
-
retryPolicyinstead