public class RMWebServices extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DELEGATION_TOKEN_HEADER |
Constructor and Description |
---|
RMWebServices(ResourceManager rm,
org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
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) |
AppQueue |
getAppQueue(javax.servlet.http.HttpServletRequest hsr,
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) |
protected javax.ws.rs.core.Response |
moveApp(RMApp app,
org.apache.hadoop.security.UserGroupInformation callerUGI,
String targetQueue) |
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 |
updateAppQueue(AppQueue targetQueue,
javax.servlet.http.HttpServletRequest hsr,
String appId) |
javax.ws.rs.core.Response |
updateAppState(AppState targetState,
javax.servlet.http.HttpServletRequest hsr,
String appId) |
public static final String DELEGATION_TOKEN_HEADER
@Inject public RMWebServices(ResourceManager rm, org.apache.hadoop.conf.Configuration conf)
public ClusterInfo get()
public ClusterInfo getClusterInfo()
public ClusterMetricsInfo getClusterMetricsInfo()
public SchedulerTypeInfo getSchedulerInfo()
public NodesInfo getNodes(String states)
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)
public ApplicationStatisticsInfo getAppStatistics(@Context javax.servlet.http.HttpServletRequest hsr, Set<String> stateQueries, Set<String> typeQueries)
public AppAttemptsInfo getAppAttempts(String appId)
public AppState getAppState(@Context javax.servlet.http.HttpServletRequest hsr, String appId) throws org.apache.hadoop.security.authorize.AuthorizationException
org.apache.hadoop.security.authorize.AuthorizationException
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
org.apache.hadoop.security.authorize.AuthorizationException
org.apache.hadoop.yarn.exceptions.YarnException
InterruptedException
IOException
public NodeToLabelsInfo getNodeToLabels(@Context javax.servlet.http.HttpServletRequest hsr) throws IOException
IOException
public javax.ws.rs.core.Response replaceLabelsOnNodes(NodeToLabelsInfo newNodeToLabels, @Context javax.servlet.http.HttpServletRequest hsr) throws IOException
IOException
public NodeLabelsInfo getClusterNodeLabels(@Context javax.servlet.http.HttpServletRequest hsr) throws IOException
IOException
public javax.ws.rs.core.Response addToClusterNodeLabels(NodeLabelsInfo newNodeLabels, @Context javax.servlet.http.HttpServletRequest hsr) throws Exception
Exception
public javax.ws.rs.core.Response removeFromCluserNodeLabels(NodeLabelsInfo oldNodeLabels, @Context javax.servlet.http.HttpServletRequest hsr) throws Exception
Exception
public NodeLabelsInfo getLabelsOnNode(@Context javax.servlet.http.HttpServletRequest hsr, String nodeId) throws IOException
IOException
public javax.ws.rs.core.Response replaceLabelsOnNode(NodeLabelsInfo newNodeLabelsInfo, @Context javax.servlet.http.HttpServletRequest hsr, String nodeId) throws Exception
Exception
protected javax.ws.rs.core.Response killApp(RMApp app, org.apache.hadoop.security.UserGroupInformation callerUGI, javax.servlet.http.HttpServletRequest hsr) throws IOException, InterruptedException
IOException
InterruptedException
public AppQueue getAppQueue(@Context javax.servlet.http.HttpServletRequest hsr, String appId) throws org.apache.hadoop.security.authorize.AuthorizationException
org.apache.hadoop.security.authorize.AuthorizationException
public javax.ws.rs.core.Response updateAppQueue(AppQueue targetQueue, @Context javax.servlet.http.HttpServletRequest hsr, String appId) throws org.apache.hadoop.security.authorize.AuthorizationException, org.apache.hadoop.yarn.exceptions.YarnException, InterruptedException, IOException
org.apache.hadoop.security.authorize.AuthorizationException
org.apache.hadoop.yarn.exceptions.YarnException
InterruptedException
IOException
protected javax.ws.rs.core.Response moveApp(RMApp app, org.apache.hadoop.security.UserGroupInformation callerUGI, String targetQueue) throws IOException, InterruptedException
IOException
InterruptedException
public javax.ws.rs.core.Response createNewApplication(@Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException
hsr
- the servlet requestorg.apache.hadoop.security.authorize.AuthorizationException
IOException
InterruptedException
public javax.ws.rs.core.Response submitApplication(ApplicationSubmissionContextInfo newApp, @Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException
newApp
- structure containing information to construct the
ApplicationSubmissionContexthsr
- the servlet requestorg.apache.hadoop.security.authorize.AuthorizationException
IOException
InterruptedException
protected org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext createAppSubmissionContext(ApplicationSubmissionContextInfo newApp) throws IOException
newApp
- the information provided by the userIOException
protected org.apache.hadoop.yarn.api.records.Resource createAppSubmissionContextResource(ApplicationSubmissionContextInfo newApp) throws org.apache.hadoop.yarn.webapp.BadRequestException
org.apache.hadoop.yarn.webapp.BadRequestException
protected org.apache.hadoop.yarn.api.records.ContainerLaunchContext createContainerLaunchContext(ApplicationSubmissionContextInfo newApp) throws org.apache.hadoop.yarn.webapp.BadRequestException, IOException
newApp
- the information provided by the userorg.apache.hadoop.yarn.webapp.BadRequestException
IOException
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
org.apache.hadoop.security.authorize.AuthorizationException
IOException
InterruptedException
Exception
public javax.ws.rs.core.Response postDelegationTokenExpiration(@Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException, Exception
org.apache.hadoop.security.authorize.AuthorizationException
IOException
InterruptedException
Exception
public javax.ws.rs.core.Response cancelDelegationToken(@Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException, Exception
org.apache.hadoop.security.authorize.AuthorizationException
IOException
InterruptedException
Exception
Copyright © 2015 Apache Software Foundation. All Rights Reserved.