org.apache.hadoop.yarn.server.resourcemanager.webapp
Class RMWebServices

java.lang.Object
  extended by org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebServices

public class RMWebServices
extends Object


Field Summary
static String DELEGATION_TOKEN_HEADER
           
 
Constructor Summary
RMWebServices(ResourceManager rm, org.apache.hadoop.conf.Configuration conf)
           
 
Method Summary
 javax.ws.rs.core.Response addToClusterNodeLabels(NodeLabelsInfo newNodeLabels, javax.servlet.http.HttpServletRequest hsr)
           
 javax.ws.rs.core.Response cancelDelegationToken(javax.servlet.http.HttpServletRequest hsr)
           
protected  org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext createAppSubmissionContext(ApplicationSubmissionContextInfo newApp)
          Create the actual ApplicationSubmissionContext to be submitted to the RM from the information provided by the user.
protected  org.apache.hadoop.yarn.api.records.Resource createAppSubmissionContextResource(ApplicationSubmissionContextInfo newApp)
           
protected  org.apache.hadoop.yarn.api.records.ContainerLaunchContext createContainerLaunchContext(ApplicationSubmissionContextInfo newApp)
          Create the ContainerLaunchContext required for the ApplicationSubmissionContext.
 javax.ws.rs.core.Response createNewApplication(javax.servlet.http.HttpServletRequest hsr)
          Generates a new ApplicationId which is then sent to the client
 ClusterInfo get()
           
 AppInfo getApp(javax.servlet.http.HttpServletRequest hsr, String appId)
           
 AppAttemptsInfo getAppAttempts(String appId)
           
 AppsInfo getApps(javax.servlet.http.HttpServletRequest hsr, String stateQuery, Set<String> statesQuery, String finalStatusQuery, String userQuery, String queueQuery, String count, String startedBegin, String startedEnd, String finishBegin, String finishEnd, Set<String> applicationTypes, Set<String> applicationTags)
           
 AppState getAppState(javax.servlet.http.HttpServletRequest hsr, String appId)
           
 ApplicationStatisticsInfo getAppStatistics(javax.servlet.http.HttpServletRequest hsr, Set<String> stateQueries, Set<String> typeQueries)
           
 ClusterInfo getClusterInfo()
           
 ClusterMetricsInfo getClusterMetricsInfo()
           
 NodeLabelsInfo getClusterNodeLabels(javax.servlet.http.HttpServletRequest hsr)
           
 NodeLabelsInfo getLabelsOnNode(javax.servlet.http.HttpServletRequest hsr, String nodeId)
           
 NodeInfo getNode(String nodeId)
           
 NodesInfo getNodes(String states)
          Returns all nodes in the cluster.
 NodeToLabelsInfo getNodeToLabels(javax.servlet.http.HttpServletRequest hsr)
           
 SchedulerTypeInfo getSchedulerInfo()
           
protected  Boolean hasAccess(RMApp app, javax.servlet.http.HttpServletRequest hsr)
           
protected  javax.ws.rs.core.Response killApp(RMApp app, org.apache.hadoop.security.UserGroupInformation callerUGI, javax.servlet.http.HttpServletRequest hsr)
           
 javax.ws.rs.core.Response postDelegationToken(DelegationToken tokenData, javax.servlet.http.HttpServletRequest hsr)
           
 javax.ws.rs.core.Response postDelegationTokenExpiration(javax.servlet.http.HttpServletRequest hsr)
           
 javax.ws.rs.core.Response removeFromCluserNodeLabels(NodeLabelsInfo oldNodeLabels, javax.servlet.http.HttpServletRequest hsr)
           
 javax.ws.rs.core.Response replaceLabelsOnNode(NodeLabelsInfo newNodeLabelsInfo, javax.servlet.http.HttpServletRequest hsr, String nodeId)
           
 javax.ws.rs.core.Response replaceLabelsOnNodes(NodeToLabelsInfo newNodeToLabels, javax.servlet.http.HttpServletRequest hsr)
           
 javax.ws.rs.core.Response submitApplication(ApplicationSubmissionContextInfo newApp, javax.servlet.http.HttpServletRequest hsr)
          Function to submit an app to the RM
 javax.ws.rs.core.Response updateAppState(AppState targetState, javax.servlet.http.HttpServletRequest hsr, String appId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELEGATION_TOKEN_HEADER

public static final String DELEGATION_TOKEN_HEADER
See Also:
Constant Field Values
Constructor Detail

RMWebServices

@Inject
public RMWebServices(ResourceManager rm,
                            org.apache.hadoop.conf.Configuration conf)
Method Detail

hasAccess

protected Boolean hasAccess(RMApp app,
                            javax.servlet.http.HttpServletRequest hsr)

get

public ClusterInfo get()

getClusterInfo

public ClusterInfo getClusterInfo()

getClusterMetricsInfo

public ClusterMetricsInfo getClusterMetricsInfo()

getSchedulerInfo

public SchedulerTypeInfo getSchedulerInfo()

getNodes

public NodesInfo getNodes(String states)
Returns all nodes in the cluster. If the states param is given, returns all nodes that are in the comma-separated list of states.


getNode

public NodeInfo getNode(String nodeId)

getApps

public AppsInfo getApps(@Context
                        javax.servlet.http.HttpServletRequest hsr,
                        String stateQuery,
                        Set<String> statesQuery,
                        String finalStatusQuery,
                        String userQuery,
                        String queueQuery,
                        String count,
                        String startedBegin,
                        String startedEnd,
                        String finishBegin,
                        String finishEnd,
                        Set<String> applicationTypes,
                        Set<String> applicationTags)

getAppStatistics

public ApplicationStatisticsInfo getAppStatistics(@Context
                                                  javax.servlet.http.HttpServletRequest hsr,
                                                  Set<String> stateQueries,
                                                  Set<String> typeQueries)

getApp

public AppInfo getApp(@Context
                      javax.servlet.http.HttpServletRequest hsr,
                      String appId)

getAppAttempts

public AppAttemptsInfo getAppAttempts(String appId)

getAppState

public AppState getAppState(@Context
                            javax.servlet.http.HttpServletRequest hsr,
                            String appId)
                     throws org.apache.hadoop.security.authorize.AuthorizationException
Throws:
org.apache.hadoop.security.authorize.AuthorizationException

updateAppState

public javax.ws.rs.core.Response updateAppState(AppState targetState,
                                                @Context
                                                javax.servlet.http.HttpServletRequest hsr,
                                                String appId)
                                         throws org.apache.hadoop.security.authorize.AuthorizationException,
                                                org.apache.hadoop.yarn.exceptions.YarnException,
                                                InterruptedException,
                                                IOException
Throws:
org.apache.hadoop.security.authorize.AuthorizationException
org.apache.hadoop.yarn.exceptions.YarnException
InterruptedException
IOException

getNodeToLabels

public NodeToLabelsInfo getNodeToLabels(@Context
                                        javax.servlet.http.HttpServletRequest hsr)
                                 throws IOException
Throws:
IOException

replaceLabelsOnNodes

public javax.ws.rs.core.Response replaceLabelsOnNodes(NodeToLabelsInfo newNodeToLabels,
                                                      @Context
                                                      javax.servlet.http.HttpServletRequest hsr)
                                               throws IOException
Throws:
IOException

getClusterNodeLabels

public NodeLabelsInfo getClusterNodeLabels(@Context
                                           javax.servlet.http.HttpServletRequest hsr)
                                    throws IOException
Throws:
IOException

addToClusterNodeLabels

public javax.ws.rs.core.Response addToClusterNodeLabels(NodeLabelsInfo newNodeLabels,
                                                        @Context
                                                        javax.servlet.http.HttpServletRequest hsr)
                                                 throws Exception
Throws:
Exception

removeFromCluserNodeLabels

public javax.ws.rs.core.Response removeFromCluserNodeLabels(NodeLabelsInfo oldNodeLabels,
                                                            @Context
                                                            javax.servlet.http.HttpServletRequest hsr)
                                                     throws Exception
Throws:
Exception

getLabelsOnNode

public NodeLabelsInfo getLabelsOnNode(@Context
                                      javax.servlet.http.HttpServletRequest hsr,
                                      String nodeId)
                               throws IOException
Throws:
IOException

replaceLabelsOnNode

public javax.ws.rs.core.Response replaceLabelsOnNode(NodeLabelsInfo newNodeLabelsInfo,
                                                     @Context
                                                     javax.servlet.http.HttpServletRequest hsr,
                                                     String nodeId)
                                              throws Exception
Throws:
Exception

killApp

protected javax.ws.rs.core.Response killApp(RMApp app,
                                            org.apache.hadoop.security.UserGroupInformation callerUGI,
                                            javax.servlet.http.HttpServletRequest hsr)
                                     throws IOException,
                                            InterruptedException
Throws:
IOException
InterruptedException

createNewApplication

public javax.ws.rs.core.Response createNewApplication(@Context
                                                      javax.servlet.http.HttpServletRequest hsr)
                                               throws org.apache.hadoop.security.authorize.AuthorizationException,
                                                      IOException,
                                                      InterruptedException
Generates a new ApplicationId which is then sent to the client

Parameters:
hsr - the servlet request
Returns:
Response containing the app id and the maximum resource capabilities
Throws:
org.apache.hadoop.security.authorize.AuthorizationException
IOException
InterruptedException

submitApplication

public javax.ws.rs.core.Response submitApplication(ApplicationSubmissionContextInfo newApp,
                                                   @Context
                                                   javax.servlet.http.HttpServletRequest hsr)
                                            throws org.apache.hadoop.security.authorize.AuthorizationException,
                                                   IOException,
                                                   InterruptedException
Function to submit an app to the RM

Parameters:
newApp - structure containing information to construct the ApplicationSubmissionContext
hsr - the servlet request
Returns:
Response containing the status code
Throws:
org.apache.hadoop.security.authorize.AuthorizationException
IOException
InterruptedException

createAppSubmissionContext

protected org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext createAppSubmissionContext(ApplicationSubmissionContextInfo newApp)
                                                                                              throws IOException
Create the actual ApplicationSubmissionContext to be submitted to the RM from the information provided by the user.

Parameters:
newApp - the information provided by the user
Returns:
returns the constructed ApplicationSubmissionContext
Throws:
IOException

createAppSubmissionContextResource

protected org.apache.hadoop.yarn.api.records.Resource createAppSubmissionContextResource(ApplicationSubmissionContextInfo newApp)
                                                                                  throws org.apache.hadoop.yarn.webapp.BadRequestException
Throws:
org.apache.hadoop.yarn.webapp.BadRequestException

createContainerLaunchContext

protected org.apache.hadoop.yarn.api.records.ContainerLaunchContext createContainerLaunchContext(ApplicationSubmissionContextInfo newApp)
                                                                                          throws org.apache.hadoop.yarn.webapp.BadRequestException,
                                                                                                 IOException
Create the ContainerLaunchContext required for the ApplicationSubmissionContext. This function takes the user information and generates the ByteBuffer structures required by the ContainerLaunchContext

Parameters:
newApp - the information provided by the user
Returns:
created context
Throws:
org.apache.hadoop.yarn.webapp.BadRequestException
IOException

postDelegationToken

public javax.ws.rs.core.Response postDelegationToken(DelegationToken tokenData,
                                                     @Context
                                                     javax.servlet.http.HttpServletRequest hsr)
                                              throws org.apache.hadoop.security.authorize.AuthorizationException,
                                                     IOException,
                                                     InterruptedException,
                                                     Exception
Throws:
org.apache.hadoop.security.authorize.AuthorizationException
IOException
InterruptedException
Exception

postDelegationTokenExpiration

public javax.ws.rs.core.Response postDelegationTokenExpiration(@Context
                                                               javax.servlet.http.HttpServletRequest hsr)
                                                        throws org.apache.hadoop.security.authorize.AuthorizationException,
                                                               IOException,
                                                               InterruptedException,
                                                               Exception
Throws:
org.apache.hadoop.security.authorize.AuthorizationException
IOException
InterruptedException
Exception

cancelDelegationToken

public javax.ws.rs.core.Response cancelDelegationToken(@Context
                                                       javax.servlet.http.HttpServletRequest hsr)
                                                throws org.apache.hadoop.security.authorize.AuthorizationException,
                                                       IOException,
                                                       InterruptedException,
                                                       Exception
Throws:
org.apache.hadoop.security.authorize.AuthorizationException
IOException
InterruptedException
Exception


Copyright © 2014 Apache Software Foundation. All Rights Reserved.