Class TaskSpec

  • All Implemented Interfaces:
    TaskSpecOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class TaskSpec
    extends com.google.protobuf.GeneratedMessageV3
    implements TaskSpecOrBuilder
     Spec of a task
     
    Protobuf type google.cloud.batch.v1alpha.TaskSpec
    See Also:
    Serialized Form
    • Field Detail

      • COMPUTE_RESOURCE_FIELD_NUMBER

        public static final int COMPUTE_RESOURCE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • MAX_RUN_DURATION_FIELD_NUMBER

        public static final int MAX_RUN_DURATION_FIELD_NUMBER
        See Also:
        Constant Field Values
      • MAX_RETRY_COUNT_FIELD_NUMBER

        public static final int MAX_RETRY_COUNT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • LIFECYCLE_POLICIES_FIELD_NUMBER

        public static final int LIFECYCLE_POLICIES_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ENVIRONMENTS_FIELD_NUMBER

        public static final int ENVIRONMENTS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ENVIRONMENT_FIELD_NUMBER

        public static final int ENVIRONMENT_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetMapField

        protected com.google.protobuf.MapField internalGetMapField​(int number)
        Overrides:
        internalGetMapField in class com.google.protobuf.GeneratedMessageV3
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • 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.cloud.batch.v1alpha.Runnable runnables = 8;
        Specified by:
        getRunnablesList in interface TaskSpecOrBuilder
      • 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.cloud.batch.v1alpha.Runnable runnables = 8;
        Specified by:
        getRunnablesOrBuilderList in interface TaskSpecOrBuilder
      • 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.cloud.batch.v1alpha.Runnable runnables = 8;
        Specified by:
        getRunnablesCount in interface TaskSpecOrBuilder
      • getRunnables

        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.cloud.batch.v1alpha.Runnable runnables = 8;
        Specified by:
        getRunnables in interface TaskSpecOrBuilder
      • getRunnablesOrBuilder

        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.cloud.batch.v1alpha.Runnable runnables = 8;
        Specified by:
        getRunnablesOrBuilder in interface TaskSpecOrBuilder
      • hasComputeResource

        public boolean hasComputeResource()
         ComputeResource requirements.
         
        .google.cloud.batch.v1alpha.ComputeResource compute_resource = 3;
        Specified by:
        hasComputeResource in interface TaskSpecOrBuilder
        Returns:
        Whether the computeResource field is set.
      • getComputeResource

        public ComputeResource getComputeResource()
         ComputeResource requirements.
         
        .google.cloud.batch.v1alpha.ComputeResource compute_resource = 3;
        Specified by:
        getComputeResource in interface TaskSpecOrBuilder
        Returns:
        The computeResource.
      • 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;
        Specified by:
        hasMaxRunDuration in interface TaskSpecOrBuilder
        Returns:
        Whether the maxRunDuration field is set.
      • getMaxRunDuration

        public com.google.protobuf.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;
        Specified by:
        getMaxRunDuration in interface TaskSpecOrBuilder
        Returns:
        The maxRunDuration.
      • getMaxRunDurationOrBuilder

        public com.google.protobuf.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;
        Specified by:
        getMaxRunDurationOrBuilder in interface TaskSpecOrBuilder
      • 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;
        Specified by:
        getMaxRetryCount in interface TaskSpecOrBuilder
        Returns:
        The maxRetryCount.
      • 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;
        Specified by:
        getLifecyclePoliciesList in interface TaskSpecOrBuilder
      • 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;
        Specified by:
        getLifecyclePoliciesOrBuilderList in interface TaskSpecOrBuilder
      • 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;
        Specified by:
        getLifecyclePoliciesCount in interface TaskSpecOrBuilder
      • getLifecyclePolicies

        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;
        Specified by:
        getLifecyclePolicies in interface TaskSpecOrBuilder
      • getLifecyclePoliciesOrBuilder

        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;
        Specified by:
        getLifecyclePoliciesOrBuilder in interface TaskSpecOrBuilder
      • containsEnvironments

        @Deprecated
        public boolean containsEnvironments​(String key)
        Deprecated.
         Deprecated: please use environment(non-plural) instead.
         
        map<string, string> environments = 6 [deprecated = true];
        Specified by:
        containsEnvironments in interface TaskSpecOrBuilder
      • getVolumesList

        public List<Volume> getVolumesList()
         Volumes to mount before running Tasks using this TaskSpec.
         
        repeated .google.cloud.batch.v1alpha.Volume volumes = 7;
        Specified by:
        getVolumesList in interface TaskSpecOrBuilder
      • getVolumesCount

        public int getVolumesCount()
         Volumes to mount before running Tasks using this TaskSpec.
         
        repeated .google.cloud.batch.v1alpha.Volume volumes = 7;
        Specified by:
        getVolumesCount in interface TaskSpecOrBuilder
      • getVolumes

        public Volume getVolumes​(int index)
         Volumes to mount before running Tasks using this TaskSpec.
         
        repeated .google.cloud.batch.v1alpha.Volume volumes = 7;
        Specified by:
        getVolumes in interface TaskSpecOrBuilder
      • getVolumesOrBuilder

        public VolumeOrBuilder getVolumesOrBuilder​(int index)
         Volumes to mount before running Tasks using this TaskSpec.
         
        repeated .google.cloud.batch.v1alpha.Volume volumes = 7;
        Specified by:
        getVolumesOrBuilder in interface TaskSpecOrBuilder
      • hasEnvironment

        public boolean hasEnvironment()
         Environment variables to set before running the Task.
         
        .google.cloud.batch.v1alpha.Environment environment = 10;
        Specified by:
        hasEnvironment in interface TaskSpecOrBuilder
        Returns:
        Whether the environment field is set.
      • getEnvironment

        public Environment getEnvironment()
         Environment variables to set before running the Task.
         
        .google.cloud.batch.v1alpha.Environment environment = 10;
        Specified by:
        getEnvironment in interface TaskSpecOrBuilder
        Returns:
        The environment.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static TaskSpec parseFrom​(ByteBuffer data)
                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static TaskSpec parseFrom​(ByteBuffer data,
                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static TaskSpec parseFrom​(com.google.protobuf.ByteString data)
                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static TaskSpec parseFrom​(com.google.protobuf.ByteString data,
                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static TaskSpec parseFrom​(byte[] data)
                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static TaskSpec parseFrom​(byte[] data,
                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                  throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static TaskSpec parseFrom​(com.google.protobuf.CodedInputStream input,
                                         com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                  throws IOException
        Throws:
        IOException
      • newBuilderForType

        public TaskSpec.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public TaskSpec.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected TaskSpec.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static TaskSpec getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<TaskSpec> parser()
      • getParserForType

        public com.google.protobuf.Parser<TaskSpec> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public TaskSpec getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder