org.apache.hadoop.yarn.client.api
Class NMTokenCache

java.lang.Object
  extended by org.apache.hadoop.yarn.client.api.NMTokenCache

@InterfaceAudience.Public
@InterfaceStability.Evolving
public class NMTokenCache
extends Object

It manages NMTokens required for communicating with Node manager. Its a static token cache.


Constructor Summary
NMTokenCache()
           
 
Method Summary
static void clearCache()
          It will remove all the nm tokens from its cache
static boolean containsNMToken(String nodeAddr)
          Returns true if NMToken is present in cache.
static org.apache.hadoop.yarn.api.records.Token getNMToken(String nodeAddr)
          Returns NMToken, null if absent
static int numberOfNMTokensInCache()
          Returns the number of NMTokens present in cache.
static void removeNMToken(String nodeAddr)
          Removes NMToken for specified node manager
static void setNMToken(String nodeAddr, org.apache.hadoop.yarn.api.records.Token token)
          Sets the NMToken for node address
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NMTokenCache

public NMTokenCache()
Method Detail

getNMToken

@InterfaceAudience.Public
@InterfaceStability.Evolving
public static org.apache.hadoop.yarn.api.records.Token getNMToken(String nodeAddr)
Returns NMToken, null if absent

Parameters:
nodeAddr -
Returns:
Token NMToken required for communicating with node manager

setNMToken

@InterfaceAudience.Public
@InterfaceStability.Evolving
public static void setNMToken(String nodeAddr,
                                                                                   org.apache.hadoop.yarn.api.records.Token token)
Sets the NMToken for node address

Parameters:
nodeAddr - node address (host:port)
token - NMToken

containsNMToken

@InterfaceAudience.Private
public static boolean containsNMToken(String nodeAddr)
Returns true if NMToken is present in cache.


numberOfNMTokensInCache

@InterfaceAudience.Private
public static int numberOfNMTokensInCache()
Returns the number of NMTokens present in cache.


removeNMToken

@InterfaceAudience.Private
public static void removeNMToken(String nodeAddr)
Removes NMToken for specified node manager

Parameters:
nodeAddr - node address (host:port)

clearCache

@InterfaceAudience.Private
public static void clearCache()
It will remove all the nm tokens from its cache



Copyright © 2013 Apache Software Foundation. All Rights Reserved.