Share via


BatchAffinityInfo Class

  • java.lang.Object
    • com.azure.compute.batch.models.BatchAffinityInfo

Implements

public final class BatchAffinityInfo
implements JsonSerializable<BatchAffinityInfo>

A locality hint that can be used by the Batch service to select a Compute Node on which to start a Task.

Constructor Summary

Constructor Description
BatchAffinityInfo(String affinityId)

Creates an instance of BatchAffinityInfo class.

Method Summary

Modifier and Type Method and Description
static BatchAffinityInfo fromJson(JsonReader jsonReader)

Reads an instance of BatchAffinityInfo from the JsonReader.

String getAffinityId()

Get the affinityId property: An opaque string representing the location of a Compute Node or a Task that has run previously.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

BatchAffinityInfo

public BatchAffinityInfo(String affinityId)

Creates an instance of BatchAffinityInfo class.

Parameters:

affinityId - the affinityId value to set.

Method Details

fromJson

public static BatchAffinityInfo fromJson(JsonReader jsonReader)

Reads an instance of BatchAffinityInfo from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of BatchAffinityInfo if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getAffinityId

public String getAffinityId()

Get the affinityId property: An opaque string representing the location of a Compute Node or a Task that has run previously. You can pass the affinityId of a Node to indicate that this Task needs to run on that Compute Node. Note that this is just a soft affinity. If the target Compute Node is busy or unavailable at the time the Task is scheduled, then the Task will be scheduled elsewhere.

Returns:

the affinityId value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to