Class ComputeResource.Builder

  • All Implemented Interfaces:
    ComputeResourceOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    ComputeResource

    public static final class ComputeResource.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<ComputeResource.Builder>
    implements ComputeResourceOrBuilder
     Compute resource requirements.
    
     ComputeResource defines the amount of resources required for each task.
     Make sure your tasks have enough resources to successfully run.
     If you also define the types of resources for a job to use with the
     [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate)
     field, make sure both fields are compatible with each other.
     
    Protobuf type google.cloud.batch.v1alpha.ComputeResource
    • Method Detail

      • getDescriptor

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

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<ComputeResource.Builder>
      • clear

        public ComputeResource.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<ComputeResource.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<ComputeResource.Builder>
      • getDefaultInstanceForType

        public ComputeResource getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public ComputeResource build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public ComputeResource buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public ComputeResource.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<ComputeResource.Builder>
      • setField

        public ComputeResource.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<ComputeResource.Builder>
      • clearField

        public ComputeResource.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<ComputeResource.Builder>
      • clearOneof

        public ComputeResource.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<ComputeResource.Builder>
      • setRepeatedField

        public ComputeResource.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                        int index,
                                                        Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<ComputeResource.Builder>
      • addRepeatedField

        public ComputeResource.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                        Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<ComputeResource.Builder>
      • mergeFrom

        public ComputeResource.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ComputeResource.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<ComputeResource.Builder>
      • mergeFrom

        public ComputeResource.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                                 com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                          throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<ComputeResource.Builder>
        Throws:
        IOException
      • getCpuMilli

        public long getCpuMilli()
         The milliCPU count.
        
         `cpuMilli` defines the amount of CPU resources per task in milliCPU units.
         For example, `1000` corresponds to 1 vCPU per task. If undefined, the
         default value is `2000`.
        
         If you also define the VM's machine type using the `machineType` in
         [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy)
         field or inside the `instanceTemplate` in the
         [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate)
         field, make sure the CPU resources for both fields are compatible with each
         other and with how many tasks you want to allow to run on the same VM at
         the same time.
        
         For example, if you specify the `n2-standard-2` machine type, which has 2
         vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or
         you are recommended to run two tasks on the same VM if you set `cpuMilli`
         to `1000` or less.
         
        int64 cpu_milli = 1;
        Specified by:
        getCpuMilli in interface ComputeResourceOrBuilder
        Returns:
        The cpuMilli.
      • setCpuMilli

        public ComputeResource.Builder setCpuMilli​(long value)
         The milliCPU count.
        
         `cpuMilli` defines the amount of CPU resources per task in milliCPU units.
         For example, `1000` corresponds to 1 vCPU per task. If undefined, the
         default value is `2000`.
        
         If you also define the VM's machine type using the `machineType` in
         [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy)
         field or inside the `instanceTemplate` in the
         [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate)
         field, make sure the CPU resources for both fields are compatible with each
         other and with how many tasks you want to allow to run on the same VM at
         the same time.
        
         For example, if you specify the `n2-standard-2` machine type, which has 2
         vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or
         you are recommended to run two tasks on the same VM if you set `cpuMilli`
         to `1000` or less.
         
        int64 cpu_milli = 1;
        Parameters:
        value - The cpuMilli to set.
        Returns:
        This builder for chaining.
      • clearCpuMilli

        public ComputeResource.Builder clearCpuMilli()
         The milliCPU count.
        
         `cpuMilli` defines the amount of CPU resources per task in milliCPU units.
         For example, `1000` corresponds to 1 vCPU per task. If undefined, the
         default value is `2000`.
        
         If you also define the VM's machine type using the `machineType` in
         [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy)
         field or inside the `instanceTemplate` in the
         [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate)
         field, make sure the CPU resources for both fields are compatible with each
         other and with how many tasks you want to allow to run on the same VM at
         the same time.
        
         For example, if you specify the `n2-standard-2` machine type, which has 2
         vCPUs each, you are recommended to set `cpuMilli` no more than `2000`, or
         you are recommended to run two tasks on the same VM if you set `cpuMilli`
         to `1000` or less.
         
        int64 cpu_milli = 1;
        Returns:
        This builder for chaining.
      • getMemoryMib

        public long getMemoryMib()
         Memory in MiB.
        
         `memoryMib` defines the amount of memory per task in MiB units.
         If undefined, the default value is `2000`.
         If you also define the VM's machine type using the `machineType` in
         [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy)
         field or inside the `instanceTemplate` in the
         [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate)
         field, make sure the memory resources for both fields are compatible with
         each other and with how many tasks you want to allow to run on the same VM
         at the same time.
        
         For example, if you specify the `n2-standard-2` machine type, which has 8
         GiB each, you are recommended to set `memoryMib` to no more than `8192`,
         or you are recommended to run two tasks on the same VM if you set
         `memoryMib` to `4096` or less.
         
        int64 memory_mib = 2;
        Specified by:
        getMemoryMib in interface ComputeResourceOrBuilder
        Returns:
        The memoryMib.
      • setMemoryMib

        public ComputeResource.Builder setMemoryMib​(long value)
         Memory in MiB.
        
         `memoryMib` defines the amount of memory per task in MiB units.
         If undefined, the default value is `2000`.
         If you also define the VM's machine type using the `machineType` in
         [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy)
         field or inside the `instanceTemplate` in the
         [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate)
         field, make sure the memory resources for both fields are compatible with
         each other and with how many tasks you want to allow to run on the same VM
         at the same time.
        
         For example, if you specify the `n2-standard-2` machine type, which has 8
         GiB each, you are recommended to set `memoryMib` to no more than `8192`,
         or you are recommended to run two tasks on the same VM if you set
         `memoryMib` to `4096` or less.
         
        int64 memory_mib = 2;
        Parameters:
        value - The memoryMib to set.
        Returns:
        This builder for chaining.
      • clearMemoryMib

        public ComputeResource.Builder clearMemoryMib()
         Memory in MiB.
        
         `memoryMib` defines the amount of memory per task in MiB units.
         If undefined, the default value is `2000`.
         If you also define the VM's machine type using the `machineType` in
         [InstancePolicy](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicy)
         field or inside the `instanceTemplate` in the
         [InstancePolicyOrTemplate](https://cloud.google.com/batch/docs/reference/rest/v1/projects.locations.jobs#instancepolicyortemplate)
         field, make sure the memory resources for both fields are compatible with
         each other and with how many tasks you want to allow to run on the same VM
         at the same time.
        
         For example, if you specify the `n2-standard-2` machine type, which has 8
         GiB each, you are recommended to set `memoryMib` to no more than `8192`,
         or you are recommended to run two tasks on the same VM if you set
         `memoryMib` to `4096` or less.
         
        int64 memory_mib = 2;
        Returns:
        This builder for chaining.
      • getGpuCount

        public long getGpuCount()
         The GPU count.
        
         Not yet implemented.
         
        int64 gpu_count = 3;
        Specified by:
        getGpuCount in interface ComputeResourceOrBuilder
        Returns:
        The gpuCount.
      • setGpuCount

        public ComputeResource.Builder setGpuCount​(long value)
         The GPU count.
        
         Not yet implemented.
         
        int64 gpu_count = 3;
        Parameters:
        value - The gpuCount to set.
        Returns:
        This builder for chaining.
      • clearGpuCount

        public ComputeResource.Builder clearGpuCount()
         The GPU count.
        
         Not yet implemented.
         
        int64 gpu_count = 3;
        Returns:
        This builder for chaining.
      • getBootDiskMib

        public long getBootDiskMib()
         Extra boot disk size in MiB for each task.
         
        int64 boot_disk_mib = 4;
        Specified by:
        getBootDiskMib in interface ComputeResourceOrBuilder
        Returns:
        The bootDiskMib.
      • setBootDiskMib

        public ComputeResource.Builder setBootDiskMib​(long value)
         Extra boot disk size in MiB for each task.
         
        int64 boot_disk_mib = 4;
        Parameters:
        value - The bootDiskMib to set.
        Returns:
        This builder for chaining.
      • clearBootDiskMib

        public ComputeResource.Builder clearBootDiskMib()
         Extra boot disk size in MiB for each task.
         
        int64 boot_disk_mib = 4;
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final ComputeResource.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<ComputeResource.Builder>
      • mergeUnknownFields

        public final ComputeResource.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<ComputeResource.Builder>