Class TaskGroup

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

    public final class TaskGroup
    extends com.google.protobuf.GeneratedMessageV3
    implements TaskGroupOrBuilder
     A TaskGroup defines one or more Tasks that all share the same TaskSpec.
     
    Protobuf type google.cloud.batch.v1alpha.TaskGroup
    See Also:
    Serialized Form
    • Field Detail

      • TASK_COUNT_FIELD_NUMBER

        public static final int TASK_COUNT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • PARALLELISM_FIELD_NUMBER

        public static final int PARALLELISM_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SCHEDULING_POLICY_FIELD_NUMBER

        public static final int SCHEDULING_POLICY_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ALLOCATION_POLICY_FIELD_NUMBER

        public static final int ALLOCATION_POLICY_FIELD_NUMBER
        See Also:
        Constant Field Values
      • TASK_ENVIRONMENTS_FIELD_NUMBER

        public static final int TASK_ENVIRONMENTS_FIELD_NUMBER
        See Also:
        Constant Field Values
      • TASK_COUNT_PER_NODE_FIELD_NUMBER

        public static final int TASK_COUNT_PER_NODE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • REQUIRE_HOSTS_FILE_FIELD_NUMBER

        public static final int REQUIRE_HOSTS_FILE_FIELD_NUMBER
        See Also:
        Constant Field Values
      • PERMISSIVE_SSH_FIELD_NUMBER

        public static final int PERMISSIVE_SSH_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
      • getName

        public String getName()
         Output only. TaskGroup name.
         The system generates this field based on parent Job name.
         For example:
         "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01".
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getName in interface TaskGroupOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.ByteString getNameBytes()
         Output only. TaskGroup name.
         The system generates this field based on parent Job name.
         For example:
         "projects/123456/locations/us-west1/jobs/job01/taskGroups/group01".
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getNameBytes in interface TaskGroupOrBuilder
        Returns:
        The bytes for name.
      • hasTaskSpec

        public boolean hasTaskSpec()
         Required. Tasks in the group share the same task spec.
         
        .google.cloud.batch.v1alpha.TaskSpec task_spec = 3 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        hasTaskSpec in interface TaskGroupOrBuilder
        Returns:
        Whether the taskSpec field is set.
      • getTaskSpec

        public TaskSpec getTaskSpec()
         Required. Tasks in the group share the same task spec.
         
        .google.cloud.batch.v1alpha.TaskSpec task_spec = 3 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getTaskSpec in interface TaskGroupOrBuilder
        Returns:
        The taskSpec.
      • getTaskSpecOrBuilder

        public TaskSpecOrBuilder getTaskSpecOrBuilder()
         Required. Tasks in the group share the same task spec.
         
        .google.cloud.batch.v1alpha.TaskSpec task_spec = 3 [(.google.api.field_behavior) = REQUIRED];
        Specified by:
        getTaskSpecOrBuilder in interface TaskGroupOrBuilder
      • getTaskCount

        public long getTaskCount()
         Number of Tasks in the TaskGroup.
         Default is 1.
         
        int64 task_count = 4;
        Specified by:
        getTaskCount in interface TaskGroupOrBuilder
        Returns:
        The taskCount.
      • getParallelism

        public long getParallelism()
         Max number of tasks that can run in parallel.
         Default to min(task_count, 1000).
         Field parallelism must be 1 if the scheduling_policy is IN_ORDER.
         
        int64 parallelism = 5;
        Specified by:
        getParallelism in interface TaskGroupOrBuilder
        Returns:
        The parallelism.
      • getSchedulingPolicyValue

        public int getSchedulingPolicyValue()
         Scheduling policy for Tasks in the TaskGroup.
         The default value is AS_SOON_AS_POSSIBLE.
         
        .google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy scheduling_policy = 6;
        Specified by:
        getSchedulingPolicyValue in interface TaskGroupOrBuilder
        Returns:
        The enum numeric value on the wire for schedulingPolicy.
      • getSchedulingPolicy

        public TaskGroup.SchedulingPolicy getSchedulingPolicy()
         Scheduling policy for Tasks in the TaskGroup.
         The default value is AS_SOON_AS_POSSIBLE.
         
        .google.cloud.batch.v1alpha.TaskGroup.SchedulingPolicy scheduling_policy = 6;
        Specified by:
        getSchedulingPolicy in interface TaskGroupOrBuilder
        Returns:
        The schedulingPolicy.
      • hasAllocationPolicy

        public boolean hasAllocationPolicy()
         Compute resource allocation for the TaskGroup.
         If specified, it overrides resources in Job.
         
        .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7;
        Specified by:
        hasAllocationPolicy in interface TaskGroupOrBuilder
        Returns:
        Whether the allocationPolicy field is set.
      • getAllocationPolicy

        public AllocationPolicy getAllocationPolicy()
         Compute resource allocation for the TaskGroup.
         If specified, it overrides resources in Job.
         
        .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7;
        Specified by:
        getAllocationPolicy in interface TaskGroupOrBuilder
        Returns:
        The allocationPolicy.
      • getLabelsCount

        public int getLabelsCount()
        Description copied from interface: TaskGroupOrBuilder
         Labels for the TaskGroup.
         Labels could be user provided or system generated.
         You can assign up to 64 labels.  [Google Compute Engine label
         restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
         apply.
         Label names that start with "goog-" or "google-" are reserved.
         
        map<string, string> labels = 8;
        Specified by:
        getLabelsCount in interface TaskGroupOrBuilder
      • containsLabels

        public boolean containsLabels​(String key)
         Labels for the TaskGroup.
         Labels could be user provided or system generated.
         You can assign up to 64 labels.  [Google Compute Engine label
         restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
         apply.
         Label names that start with "goog-" or "google-" are reserved.
         
        map<string, string> labels = 8;
        Specified by:
        containsLabels in interface TaskGroupOrBuilder
      • getLabelsMap

        public Map<String,​String> getLabelsMap()
         Labels for the TaskGroup.
         Labels could be user provided or system generated.
         You can assign up to 64 labels.  [Google Compute Engine label
         restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
         apply.
         Label names that start with "goog-" or "google-" are reserved.
         
        map<string, string> labels = 8;
        Specified by:
        getLabelsMap in interface TaskGroupOrBuilder
      • getLabelsOrDefault

        public String getLabelsOrDefault​(String key,
                                         String defaultValue)
         Labels for the TaskGroup.
         Labels could be user provided or system generated.
         You can assign up to 64 labels.  [Google Compute Engine label
         restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
         apply.
         Label names that start with "goog-" or "google-" are reserved.
         
        map<string, string> labels = 8;
        Specified by:
        getLabelsOrDefault in interface TaskGroupOrBuilder
      • getLabelsOrThrow

        public String getLabelsOrThrow​(String key)
         Labels for the TaskGroup.
         Labels could be user provided or system generated.
         You can assign up to 64 labels.  [Google Compute Engine label
         restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions)
         apply.
         Label names that start with "goog-" or "google-" are reserved.
         
        map<string, string> labels = 8;
        Specified by:
        getLabelsOrThrow in interface TaskGroupOrBuilder
      • getTaskEnvironmentsList

        public List<Environment> getTaskEnvironmentsList()
         An array of environment variable mappings, which are passed to Tasks with
         matching indices. If task_environments is used then task_count should
         not be specified in the request (and will be ignored). Task count will be
         the length of task_environments.
        
         Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in
         addition to any environment variables set in task_environments, specifying
         the number of Tasks in the Task's parent TaskGroup, and the specific Task's
         index in the TaskGroup (0 through BATCH_TASK_COUNT - 1).
         
        repeated .google.cloud.batch.v1alpha.Environment task_environments = 9;
        Specified by:
        getTaskEnvironmentsList in interface TaskGroupOrBuilder
      • getTaskEnvironmentsOrBuilderList

        public List<? extends EnvironmentOrBuilder> getTaskEnvironmentsOrBuilderList()
         An array of environment variable mappings, which are passed to Tasks with
         matching indices. If task_environments is used then task_count should
         not be specified in the request (and will be ignored). Task count will be
         the length of task_environments.
        
         Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in
         addition to any environment variables set in task_environments, specifying
         the number of Tasks in the Task's parent TaskGroup, and the specific Task's
         index in the TaskGroup (0 through BATCH_TASK_COUNT - 1).
         
        repeated .google.cloud.batch.v1alpha.Environment task_environments = 9;
        Specified by:
        getTaskEnvironmentsOrBuilderList in interface TaskGroupOrBuilder
      • getTaskEnvironmentsCount

        public int getTaskEnvironmentsCount()
         An array of environment variable mappings, which are passed to Tasks with
         matching indices. If task_environments is used then task_count should
         not be specified in the request (and will be ignored). Task count will be
         the length of task_environments.
        
         Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in
         addition to any environment variables set in task_environments, specifying
         the number of Tasks in the Task's parent TaskGroup, and the specific Task's
         index in the TaskGroup (0 through BATCH_TASK_COUNT - 1).
         
        repeated .google.cloud.batch.v1alpha.Environment task_environments = 9;
        Specified by:
        getTaskEnvironmentsCount in interface TaskGroupOrBuilder
      • getTaskEnvironments

        public Environment getTaskEnvironments​(int index)
         An array of environment variable mappings, which are passed to Tasks with
         matching indices. If task_environments is used then task_count should
         not be specified in the request (and will be ignored). Task count will be
         the length of task_environments.
        
         Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in
         addition to any environment variables set in task_environments, specifying
         the number of Tasks in the Task's parent TaskGroup, and the specific Task's
         index in the TaskGroup (0 through BATCH_TASK_COUNT - 1).
         
        repeated .google.cloud.batch.v1alpha.Environment task_environments = 9;
        Specified by:
        getTaskEnvironments in interface TaskGroupOrBuilder
      • getTaskEnvironmentsOrBuilder

        public EnvironmentOrBuilder getTaskEnvironmentsOrBuilder​(int index)
         An array of environment variable mappings, which are passed to Tasks with
         matching indices. If task_environments is used then task_count should
         not be specified in the request (and will be ignored). Task count will be
         the length of task_environments.
        
         Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in
         addition to any environment variables set in task_environments, specifying
         the number of Tasks in the Task's parent TaskGroup, and the specific Task's
         index in the TaskGroup (0 through BATCH_TASK_COUNT - 1).
         
        repeated .google.cloud.batch.v1alpha.Environment task_environments = 9;
        Specified by:
        getTaskEnvironmentsOrBuilder in interface TaskGroupOrBuilder
      • getTaskCountPerNode

        public long getTaskCountPerNode()
         Max number of tasks that can be run on a VM at the same time.
         If not specified, the system will decide a value based on available
         compute resources on a VM and task requirements.
         
        int64 task_count_per_node = 10;
        Specified by:
        getTaskCountPerNode in interface TaskGroupOrBuilder
        Returns:
        The taskCountPerNode.
      • getRequireHostsFile

        public boolean getRequireHostsFile()
         When true, Batch will populate a file with a list of all VMs assigned to
         the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path
         of that file. Defaults to false.
         
        bool require_hosts_file = 11;
        Specified by:
        getRequireHostsFile in interface TaskGroupOrBuilder
        Returns:
        The requireHostsFile.
      • getPermissiveSsh

        public boolean getPermissiveSsh()
         When true, Batch will configure SSH to allow passwordless login between
         VMs running the Batch tasks in the same TaskGroup.
         
        bool permissive_ssh = 12;
        Specified by:
        getPermissiveSsh in interface TaskGroupOrBuilder
        Returns:
        The permissiveSsh.
      • 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 TaskGroup parseFrom​(ByteBuffer data)
                                   throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

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

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

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

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

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

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

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

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

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

        public static TaskGroup getDefaultInstance()
      • parser

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

        public com.google.protobuf.Parser<TaskGroup> 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 TaskGroup getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder