Class AllocationPolicy (0.40.0)

public final class AllocationPolicy extends 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.v1.AllocationPolicy

Static Fields

INSTANCES_FIELD_NUMBER

public static final int INSTANCES_FIELD_NUMBER
Field Value
TypeDescription
int

LABELS_FIELD_NUMBER

public static final int LABELS_FIELD_NUMBER
Field Value
TypeDescription
int

LOCATION_FIELD_NUMBER

public static final int LOCATION_FIELD_NUMBER
Field Value
TypeDescription
int

NETWORK_FIELD_NUMBER

public static final int NETWORK_FIELD_NUMBER
Field Value
TypeDescription
int

PLACEMENT_FIELD_NUMBER

public static final int PLACEMENT_FIELD_NUMBER
Field Value
TypeDescription
int

SERVICE_ACCOUNT_FIELD_NUMBER

public static final int SERVICE_ACCOUNT_FIELD_NUMBER
Field Value
TypeDescription
int

TAGS_FIELD_NUMBER

public static final int TAGS_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static AllocationPolicy getDefaultInstance()
Returns
TypeDescription
AllocationPolicy

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static AllocationPolicy.Builder newBuilder()
Returns
TypeDescription
AllocationPolicy.Builder

newBuilder(AllocationPolicy prototype)

public static AllocationPolicy.Builder newBuilder(AllocationPolicy prototype)
Parameter
NameDescription
prototypeAllocationPolicy
Returns
TypeDescription
AllocationPolicy.Builder

parseDelimitedFrom(InputStream input)

public static AllocationPolicy parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
AllocationPolicy
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AllocationPolicy
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static AllocationPolicy parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
AllocationPolicy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AllocationPolicy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static AllocationPolicy parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
AllocationPolicy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AllocationPolicy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static AllocationPolicy parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
AllocationPolicy
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AllocationPolicy
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static AllocationPolicy parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
AllocationPolicy
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AllocationPolicy
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static AllocationPolicy parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
AllocationPolicy
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static AllocationPolicy parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
AllocationPolicy
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<AllocationPolicy> parser()
Returns
TypeDescription
Parser<AllocationPolicy>

Methods

containsLabels(String key)

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 apply. Label names that start with "goog-" or "google-" are reserved.

map<string, string> labels = 6;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public AllocationPolicy getDefaultInstanceForType()
Returns
TypeDescription
AllocationPolicy

getInstances(int index)

public AllocationPolicy.InstancePolicyOrTemplate getInstances(int index)

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Parameter
NameDescription
indexint
Returns
TypeDescription
AllocationPolicy.InstancePolicyOrTemplate

getInstancesCount()

public int getInstancesCount()

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Returns
TypeDescription
int

getInstancesList()

public List<AllocationPolicy.InstancePolicyOrTemplate> getInstancesList()

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Returns
TypeDescription
List<InstancePolicyOrTemplate>

getInstancesOrBuilder(int index)

public AllocationPolicy.InstancePolicyOrTemplateOrBuilder getInstancesOrBuilder(int index)

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Parameter
NameDescription
indexint
Returns
TypeDescription
AllocationPolicy.InstancePolicyOrTemplateOrBuilder

getInstancesOrBuilderList()

public List<? extends AllocationPolicy.InstancePolicyOrTemplateOrBuilder> getInstancesOrBuilderList()

Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

repeated .google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplate instances = 8;

Returns
TypeDescription
List<? extends com.google.cloud.batch.v1.AllocationPolicy.InstancePolicyOrTemplateOrBuilder>

getLabels() (deprecated)

public Map<String,String> getLabels()

Use #getLabelsMap() instead.

Returns
TypeDescription
Map<String,String>

getLabelsCount()

public int getLabelsCount()

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 apply. Label names that start with "goog-" or "google-" are reserved.

map<string, string> labels = 6;

Returns
TypeDescription
int

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 apply. Label names that start with "goog-" or "google-" are reserved.

map<string, string> labels = 6;

Returns
TypeDescription
Map<String,String>

getLabelsOrDefault(String key, String defaultValue)

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 apply. Label names that start with "goog-" or "google-" are reserved.

map<string, string> labels = 6;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getLabelsOrThrow(String key)

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 apply. Label names that start with "goog-" or "google-" are reserved.

map<string, string> labels = 6;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getLocation()

public AllocationPolicy.LocationPolicy getLocation()

Location where compute resources should be allocated for the Job.

.google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;

Returns
TypeDescription
AllocationPolicy.LocationPolicy

The location.

getLocationOrBuilder()

public AllocationPolicy.LocationPolicyOrBuilder getLocationOrBuilder()

Location where compute resources should be allocated for the Job.

.google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;

Returns
TypeDescription
AllocationPolicy.LocationPolicyOrBuilder

getNetwork()

public AllocationPolicy.NetworkPolicy getNetwork()

The network policy.

If you define an instance template in the InstancePolicyOrTemplate field, Batch will use the network settings in the instance template instead of this field.

.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;

Returns
TypeDescription
AllocationPolicy.NetworkPolicy

The network.

getNetworkOrBuilder()

public AllocationPolicy.NetworkPolicyOrBuilder getNetworkOrBuilder()

The network policy.

If you define an instance template in the InstancePolicyOrTemplate field, Batch will use the network settings in the instance template instead of this field.

.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;

Returns
TypeDescription
AllocationPolicy.NetworkPolicyOrBuilder

getParserForType()

public Parser<AllocationPolicy> getParserForType()
Returns
TypeDescription
Parser<AllocationPolicy>
Overrides

getPlacement()

public AllocationPolicy.PlacementPolicy getPlacement()

The placement policy.

.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;

Returns
TypeDescription
AllocationPolicy.PlacementPolicy

The placement.

getPlacementOrBuilder()

public AllocationPolicy.PlacementPolicyOrBuilder getPlacementOrBuilder()

The placement policy.

.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;

Returns
TypeDescription
AllocationPolicy.PlacementPolicyOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getServiceAccount()

public ServiceAccount getServiceAccount()

Service account that VMs will run as.

.google.cloud.batch.v1.ServiceAccount service_account = 9;

Returns
TypeDescription
ServiceAccount

The serviceAccount.

getServiceAccountOrBuilder()

public ServiceAccountOrBuilder getServiceAccountOrBuilder()

Service account that VMs will run as.

.google.cloud.batch.v1.ServiceAccount service_account = 9;

Returns
TypeDescription
ServiceAccountOrBuilder

getTags(int index)

public String getTags(int index)

Optional. Tags applied to the VM instances.

The tags identify valid sources or targets for network firewalls. Each tag must be 1-63 characters long, and comply with RFC1035.

repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The tags at the given index.

getTagsBytes(int index)

public ByteString getTagsBytes(int index)

Optional. Tags applied to the VM instances.

The tags identify valid sources or targets for network firewalls. Each tag must be 1-63 characters long, and comply with RFC1035.

repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the tags at the given index.

getTagsCount()

public int getTagsCount()

Optional. Tags applied to the VM instances.

The tags identify valid sources or targets for network firewalls. Each tag must be 1-63 characters long, and comply with RFC1035.

repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
int

The count of tags.

getTagsList()

public ProtocolStringList getTagsList()

Optional. Tags applied to the VM instances.

The tags identify valid sources or targets for network firewalls. Each tag must be 1-63 characters long, and comply with RFC1035.

repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL];

Returns
TypeDescription
ProtocolStringList

A list containing the tags.

hasLocation()

public boolean hasLocation()

Location where compute resources should be allocated for the Job.

.google.cloud.batch.v1.AllocationPolicy.LocationPolicy location = 1;

Returns
TypeDescription
boolean

Whether the location field is set.

hasNetwork()

public boolean hasNetwork()

The network policy.

If you define an instance template in the InstancePolicyOrTemplate field, Batch will use the network settings in the instance template instead of this field.

.google.cloud.batch.v1.AllocationPolicy.NetworkPolicy network = 7;

Returns
TypeDescription
boolean

Whether the network field is set.

hasPlacement()

public boolean hasPlacement()

The placement policy.

.google.cloud.batch.v1.AllocationPolicy.PlacementPolicy placement = 10;

Returns
TypeDescription
boolean

Whether the placement field is set.

hasServiceAccount()

public boolean hasServiceAccount()

Service account that VMs will run as.

.google.cloud.batch.v1.ServiceAccount service_account = 9;

Returns
TypeDescription
boolean

Whether the serviceAccount field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public AllocationPolicy.Builder newBuilderForType()
Returns
TypeDescription
AllocationPolicy.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected AllocationPolicy.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
AllocationPolicy.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public AllocationPolicy.Builder toBuilder()
Returns
TypeDescription
AllocationPolicy.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException