NMToken (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.yarn.api.records, class: NMToken

Package org.apache.hadoop.yarn.api.records

# Class NMToken

java.lang.Object
org.apache.hadoop.yarn.api.records.NMToken

@Public @Stable public abstract class NMToken extends Object

The NMToken is used for authenticating communication with `NodeManager`

It is issued by `ResourceMananger` when `ApplicationMaster` negotiates resource with `ResourceManager` and validated on `NodeManager` side.

See Also:
  - `AllocateResponse.getNMTokens()`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NMToken()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `abstract NodeId`
  `getNodeId()`
  Get the `NodeId` of the `NodeManager` for which the NMToken is used to authenticate.
  `abstract Token`
  `getToken()`
  Get the `Token` used for authenticating with `NodeManager`
  `int`
  `hashCode()`
  `static NMToken`
  `newInstance(NodeId nodeId, Token token)`
  `abstract void`
  `setNodeId(NodeId nodeId)`
  `abstract void`
  `setToken(Token token)`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### NMToken

    public NMToken()

- ## Method Details

  - ### newInstance

    @Private @Unstable public static NMToken newInstance(NodeId nodeId, Token token)

  - ### getNodeId

    @Public @Stable public abstract NodeId getNodeId()
    Get the `NodeId` of the `NodeManager` for which the NMToken is used to authenticate.
    Returns:
      the `NodeId` of the `NodeManager` for which the NMToken is used to authenticate.

  - ### setNodeId

    @Public @Stable public abstract void setNodeId(NodeId nodeId)

  - ### getToken

    @Public @Stable public abstract Token getToken()
    Get the `Token` used for authenticating with `NodeManager`
    Returns:
      the `Token` used for authenticating with `NodeManager`

  - ### setToken

    @Public @Stable public abstract void setToken(Token token)

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`