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
    Constructor
    Description
    AffinityInfo(String affinityId)
    Creates an instance of AffinityInfo class.
  • Method Summary

    Modifier and Type
    Method
    Description
    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

      public AffinityInfo(String affinityId)
      Creates an instance of AffinityInfo class.
      Parameters:
      affinityId - the affinityId value to set.
  • Method Details

    • 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 com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<AffinityInfo>
      Throws:
      IOException
    • fromJson

      public static AffinityInfo fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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.