Class TaskSpec (0.15.0)

public final class TaskSpec extends GeneratedMessageV3 implements TaskSpecOrBuilder

Spec of a task

Protobuf type google.events.cloud.batch.v1.TaskSpec

Implements

TaskSpecOrBuilder

Static Fields

COMPUTE_RESOURCE_FIELD_NUMBER

public static final int COMPUTE_RESOURCE_FIELD_NUMBER
Field Value
TypeDescription
int

ENVIRONMENTS_FIELD_NUMBER

public static final int ENVIRONMENTS_FIELD_NUMBER
Field Value
TypeDescription
int

ENVIRONMENT_FIELD_NUMBER

public static final int ENVIRONMENT_FIELD_NUMBER
Field Value
TypeDescription
int

LIFECYCLE_POLICIES_FIELD_NUMBER

public static final int LIFECYCLE_POLICIES_FIELD_NUMBER
Field Value
TypeDescription
int

MAX_RETRY_COUNT_FIELD_NUMBER

public static final int MAX_RETRY_COUNT_FIELD_NUMBER
Field Value
TypeDescription
int

MAX_RUN_DURATION_FIELD_NUMBER

public static final int MAX_RUN_DURATION_FIELD_NUMBER
Field Value
TypeDescription
int

RUNNABLES_FIELD_NUMBER

public static final int RUNNABLES_FIELD_NUMBER
Field Value
TypeDescription
int

VOLUMES_FIELD_NUMBER

public static final int VOLUMES_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static TaskSpec getDefaultInstance()
Returns
TypeDescription
TaskSpec

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static TaskSpec.Builder newBuilder()
Returns
TypeDescription
TaskSpec.Builder

newBuilder(TaskSpec prototype)

public static TaskSpec.Builder newBuilder(TaskSpec prototype)
Parameter
NameDescription
prototypeTaskSpec
Returns
TypeDescription
TaskSpec.Builder

parseDelimitedFrom(InputStream input)

public static TaskSpec parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
TaskSpec
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static TaskSpec parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TaskSpec
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static TaskSpec parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
TaskSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static TaskSpec parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TaskSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static TaskSpec parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
TaskSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static TaskSpec parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TaskSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static TaskSpec parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
TaskSpec
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static TaskSpec parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TaskSpec
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static TaskSpec parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
TaskSpec
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static TaskSpec parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TaskSpec
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static TaskSpec parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
TaskSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static TaskSpec parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
TaskSpec
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<TaskSpec> parser()
Returns
TypeDescription
Parser<TaskSpec>

Methods

containsEnvironments(String key)

public boolean containsEnvironments(String key)

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

map<string, string> environments = 6;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getComputeResource()

public ComputeResource getComputeResource()

ComputeResource requirements.

.google.events.cloud.batch.v1.ComputeResource compute_resource = 3;

Returns
TypeDescription
ComputeResource

The computeResource.

getComputeResourceOrBuilder()

public ComputeResourceOrBuilder getComputeResourceOrBuilder()

ComputeResource requirements.

.google.events.cloud.batch.v1.ComputeResource compute_resource = 3;

Returns
TypeDescription
ComputeResourceOrBuilder

getDefaultInstanceForType()

public TaskSpec getDefaultInstanceForType()
Returns
TypeDescription
TaskSpec

getEnvironment()

public Environment getEnvironment()

Environment variables to set before running the Task.

.google.events.cloud.batch.v1.Environment environment = 10;

Returns
TypeDescription
Environment

The environment.

getEnvironmentOrBuilder()

public EnvironmentOrBuilder getEnvironmentOrBuilder()

Environment variables to set before running the Task.

.google.events.cloud.batch.v1.Environment environment = 10;

Returns
TypeDescription
EnvironmentOrBuilder

getEnvironments()

public Map<String,String> getEnvironments()

Use #getEnvironmentsMap() instead.

Returns
TypeDescription
Map<String,String>

getEnvironmentsCount()

public int getEnvironmentsCount()

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

map<string, string> environments = 6;

Returns
TypeDescription
int

getEnvironmentsMap()

public Map<String,String> getEnvironmentsMap()

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

map<string, string> environments = 6;

Returns
TypeDescription
Map<String,String>

getEnvironmentsOrDefault(String key, String defaultValue)

public String getEnvironmentsOrDefault(String key, String defaultValue)

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

map<string, string> environments = 6;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getEnvironmentsOrThrow(String key)

public String getEnvironmentsOrThrow(String key)

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

map<string, string> environments = 6;

Parameter
NameDescription
keyString
Returns
TypeDescription
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.events.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9;

Parameter
NameDescription
indexint
Returns
TypeDescription
LifecyclePolicy

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.events.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9;

Returns
TypeDescription
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.events.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9;

Returns
TypeDescription
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.events.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9;

Parameter
NameDescription
indexint
Returns
TypeDescription
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.events.cloud.batch.v1.LifecyclePolicy lifecycle_policies = 9;

Returns
TypeDescription
List<? extends com.google.events.cloud.batch.v1.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
TypeDescription
int

The maxRetryCount.

getMaxRunDuration()

public Duration getMaxRunDuration()

Maximum duration the task should run. The task will be killed and marked as FAILED if over this limit.

.google.protobuf.Duration max_run_duration = 4;

Returns
TypeDescription
Duration

The maxRunDuration.

getMaxRunDurationOrBuilder()

public DurationOrBuilder getMaxRunDurationOrBuilder()

Maximum duration the task should run. The task will be killed and marked as FAILED if over this limit.

.google.protobuf.Duration max_run_duration = 4;

Returns
TypeDescription
DurationOrBuilder

getParserForType()

public Parser<TaskSpec> getParserForType()
Returns
TypeDescription
Parser<TaskSpec>
Overrides

getRunnables(int index)

public Runnable getRunnables(int index)

The sequence of scripts or containers to run for this Task. Each Task using this TaskSpec executes its list of runnables in order. The Task succeeds if all of its runnables either exit with a zero status or any that exit with a non-zero status have the ignore_exit_status flag. Background runnables are killed automatically (if they have not already exited) a short time after all foreground runnables have completed. Even though this is likely to result in a non-zero exit status for the background runnable, these automatic kills are not treated as Task failures.

repeated .google.events.cloud.batch.v1.Runnable runnables = 8;

Parameter
NameDescription
indexint
Returns
TypeDescription
Runnable

getRunnablesCount()

public int getRunnablesCount()

The sequence of scripts or containers to run for this Task. Each Task using this TaskSpec executes its list of runnables in order. The Task succeeds if all of its runnables either exit with a zero status or any that exit with a non-zero status have the ignore_exit_status flag. Background runnables are killed automatically (if they have not already exited) a short time after all foreground runnables have completed. Even though this is likely to result in a non-zero exit status for the background runnable, these automatic kills are not treated as Task failures.

repeated .google.events.cloud.batch.v1.Runnable runnables = 8;

Returns
TypeDescription
int

getRunnablesList()

public List<Runnable> getRunnablesList()

The sequence of scripts or containers to run for this Task. Each Task using this TaskSpec executes its list of runnables in order. The Task succeeds if all of its runnables either exit with a zero status or any that exit with a non-zero status have the ignore_exit_status flag. Background runnables are killed automatically (if they have not already exited) a short time after all foreground runnables have completed. Even though this is likely to result in a non-zero exit status for the background runnable, these automatic kills are not treated as Task failures.

repeated .google.events.cloud.batch.v1.Runnable runnables = 8;

Returns
TypeDescription
List<Runnable>

getRunnablesOrBuilder(int index)

public RunnableOrBuilder getRunnablesOrBuilder(int index)

The sequence of scripts or containers to run for this Task. Each Task using this TaskSpec executes its list of runnables in order. The Task succeeds if all of its runnables either exit with a zero status or any that exit with a non-zero status have the ignore_exit_status flag. Background runnables are killed automatically (if they have not already exited) a short time after all foreground runnables have completed. Even though this is likely to result in a non-zero exit status for the background runnable, these automatic kills are not treated as Task failures.

repeated .google.events.cloud.batch.v1.Runnable runnables = 8;

Parameter
NameDescription
indexint
Returns
TypeDescription
RunnableOrBuilder

getRunnablesOrBuilderList()

public List<? extends RunnableOrBuilder> getRunnablesOrBuilderList()

The sequence of scripts or containers to run for this Task. Each Task using this TaskSpec executes its list of runnables in order. The Task succeeds if all of its runnables either exit with a zero status or any that exit with a non-zero status have the ignore_exit_status flag. Background runnables are killed automatically (if they have not already exited) a short time after all foreground runnables have completed. Even though this is likely to result in a non-zero exit status for the background runnable, these automatic kills are not treated as Task failures.

repeated .google.events.cloud.batch.v1.Runnable runnables = 8;

Returns
TypeDescription
List<? extends com.google.events.cloud.batch.v1.RunnableOrBuilder>

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

getVolumes(int index)

public Volume getVolumes(int index)

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.events.cloud.batch.v1.Volume volumes = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
Volume

getVolumesCount()

public int getVolumesCount()

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.events.cloud.batch.v1.Volume volumes = 7;

Returns
TypeDescription
int

getVolumesList()

public List<Volume> getVolumesList()

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.events.cloud.batch.v1.Volume volumes = 7;

Returns
TypeDescription
List<Volume>

getVolumesOrBuilder(int index)

public VolumeOrBuilder getVolumesOrBuilder(int index)

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.events.cloud.batch.v1.Volume volumes = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
VolumeOrBuilder

getVolumesOrBuilderList()

public List<? extends VolumeOrBuilder> getVolumesOrBuilderList()

Volumes to mount before running Tasks using this TaskSpec.

repeated .google.events.cloud.batch.v1.Volume volumes = 7;

Returns
TypeDescription
List<? extends com.google.events.cloud.batch.v1.VolumeOrBuilder>

hasComputeResource()

public boolean hasComputeResource()

ComputeResource requirements.

.google.events.cloud.batch.v1.ComputeResource compute_resource = 3;

Returns
TypeDescription
boolean

Whether the computeResource field is set.

hasEnvironment()

public boolean hasEnvironment()

Environment variables to set before running the Task.

.google.events.cloud.batch.v1.Environment environment = 10;

Returns
TypeDescription
boolean

Whether the environment field is set.

hasMaxRunDuration()

public boolean hasMaxRunDuration()

Maximum duration the task should run. The task will be killed and marked as FAILED if over this limit.

.google.protobuf.Duration max_run_duration = 4;

Returns
TypeDescription
boolean

Whether the maxRunDuration field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public TaskSpec.Builder newBuilderForType()
Returns
TypeDescription
TaskSpec.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected TaskSpec.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
TaskSpec.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public TaskSpec.Builder toBuilder()
Returns
TypeDescription
TaskSpec.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException