Class AllocationPolicy

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

    public final class AllocationPolicy
    extends com.google.protobuf.GeneratedMessageV3
    implements AllocationPolicyOrBuilder
     A Job's resource allocation policy describes when, where, and how compute
     resources should be allocated for the Job.
     
    Protobuf type google.cloud.batch.v1alpha.AllocationPolicy
    See Also:
    Serialized Form
    • 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
      • hasLocation

        public boolean hasLocation()
         Location where compute resources should be allocated for the Job.
         
        .google.cloud.batch.v1alpha.AllocationPolicy.LocationPolicy location = 1;
        Specified by:
        hasLocation in interface AllocationPolicyOrBuilder
        Returns:
        Whether the location field is set.
      • hasInstance

        @Deprecated
        public boolean hasInstance()
        Deprecated.
        google.cloud.batch.v1alpha.AllocationPolicy.instance is deprecated. See google/cloud/batch/v1alpha/job.proto;l=557
         Deprecated: please use instances[0].policy instead.
         
        .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true];
        Specified by:
        hasInstance in interface AllocationPolicyOrBuilder
        Returns:
        Whether the instance field is set.
      • getInstance

        @Deprecated
        public AllocationPolicy.InstancePolicy getInstance()
        Deprecated.
        google.cloud.batch.v1alpha.AllocationPolicy.instance is deprecated. See google/cloud/batch/v1alpha/job.proto;l=557
         Deprecated: please use instances[0].policy instead.
         
        .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicy instance = 2 [deprecated = true];
        Specified by:
        getInstance in interface AllocationPolicyOrBuilder
        Returns:
        The instance.
      • getInstancesCount

        public int getInstancesCount()
         Describe instances that can be created by this AllocationPolicy.
         Only instances[0] is supported now.
         
        repeated .google.cloud.batch.v1alpha.AllocationPolicy.InstancePolicyOrTemplate instances = 8;
        Specified by:
        getInstancesCount in interface AllocationPolicyOrBuilder
      • getInstanceTemplatesList

        @Deprecated
        public com.google.protobuf.ProtocolStringList getInstanceTemplatesList()
        Deprecated.
        google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See google/cloud/batch/v1alpha/job.proto;l=564
         Deprecated: please use instances[0].template instead.
         
        repeated string instance_templates = 3 [deprecated = true];
        Specified by:
        getInstanceTemplatesList in interface AllocationPolicyOrBuilder
        Returns:
        A list containing the instanceTemplates.
      • getInstanceTemplatesCount

        @Deprecated
        public int getInstanceTemplatesCount()
        Deprecated.
        google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See google/cloud/batch/v1alpha/job.proto;l=564
         Deprecated: please use instances[0].template instead.
         
        repeated string instance_templates = 3 [deprecated = true];
        Specified by:
        getInstanceTemplatesCount in interface AllocationPolicyOrBuilder
        Returns:
        The count of instanceTemplates.
      • getInstanceTemplates

        @Deprecated
        public String getInstanceTemplates​(int index)
        Deprecated.
        google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See google/cloud/batch/v1alpha/job.proto;l=564
         Deprecated: please use instances[0].template instead.
         
        repeated string instance_templates = 3 [deprecated = true];
        Specified by:
        getInstanceTemplates in interface AllocationPolicyOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The instanceTemplates at the given index.
      • getInstanceTemplatesBytes

        @Deprecated
        public com.google.protobuf.ByteString getInstanceTemplatesBytes​(int index)
        Deprecated.
        google.cloud.batch.v1alpha.AllocationPolicy.instance_templates is deprecated. See google/cloud/batch/v1alpha/job.proto;l=564
         Deprecated: please use instances[0].template instead.
         
        repeated string instance_templates = 3 [deprecated = true];
        Specified by:
        getInstanceTemplatesBytes in interface AllocationPolicyOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The bytes of the instanceTemplates at the given index.
      • getProvisioningModelsList

        @Deprecated
        public List<AllocationPolicy.ProvisioningModel> getProvisioningModelsList()
        Deprecated.
        google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See google/cloud/batch/v1alpha/job.proto;l=567
         Deprecated: please use instances[0].policy.provisioning_model instead.
         
        repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true];
        Specified by:
        getProvisioningModelsList in interface AllocationPolicyOrBuilder
        Returns:
        A list containing the provisioningModels.
      • getProvisioningModelsCount

        @Deprecated
        public int getProvisioningModelsCount()
        Deprecated.
        google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See google/cloud/batch/v1alpha/job.proto;l=567
         Deprecated: please use instances[0].policy.provisioning_model instead.
         
        repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true];
        Specified by:
        getProvisioningModelsCount in interface AllocationPolicyOrBuilder
        Returns:
        The count of provisioningModels.
      • getProvisioningModels

        @Deprecated
        public AllocationPolicy.ProvisioningModel getProvisioningModels​(int index)
        Deprecated.
        google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See google/cloud/batch/v1alpha/job.proto;l=567
         Deprecated: please use instances[0].policy.provisioning_model instead.
         
        repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true];
        Specified by:
        getProvisioningModels in interface AllocationPolicyOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The provisioningModels at the given index.
      • getProvisioningModelsValueList

        @Deprecated
        public List<Integer> getProvisioningModelsValueList()
        Deprecated.
        google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See google/cloud/batch/v1alpha/job.proto;l=567
         Deprecated: please use instances[0].policy.provisioning_model instead.
         
        repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true];
        Specified by:
        getProvisioningModelsValueList in interface AllocationPolicyOrBuilder
        Returns:
        A list containing the enum numeric values on the wire for provisioningModels.
      • getProvisioningModelsValue

        @Deprecated
        public int getProvisioningModelsValue​(int index)
        Deprecated.
        google.cloud.batch.v1alpha.AllocationPolicy.provisioning_models is deprecated. See google/cloud/batch/v1alpha/job.proto;l=567
         Deprecated: please use instances[0].policy.provisioning_model instead.
         
        repeated .google.cloud.batch.v1alpha.AllocationPolicy.ProvisioningModel provisioning_models = 4 [deprecated = true];
        Specified by:
        getProvisioningModelsValue in interface AllocationPolicyOrBuilder
        Parameters:
        index - The index of the value to return.
        Returns:
        The enum numeric value on the wire of provisioningModels at the given index.
      • getServiceAccountEmail

        @Deprecated
        public String getServiceAccountEmail()
        Deprecated.
        google.cloud.batch.v1alpha.AllocationPolicy.service_account_email is deprecated. See google/cloud/batch/v1alpha/job.proto;l=570
         Deprecated: please use service_account instead.
         
        string service_account_email = 5 [deprecated = true];
        Specified by:
        getServiceAccountEmail in interface AllocationPolicyOrBuilder
        Returns:
        The serviceAccountEmail.
      • getServiceAccountEmailBytes

        @Deprecated
        public com.google.protobuf.ByteString getServiceAccountEmailBytes()
        Deprecated.
        google.cloud.batch.v1alpha.AllocationPolicy.service_account_email is deprecated. See google/cloud/batch/v1alpha/job.proto;l=570
         Deprecated: please use service_account instead.
         
        string service_account_email = 5 [deprecated = true];
        Specified by:
        getServiceAccountEmailBytes in interface AllocationPolicyOrBuilder
        Returns:
        The bytes for serviceAccountEmail.
      • hasServiceAccount

        public boolean hasServiceAccount()
         Service account that VMs will run as.
         
        .google.cloud.batch.v1alpha.ServiceAccount service_account = 9;
        Specified by:
        hasServiceAccount in interface AllocationPolicyOrBuilder
        Returns:
        Whether the serviceAccount field is set.
      • getLabelsCount

        public int getLabelsCount()
        Description copied from interface: AllocationPolicyOrBuilder
         Labels applied to all VM instances and other resources
         created by AllocationPolicy.
         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 = 6;
        Specified by:
        getLabelsCount in interface AllocationPolicyOrBuilder
      • containsLabels

        public boolean containsLabels​(String key)
         Labels applied to all VM instances and other resources
         created by AllocationPolicy.
         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 = 6;
        Specified by:
        containsLabels in interface AllocationPolicyOrBuilder
      • getLabelsMap

        public Map<String,​String> getLabelsMap()
         Labels applied to all VM instances and other resources
         created by AllocationPolicy.
         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 = 6;
        Specified by:
        getLabelsMap in interface AllocationPolicyOrBuilder
      • getLabelsOrDefault

        public String getLabelsOrDefault​(String key,
                                         String defaultValue)
         Labels applied to all VM instances and other resources
         created by AllocationPolicy.
         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 = 6;
        Specified by:
        getLabelsOrDefault in interface AllocationPolicyOrBuilder
      • getLabelsOrThrow

        public String getLabelsOrThrow​(String key)
         Labels applied to all VM instances and other resources
         created by AllocationPolicy.
         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 = 6;
        Specified by:
        getLabelsOrThrow in interface AllocationPolicyOrBuilder
      • hasNetwork

        public boolean hasNetwork()
         The network policy.
         
        .google.cloud.batch.v1alpha.AllocationPolicy.NetworkPolicy network = 7;
        Specified by:
        hasNetwork in interface AllocationPolicyOrBuilder
        Returns:
        Whether the network field is set.
      • hasPlacement

        public boolean hasPlacement()
         The placement policy.
         
        .google.cloud.batch.v1alpha.AllocationPolicy.PlacementPolicy placement = 10;
        Specified by:
        hasPlacement in interface AllocationPolicyOrBuilder
        Returns:
        Whether the placement field is set.
      • 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 AllocationPolicy parseFrom​(ByteBuffer data)
                                          throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

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

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

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

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

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

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

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

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

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

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