Class TaskGroup

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
com.google.cloud.batch.v1alpha.TaskGroup
All Implemented Interfaces:
TaskGroupOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

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

    • NAME_FIELD_NUMBER

      public static final int NAME_FIELD_NUMBER
      See Also:
    • TASK_SPEC_FIELD_NUMBER

      public static final int TASK_SPEC_FIELD_NUMBER
      See Also:
    • TASK_COUNT_FIELD_NUMBER

      public static final int TASK_COUNT_FIELD_NUMBER
      See Also:
    • PARALLELISM_FIELD_NUMBER

      public static final int PARALLELISM_FIELD_NUMBER
      See Also:
    • SCHEDULING_POLICY_FIELD_NUMBER

      public static final int SCHEDULING_POLICY_FIELD_NUMBER
      See Also:
    • ALLOCATION_POLICY_FIELD_NUMBER

      public static final int ALLOCATION_POLICY_FIELD_NUMBER
      See Also:
    • LABELS_FIELD_NUMBER

      public static final int LABELS_FIELD_NUMBER
      See Also:
    • TASK_ENVIRONMENTS_FIELD_NUMBER

      public static final int TASK_ENVIRONMENTS_FIELD_NUMBER
      See Also:
    • TASK_COUNT_PER_NODE_FIELD_NUMBER

      public static final int TASK_COUNT_PER_NODE_FIELD_NUMBER
      See Also:
    • REQUIRE_HOSTS_FILE_FIELD_NUMBER

      public static final int REQUIRE_HOSTS_FILE_FIELD_NUMBER
      See Also:
    • PERMISSIVE_SSH_FIELD_NUMBER

      public static final int PERMISSIVE_SSH_FIELD_NUMBER
      See Also:
    • RUN_AS_NON_ROOT_FIELD_NUMBER

      public static final int RUN_AS_NON_ROOT_FIELD_NUMBER
      See Also:
    • SERVICE_ACCOUNT_FIELD_NUMBER

      public static final int SERVICE_ACCOUNT_FIELD_NUMBER
      See Also:
  • Method Details

    • getDescriptor

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

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage
    • 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, parallel tasks per job limit).
       See: [Job Limits](https://cloud.google.com/batch/quotas#job_limits).
       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.
    • getAllocationPolicyOrBuilder

      public AllocationPolicyOrBuilder getAllocationPolicyOrBuilder()
       Compute resource allocation for the TaskGroup.
       If specified, it overrides resources in Job.
       
      .google.cloud.batch.v1alpha.AllocationPolicy allocation_policy = 7;
      Specified by:
      getAllocationPolicyOrBuilder in interface TaskGroupOrBuilder
    • 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
    • getLabels

      @Deprecated public Map<String,String> getLabels()
      Deprecated.
      Use getLabelsMap() instead.
      Specified by:
      getLabels 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. The host file supports up to 1000 VMs.
       
      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.
    • getRunAsNonRoot

      public boolean getRunAsNonRoot()
       Optional. If not set or set to false, Batch uses the root user to execute
       runnables. If set to true, Batch runs the runnables using a non-root user.
       Currently, the non-root user Batch used is generated by OS Login. For more
       information, see [About OS
       Login](https://cloud.google.com/compute/docs/oslogin).
       
      bool run_as_non_root = 14 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getRunAsNonRoot in interface TaskGroupOrBuilder
      Returns:
      The runAsNonRoot.
    • hasServiceAccount

      public boolean hasServiceAccount()
       Optional. ServiceAccount used by tasks within the task group for the access
       to other Cloud resources. This allows tasks to operate with permissions
       distinct from the service account for the VM set at `AllocationPolicy`. Use
       this field when tasks require different access rights than those of the VM.
      
       Specify the service account's `email` field. Ensure `scopes`
       include any necessary permissions for tasks, in addition to the default
       'cloud-platform' scope.
       
      .google.cloud.batch.v1alpha.ServiceAccount service_account = 15 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasServiceAccount in interface TaskGroupOrBuilder
      Returns:
      Whether the serviceAccount field is set.
    • getServiceAccount

      public ServiceAccount getServiceAccount()
       Optional. ServiceAccount used by tasks within the task group for the access
       to other Cloud resources. This allows tasks to operate with permissions
       distinct from the service account for the VM set at `AllocationPolicy`. Use
       this field when tasks require different access rights than those of the VM.
      
       Specify the service account's `email` field. Ensure `scopes`
       include any necessary permissions for tasks, in addition to the default
       'cloud-platform' scope.
       
      .google.cloud.batch.v1alpha.ServiceAccount service_account = 15 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getServiceAccount in interface TaskGroupOrBuilder
      Returns:
      The serviceAccount.
    • getServiceAccountOrBuilder

      public ServiceAccountOrBuilder getServiceAccountOrBuilder()
       Optional. ServiceAccount used by tasks within the task group for the access
       to other Cloud resources. This allows tasks to operate with permissions
       distinct from the service account for the VM set at `AllocationPolicy`. Use
       this field when tasks require different access rights than those of the VM.
      
       Specify the service account's `email` field. Ensure `scopes`
       include any necessary permissions for tasks, in addition to the default
       'cloud-platform' scope.
       
      .google.cloud.batch.v1alpha.ServiceAccount service_account = 15 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getServiceAccountOrBuilder in interface TaskGroupOrBuilder
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • 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.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • 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(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static TaskGroup parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static TaskGroup parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static TaskGroup parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static TaskGroup parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • 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
    • newBuilder

      public static TaskGroup.Builder newBuilder()
    • newBuilder

      public static TaskGroup.Builder newBuilder(TaskGroup prototype)
    • 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.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • 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.GeneratedMessage
    • getDefaultInstanceForType

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