Class YarnWebServiceUtils

java.lang.Object
org.apache.hadoop.yarn.webapp.util.YarnWebServiceUtils

public final class YarnWebServiceUtils extends Object
This class contains several utility function which could be used to generate Restful calls to RM/NM/AHS.
  • Method Details

    • getNodeInfoFromRMWebService

      public static org.codehaus.jettison.json.JSONObject getNodeInfoFromRMWebService(org.apache.hadoop.conf.Configuration conf, String nodeId) throws javax.ws.rs.ProcessingException, IllegalStateException
      Utility function to get NodeInfo by calling RM WebService.
      Parameters:
      conf - the configuration
      nodeId - the node
      Returns:
      a JSONObject which contains the NodeInfo
      Throws:
      javax.ws.rs.ProcessingException
      IllegalStateException
    • toJson

      public static String toJson(Object obj, Class<?> klass) throws Exception
      Throws:
      Exception