Package com.azure.compute.batch.models
Class AffinityInfo
java.lang.Object
com.azure.compute.batch.models.AffinityInfo
- All Implemented Interfaces:
com.azure.json.JsonSerializable<AffinityInfo>
public final class AffinityInfo
extends Object
implements com.azure.json.JsonSerializable<AffinityInfo>
A locality hint that can be used by the Batch service to select a Compute Node
on which to start a Task.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AffinityInfo
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of AffinityInfo from the JsonReader.Get the affinityId property: An opaque string representing the location of a Compute Node or a Task that has run previously.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
AffinityInfo
Creates an instance of AffinityInfo class.- Parameters:
affinityId
- the affinityId value to set.
-
-
Method Details
-
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
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<AffinityInfo>
- Throws:
IOException
-
fromJson
Reads an instance of AffinityInfo from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of AffinityInfo if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException
- If the deserialized JSON object was missing any required properties.IOException
- If an error occurs while reading the AffinityInfo.
-