Class TaskSpec.Builder (0.55.0)

public static final class TaskSpec.Builder extends GeneratedMessageV3.Builder<TaskSpec.Builder> implements TaskSpecOrBuilder

Spec of a task

Protobuf type google.cloud.batch.v1alpha.TaskSpec

Implements

TaskSpecOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllLifecyclePolicies(Iterable<? extends LifecyclePolicy> values)

public TaskSpec.Builder addAllLifecyclePolicies(Iterable<? extends LifecyclePolicy> values)

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Parameter
Name Description
values Iterable<? extends com.google.cloud.batch.v1alpha.LifecyclePolicy>
Returns
Type Description
TaskSpec.Builder

addAllRunnables(Iterable<? extends Runnable> values)

public TaskSpec.Builder addAllRunnables(Iterable<? extends Runnable> values)

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Parameter
Name Description
values Iterable<? extends com.google.cloud.batch.v1alpha.Runnable>
Returns
Type Description
TaskSpec.Builder

addAllVolumes(Iterable<? extends Volume> values)

public TaskSpec.Builder addAllVolumes(Iterable<? extends Volume> values)

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Parameter
Name Description
values Iterable<? extends com.google.cloud.batch.v1alpha.Volume>
Returns
Type Description
TaskSpec.Builder

addLifecyclePolicies(LifecyclePolicy value)

public TaskSpec.Builder addLifecyclePolicies(LifecyclePolicy value)

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Parameter
Name Description
value LifecyclePolicy
Returns
Type Description
TaskSpec.Builder

addLifecyclePolicies(LifecyclePolicy.Builder builderForValue)

public TaskSpec.Builder addLifecyclePolicies(LifecyclePolicy.Builder builderForValue)

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Parameter
Name Description
builderForValue LifecyclePolicy.Builder
Returns
Type Description
TaskSpec.Builder

addLifecyclePolicies(int index, LifecyclePolicy value)

public TaskSpec.Builder addLifecyclePolicies(int index, LifecyclePolicy value)

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Parameters
Name Description
index int
value LifecyclePolicy
Returns
Type Description
TaskSpec.Builder

addLifecyclePolicies(int index, LifecyclePolicy.Builder builderForValue)

public TaskSpec.Builder addLifecyclePolicies(int index, LifecyclePolicy.Builder builderForValue)

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Parameters
Name Description
index int
builderForValue LifecyclePolicy.Builder
Returns
Type Description
TaskSpec.Builder

addLifecyclePoliciesBuilder()

public LifecyclePolicy.Builder addLifecyclePoliciesBuilder()

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Returns
Type Description
LifecyclePolicy.Builder

addLifecyclePoliciesBuilder(int index)

public LifecyclePolicy.Builder addLifecyclePoliciesBuilder(int index)

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Parameter
Name Description
index int
Returns
Type Description
LifecyclePolicy.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public TaskSpec.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
TaskSpec.Builder
Overrides

addRunnables(Runnable value)

public TaskSpec.Builder addRunnables(Runnable value)

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Parameter
Name Description
value Runnable
Returns
Type Description
TaskSpec.Builder

addRunnables(Runnable.Builder builderForValue)

public TaskSpec.Builder addRunnables(Runnable.Builder builderForValue)

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Parameter
Name Description
builderForValue Runnable.Builder
Returns
Type Description
TaskSpec.Builder

addRunnables(int index, Runnable value)

public TaskSpec.Builder addRunnables(int index, Runnable value)

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Parameters
Name Description
index int
value Runnable
Returns
Type Description
TaskSpec.Builder

addRunnables(int index, Runnable.Builder builderForValue)

public TaskSpec.Builder addRunnables(int index, Runnable.Builder builderForValue)

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Parameters
Name Description
index int
builderForValue Runnable.Builder
Returns
Type Description
TaskSpec.Builder

addRunnablesBuilder()

public Runnable.Builder addRunnablesBuilder()

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Returns
Type Description
Runnable.Builder

addRunnablesBuilder(int index)

public Runnable.Builder addRunnablesBuilder(int index)

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Parameter
Name Description
index int
Returns
Type Description
Runnable.Builder

addVolumes(Volume value)

public TaskSpec.Builder addVolumes(Volume value)

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Parameter
Name Description
value Volume
Returns
Type Description
TaskSpec.Builder

addVolumes(Volume.Builder builderForValue)

public TaskSpec.Builder addVolumes(Volume.Builder builderForValue)

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Parameter
Name Description
builderForValue Volume.Builder
Returns
Type Description
TaskSpec.Builder

addVolumes(int index, Volume value)

public TaskSpec.Builder addVolumes(int index, Volume value)

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Parameters
Name Description
index int
value Volume
Returns
Type Description
TaskSpec.Builder

addVolumes(int index, Volume.Builder builderForValue)

public TaskSpec.Builder addVolumes(int index, Volume.Builder builderForValue)

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Parameters
Name Description
index int
builderForValue Volume.Builder
Returns
Type Description
TaskSpec.Builder

addVolumesBuilder()

public Volume.Builder addVolumesBuilder()

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Returns
Type Description
Volume.Builder

addVolumesBuilder(int index)

public Volume.Builder addVolumesBuilder(int index)

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Parameter
Name Description
index int
Returns
Type Description
Volume.Builder

build()

public TaskSpec build()
Returns
Type Description
TaskSpec

buildPartial()

public TaskSpec buildPartial()
Returns
Type Description
TaskSpec

clear()

public TaskSpec.Builder clear()
Returns
Type Description
TaskSpec.Builder
Overrides

clearComputeResource()

public TaskSpec.Builder clearComputeResource()

ComputeResource requirements.

.google.cloud.batch.v1alpha.ComputeResource compute_resource = 3;

Returns
Type Description
TaskSpec.Builder

clearEnvironment()

public TaskSpec.Builder clearEnvironment()

Environment variables to set before running the Task.

.google.cloud.batch.v1alpha.Environment environment = 10;

Returns
Type Description
TaskSpec.Builder

clearEnvironments() (deprecated)

public TaskSpec.Builder clearEnvironments()
Returns
Type Description
TaskSpec.Builder

clearField(Descriptors.FieldDescriptor field)

public TaskSpec.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
TaskSpec.Builder
Overrides

clearLifecyclePolicies()

public TaskSpec.Builder clearLifecyclePolicies()

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Returns
Type Description
TaskSpec.Builder

clearMaxRetryCount()

public TaskSpec.Builder clearMaxRetryCount()

Maximum number of retries on failures. The default, 0, which means never retry. The valid value range is [0, 10].

int32 max_retry_count = 5;

Returns
Type Description
TaskSpec.Builder

This builder for chaining.

clearMaxRunDuration()

public TaskSpec.Builder clearMaxRunDuration()

Maximum duration the task should run before being automatically retried (if enabled) or automatically failed. Format the value of this field as a time limit in seconds followed by s&mdash;for example, 3600s for 1 hour. The field accepts any value between 0 and the maximum listed for the Duration field type at https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, the actual maximum run time for a job will be limited to the maximum run time for a job listed at https://cloud.google.com/batch/quotas#max-job-duration.

.google.protobuf.Duration max_run_duration = 4;

Returns
Type Description
TaskSpec.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public TaskSpec.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
TaskSpec.Builder
Overrides

clearRunnables()

public TaskSpec.Builder clearRunnables()

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Returns
Type Description
TaskSpec.Builder

clearVolumes()

public TaskSpec.Builder clearVolumes()

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Returns
Type Description
TaskSpec.Builder

clone()

public TaskSpec.Builder clone()
Returns
Type Description
TaskSpec.Builder
Overrides

containsEnvironments(String key) (deprecated)

public boolean containsEnvironments(String key)

Deprecated: please use environment(non-plural) instead.

map<string, string> environments = 6 [deprecated = true];

Parameter
Name Description
key String
Returns
Type Description
boolean

getComputeResource()

public ComputeResource getComputeResource()

ComputeResource requirements.

.google.cloud.batch.v1alpha.ComputeResource compute_resource = 3;

Returns
Type Description
ComputeResource

The computeResource.

getComputeResourceBuilder()

public ComputeResource.Builder getComputeResourceBuilder()

ComputeResource requirements.

.google.cloud.batch.v1alpha.ComputeResource compute_resource = 3;

Returns
Type Description
ComputeResource.Builder

getComputeResourceOrBuilder()

public ComputeResourceOrBuilder getComputeResourceOrBuilder()

ComputeResource requirements.

.google.cloud.batch.v1alpha.ComputeResource compute_resource = 3;

Returns
Type Description
ComputeResourceOrBuilder

getDefaultInstanceForType()

public TaskSpec getDefaultInstanceForType()
Returns
Type Description
TaskSpec

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getEnvironment()

public Environment getEnvironment()

Environment variables to set before running the Task.

.google.cloud.batch.v1alpha.Environment environment = 10;

Returns
Type Description
Environment

The environment.

getEnvironmentBuilder()

public Environment.Builder getEnvironmentBuilder()

Environment variables to set before running the Task.

.google.cloud.batch.v1alpha.Environment environment = 10;

Returns
Type Description
Environment.Builder

getEnvironmentOrBuilder()

public EnvironmentOrBuilder getEnvironmentOrBuilder()

Environment variables to set before running the Task.

.google.cloud.batch.v1alpha.Environment environment = 10;

Returns
Type Description
EnvironmentOrBuilder

getEnvironments() (deprecated)

public Map<String,String> getEnvironments()

Use #getEnvironmentsMap() instead.

Returns
Type Description
Map<String,String>

getEnvironmentsCount() (deprecated)

public int getEnvironmentsCount()

Deprecated: please use environment(non-plural) instead.

map<string, string> environments = 6 [deprecated = true];

Returns
Type Description
int

getEnvironmentsMap() (deprecated)

public Map<String,String> getEnvironmentsMap()

Deprecated: please use environment(non-plural) instead.

map<string, string> environments = 6 [deprecated = true];

Returns
Type Description
Map<String,String>

getEnvironmentsOrDefault(String key, String defaultValue) (deprecated)

public String getEnvironmentsOrDefault(String key, String defaultValue)

Deprecated: please use environment(non-plural) instead.

map<string, string> environments = 6 [deprecated = true];

Parameters
Name Description
key String
defaultValue String
Returns
Type Description
String

getEnvironmentsOrThrow(String key) (deprecated)

public String getEnvironmentsOrThrow(String key)

Deprecated: please use environment(non-plural) instead.

map<string, string> environments = 6 [deprecated = true];

Parameter
Name Description
key String
Returns
Type Description
String

getLifecyclePolicies(int index)

public LifecyclePolicy getLifecyclePolicies(int index)

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Parameter
Name Description
index int
Returns
Type Description
LifecyclePolicy

getLifecyclePoliciesBuilder(int index)

public LifecyclePolicy.Builder getLifecyclePoliciesBuilder(int index)

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Parameter
Name Description
index int
Returns
Type Description
LifecyclePolicy.Builder

getLifecyclePoliciesBuilderList()

public List<LifecyclePolicy.Builder> getLifecyclePoliciesBuilderList()

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Returns
Type Description
List<Builder>

getLifecyclePoliciesCount()

public int getLifecyclePoliciesCount()

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Returns
Type Description
int

getLifecyclePoliciesList()

public List<LifecyclePolicy> getLifecyclePoliciesList()

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Returns
Type Description
List<LifecyclePolicy>

getLifecyclePoliciesOrBuilder(int index)

public LifecyclePolicyOrBuilder getLifecyclePoliciesOrBuilder(int index)

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Parameter
Name Description
index int
Returns
Type Description
LifecyclePolicyOrBuilder

getLifecyclePoliciesOrBuilderList()

public List<? extends LifecyclePolicyOrBuilder> getLifecyclePoliciesOrBuilderList()

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Returns
Type Description
List<? extends com.google.cloud.batch.v1alpha.LifecyclePolicyOrBuilder>

getMaxRetryCount()

public int getMaxRetryCount()

Maximum number of retries on failures. The default, 0, which means never retry. The valid value range is [0, 10].

int32 max_retry_count = 5;

Returns
Type Description
int

The maxRetryCount.

getMaxRunDuration()

public Duration getMaxRunDuration()

Maximum duration the task should run before being automatically retried (if enabled) or automatically failed. Format the value of this field as a time limit in seconds followed by s&mdash;for example, 3600s for 1 hour. The field accepts any value between 0 and the maximum listed for the Duration field type at https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, the actual maximum run time for a job will be limited to the maximum run time for a job listed at https://cloud.google.com/batch/quotas#max-job-duration.

.google.protobuf.Duration max_run_duration = 4;

Returns
Type Description
Duration

The maxRunDuration.

getMaxRunDurationBuilder()

public Duration.Builder getMaxRunDurationBuilder()

Maximum duration the task should run before being automatically retried (if enabled) or automatically failed. Format the value of this field as a time limit in seconds followed by s&mdash;for example, 3600s for 1 hour. The field accepts any value between 0 and the maximum listed for the Duration field type at https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, the actual maximum run time for a job will be limited to the maximum run time for a job listed at https://cloud.google.com/batch/quotas#max-job-duration.

.google.protobuf.Duration max_run_duration = 4;

Returns
Type Description
Builder

getMaxRunDurationOrBuilder()

public DurationOrBuilder getMaxRunDurationOrBuilder()

Maximum duration the task should run before being automatically retried (if enabled) or automatically failed. Format the value of this field as a time limit in seconds followed by s&mdash;for example, 3600s for 1 hour. The field accepts any value between 0 and the maximum listed for the Duration field type at https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, the actual maximum run time for a job will be limited to the maximum run time for a job listed at https://cloud.google.com/batch/quotas#max-job-duration.

.google.protobuf.Duration max_run_duration = 4;

Returns
Type Description
DurationOrBuilder

getMutableEnvironments() (deprecated)

public Map<String,String> getMutableEnvironments()

Use alternate mutation accessors instead.

Returns
Type Description
Map<String,String>

getRunnables(int index)

public Runnable getRunnables(int index)

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Parameter
Name Description
index int
Returns
Type Description
Runnable

getRunnablesBuilder(int index)

public Runnable.Builder getRunnablesBuilder(int index)

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Parameter
Name Description
index int
Returns
Type Description
Runnable.Builder

getRunnablesBuilderList()

public List<Runnable.Builder> getRunnablesBuilderList()

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Returns
Type Description
List<Builder>

getRunnablesCount()

public int getRunnablesCount()

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Returns
Type Description
int

getRunnablesList()

public List<Runnable> getRunnablesList()

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Returns
Type Description
List<Runnable>

getRunnablesOrBuilder(int index)

public RunnableOrBuilder getRunnablesOrBuilder(int index)

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Parameter
Name Description
index int
Returns
Type Description
RunnableOrBuilder

getRunnablesOrBuilderList()

public List<? extends RunnableOrBuilder> getRunnablesOrBuilderList()

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Returns
Type Description
List<? extends com.google.cloud.batch.v1alpha.RunnableOrBuilder>

getVolumes(int index)

public Volume getVolumes(int index)

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Parameter
Name Description
index int
Returns
Type Description
Volume

getVolumesBuilder(int index)

public Volume.Builder getVolumesBuilder(int index)

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Parameter
Name Description
index int
Returns
Type Description
Volume.Builder

getVolumesBuilderList()

public List<Volume.Builder> getVolumesBuilderList()

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Returns
Type Description
List<Builder>

getVolumesCount()

public int getVolumesCount()

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Returns
Type Description
int

getVolumesList()

public List<Volume> getVolumesList()

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Returns
Type Description
List<Volume>

getVolumesOrBuilder(int index)

public VolumeOrBuilder getVolumesOrBuilder(int index)

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Parameter
Name Description
index int
Returns
Type Description
VolumeOrBuilder

getVolumesOrBuilderList()

public List<? extends VolumeOrBuilder> getVolumesOrBuilderList()

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Returns
Type Description
List<? extends com.google.cloud.batch.v1alpha.VolumeOrBuilder>

hasComputeResource()

public boolean hasComputeResource()

ComputeResource requirements.

.google.cloud.batch.v1alpha.ComputeResource compute_resource = 3;

Returns
Type Description
boolean

Whether the computeResource field is set.

hasEnvironment()

public boolean hasEnvironment()

Environment variables to set before running the Task.

.google.cloud.batch.v1alpha.Environment environment = 10;

Returns
Type Description
boolean

Whether the environment field is set.

hasMaxRunDuration()

public boolean hasMaxRunDuration()

Maximum duration the task should run before being automatically retried (if enabled) or automatically failed. Format the value of this field as a time limit in seconds followed by s&mdash;for example, 3600s for 1 hour. The field accepts any value between 0 and the maximum listed for the Duration field type at https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, the actual maximum run time for a job will be limited to the maximum run time for a job listed at https://cloud.google.com/batch/quotas#max-job-duration.

.google.protobuf.Duration max_run_duration = 4;

Returns
Type Description
boolean

Whether the maxRunDuration field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMapFieldReflection(int)

internalGetMutableMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.Builder.internalGetMutableMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeComputeResource(ComputeResource value)

public TaskSpec.Builder mergeComputeResource(ComputeResource value)

ComputeResource requirements.

.google.cloud.batch.v1alpha.ComputeResource compute_resource = 3;

Parameter
Name Description
value ComputeResource
Returns
Type Description
TaskSpec.Builder

mergeEnvironment(Environment value)

public TaskSpec.Builder mergeEnvironment(Environment value)

Environment variables to set before running the Task.

.google.cloud.batch.v1alpha.Environment environment = 10;

Parameter
Name Description
value Environment
Returns
Type Description
TaskSpec.Builder

mergeFrom(TaskSpec other)

public TaskSpec.Builder mergeFrom(TaskSpec other)
Parameter
Name Description
other TaskSpec
Returns
Type Description
TaskSpec.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public TaskSpec.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
TaskSpec.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public TaskSpec.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
TaskSpec.Builder
Overrides

mergeMaxRunDuration(Duration value)

public TaskSpec.Builder mergeMaxRunDuration(Duration value)

Maximum duration the task should run before being automatically retried (if enabled) or automatically failed. Format the value of this field as a time limit in seconds followed by s&mdash;for example, 3600s for 1 hour. The field accepts any value between 0 and the maximum listed for the Duration field type at https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, the actual maximum run time for a job will be limited to the maximum run time for a job listed at https://cloud.google.com/batch/quotas#max-job-duration.

.google.protobuf.Duration max_run_duration = 4;

Parameter
Name Description
value Duration
Returns
Type Description
TaskSpec.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final TaskSpec.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
TaskSpec.Builder
Overrides

putAllEnvironments(Map<String,String> values) (deprecated)

public TaskSpec.Builder putAllEnvironments(Map<String,String> values)

Deprecated: please use environment(non-plural) instead.

map<string, string> environments = 6 [deprecated = true];

Parameter
Name Description
values Map<String,String>
Returns
Type Description
TaskSpec.Builder

putEnvironments(String key, String value) (deprecated)

public TaskSpec.Builder putEnvironments(String key, String value)

Deprecated: please use environment(non-plural) instead.

map<string, string> environments = 6 [deprecated = true];

Parameters
Name Description
key String
value String
Returns
Type Description
TaskSpec.Builder

removeEnvironments(String key) (deprecated)

public TaskSpec.Builder removeEnvironments(String key)

Deprecated: please use environment(non-plural) instead.

map<string, string> environments = 6 [deprecated = true];

Parameter
Name Description
key String
Returns
Type Description
TaskSpec.Builder

removeLifecyclePolicies(int index)

public TaskSpec.Builder removeLifecyclePolicies(int index)

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Parameter
Name Description
index int
Returns
Type Description
TaskSpec.Builder

removeRunnables(int index)

public TaskSpec.Builder removeRunnables(int index)

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Parameter
Name Description
index int
Returns
Type Description
TaskSpec.Builder

removeVolumes(int index)

public TaskSpec.Builder removeVolumes(int index)

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Parameter
Name Description
index int
Returns
Type Description
TaskSpec.Builder

setComputeResource(ComputeResource value)

public TaskSpec.Builder setComputeResource(ComputeResource value)

ComputeResource requirements.

.google.cloud.batch.v1alpha.ComputeResource compute_resource = 3;

Parameter
Name Description
value ComputeResource
Returns
Type Description
TaskSpec.Builder

setComputeResource(ComputeResource.Builder builderForValue)

public TaskSpec.Builder setComputeResource(ComputeResource.Builder builderForValue)

ComputeResource requirements.

.google.cloud.batch.v1alpha.ComputeResource compute_resource = 3;

Parameter
Name Description
builderForValue ComputeResource.Builder
Returns
Type Description
TaskSpec.Builder

setEnvironment(Environment value)

public TaskSpec.Builder setEnvironment(Environment value)

Environment variables to set before running the Task.

.google.cloud.batch.v1alpha.Environment environment = 10;

Parameter
Name Description
value Environment
Returns
Type Description
TaskSpec.Builder

setEnvironment(Environment.Builder builderForValue)

public TaskSpec.Builder setEnvironment(Environment.Builder builderForValue)

Environment variables to set before running the Task.

.google.cloud.batch.v1alpha.Environment environment = 10;

Parameter
Name Description
builderForValue Environment.Builder
Returns
Type Description
TaskSpec.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public TaskSpec.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
TaskSpec.Builder
Overrides

setLifecyclePolicies(int index, LifecyclePolicy value)

public TaskSpec.Builder setLifecyclePolicies(int index, LifecyclePolicy value)

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Parameters
Name Description
index int
value LifecyclePolicy
Returns
Type Description
TaskSpec.Builder

setLifecyclePolicies(int index, LifecyclePolicy.Builder builderForValue)

public TaskSpec.Builder setLifecyclePolicies(int index, LifecyclePolicy.Builder builderForValue)

Lifecycle management schema when any task in a task group is failed. Currently we only support one lifecycle policy. When the lifecycle policy condition is met, the action in the policy will execute. If task execution result does not meet with the defined lifecycle policy, we consider it as the default policy. Default policy means if the exit code is 0, exit task. If task ends with non-zero exit code, retry the task with max_retry_count.

repeated .google.cloud.batch.v1alpha.LifecyclePolicy lifecycle_policies = 9;

Parameters
Name Description
index int
builderForValue LifecyclePolicy.Builder
Returns
Type Description
TaskSpec.Builder

setMaxRetryCount(int value)

public TaskSpec.Builder setMaxRetryCount(int value)

Maximum number of retries on failures. The default, 0, which means never retry. The valid value range is [0, 10].

int32 max_retry_count = 5;

Parameter
Name Description
value int

The maxRetryCount to set.

Returns
Type Description
TaskSpec.Builder

This builder for chaining.

setMaxRunDuration(Duration value)

public TaskSpec.Builder setMaxRunDuration(Duration value)

Maximum duration the task should run before being automatically retried (if enabled) or automatically failed. Format the value of this field as a time limit in seconds followed by s&mdash;for example, 3600s for 1 hour. The field accepts any value between 0 and the maximum listed for the Duration field type at https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, the actual maximum run time for a job will be limited to the maximum run time for a job listed at https://cloud.google.com/batch/quotas#max-job-duration.

.google.protobuf.Duration max_run_duration = 4;

Parameter
Name Description
value Duration
Returns
Type Description
TaskSpec.Builder

setMaxRunDuration(Duration.Builder builderForValue)

public TaskSpec.Builder setMaxRunDuration(Duration.Builder builderForValue)

Maximum duration the task should run before being automatically retried (if enabled) or automatically failed. Format the value of this field as a time limit in seconds followed by s&mdash;for example, 3600s for 1 hour. The field accepts any value between 0 and the maximum listed for the Duration field type at https://protobuf.dev/reference/protobuf/google.protobuf/#duration; however, the actual maximum run time for a job will be limited to the maximum run time for a job listed at https://cloud.google.com/batch/quotas#max-job-duration.

.google.protobuf.Duration max_run_duration = 4;

Parameter
Name Description
builderForValue Builder
Returns
Type Description
TaskSpec.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public TaskSpec.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
TaskSpec.Builder
Overrides

setRunnables(int index, Runnable value)

public TaskSpec.Builder setRunnables(int index, Runnable value)

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Parameters
Name Description
index int
value Runnable
Returns
Type Description
TaskSpec.Builder

setRunnables(int index, Runnable.Builder builderForValue)

public TaskSpec.Builder setRunnables(int index, Runnable.Builder builderForValue)

Required. The sequence of one or more runnables (executable scripts, executable containers, and/or barriers) for each task in this task group to run. Each task runs this list of runnables in order. For a task to succeed, all of its script and container runnables each must meet at least one of the following conditions:

  • The runnable exited with a zero status.
  • The runnable didn't finish, but you enabled its background subfield.
  • The runnable exited with a non-zero status, but you enabled its ignore_exit_status subfield.

repeated .google.cloud.batch.v1alpha.Runnable runnables = 8;

Parameters
Name Description
index int
builderForValue Runnable.Builder
Returns
Type Description
TaskSpec.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final TaskSpec.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
TaskSpec.Builder
Overrides

setVolumes(int index, Volume value)

public TaskSpec.Builder setVolumes(int index, Volume value)

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Parameters
Name Description
index int
value Volume
Returns
Type Description
TaskSpec.Builder

setVolumes(int index, Volume.Builder builderForValue)

public TaskSpec.Builder setVolumes(int index, Volume.Builder builderForValue)

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.cloud.batch.v1alpha.Volume volumes = 7;

Parameters
Name Description
index int
builderForValue Volume.Builder
Returns
Type Description
TaskSpec.Builder