Class NodeId

java.lang.Object
org.apache.hadoop.yarn.api.records.NodeId
All Implemented Interfaces:
Comparable<NodeId>

@Public @Stable public abstract class NodeId extends Object implements Comparable<NodeId>

NodeId is the unique identifier for a node.

It includes the hostname and port to uniquely identify the node. Thus, it is unique across restarts of any NodeManager.

  • Constructor Details

    • NodeId

      public NodeId()
  • Method Details

    • newInstance

      @Public @Stable public static NodeId newInstance(String host, int port)
    • getHost

      @Public @Stable public abstract String getHost()
      Get the hostname of the node.
      Returns:
      hostname of the node
    • setHost

      @Private @Unstable protected abstract void setHost(String host)
    • getPort

      @Public @Stable public abstract int getPort()
      Get the port for communicating with the node.
      Returns:
      port for communicating with the node
    • setPort

      @Private @Unstable protected abstract void setPort(int port)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(NodeId other)
      Specified by:
      compareTo in interface Comparable<NodeId>
    • fromString

      @Public @Stable public static NodeId fromString(String nodeIdStr)
    • build

      protected abstract void build()