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
|
javax.ws.rs.core.Response |
createNewReservation(javax.servlet.http.HttpServletRequest hsr)
Generates a new ReservationId which is then sent to the client.
|
javax.ws.rs.core.Response |
deleteReservation(ReservationDeleteRequestInfo resContext,
javax.servlet.http.HttpServletRequest hsr)
Function to delete a Reservation to the RM.
|
String |
dumpSchedulerLogs(String time,
javax.servlet.http.HttpServletRequest hsr) |
ClusterInfo |
get() |
AppInfo |
getApp(javax.servlet.http.HttpServletRequest hsr,
String appId) |
AppAttemptsInfo |
getAppAttempts(javax.servlet.http.HttpServletRequest hsr,
String appId) |
AppPriority |
getAppPriority(javax.servlet.http.HttpServletRequest hsr,
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) |
LabelsToNodesInfo |
getLabelsToNodes(Set<String> labels) |
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,
String diagnostic) |
javax.ws.rs.core.Response |
listReservation(String queue,
String reservationId,
long startTime,
long endTime,
boolean includeResourceAllocations,
javax.servlet.http.HttpServletRequest hsr)
Function to retrieve a list of all the reservations.
|
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(Set<String> oldNodeLabels,
javax.servlet.http.HttpServletRequest hsr) |
javax.ws.rs.core.Response |
replaceLabelsOnNode(Set<String> newNodeLabelsName,
javax.servlet.http.HttpServletRequest hsr,
String nodeId) |
javax.ws.rs.core.Response |
replaceLabelsOnNodes(NodeToLabelsEntryList 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 |
submitReservation(ReservationSubmissionRequestInfo resContext,
javax.servlet.http.HttpServletRequest hsr)
Function to submit a Reservation to the RM.
|
javax.ws.rs.core.Response |
updateApplicationPriority(AppPriority targetPriority,
javax.servlet.http.HttpServletRequest hsr,
String appId) |
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) |
javax.ws.rs.core.Response |
updateReservation(ReservationUpdateRequestInfo resContext,
javax.servlet.http.HttpServletRequest hsr)
Function to update a Reservation to the RM.
|
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 String dumpSchedulerLogs(String time, @Context javax.servlet.http.HttpServletRequest hsr) throws IOException
IOExceptionpublic 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(@Context javax.servlet.http.HttpServletRequest hsr, 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.AuthorizationExceptionpublic 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.AuthorizationExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionInterruptedExceptionIOExceptionpublic NodeToLabelsInfo getNodeToLabels(@Context javax.servlet.http.HttpServletRequest hsr) throws IOException
IOExceptionpublic LabelsToNodesInfo getLabelsToNodes(Set<String> labels) throws IOException
IOExceptionpublic javax.ws.rs.core.Response replaceLabelsOnNodes(NodeToLabelsEntryList newNodeToLabels, @Context javax.servlet.http.HttpServletRequest hsr) throws IOException
IOExceptionpublic javax.ws.rs.core.Response replaceLabelsOnNode(Set<String> newNodeLabelsName, @Context javax.servlet.http.HttpServletRequest hsr, String nodeId) throws Exception
Exceptionpublic NodeLabelsInfo getClusterNodeLabels(@Context javax.servlet.http.HttpServletRequest hsr) throws IOException
IOExceptionpublic javax.ws.rs.core.Response addToClusterNodeLabels(NodeLabelsInfo newNodeLabels, @Context javax.servlet.http.HttpServletRequest hsr) throws Exception
Exceptionpublic javax.ws.rs.core.Response removeFromCluserNodeLabels(Set<String> oldNodeLabels, @Context javax.servlet.http.HttpServletRequest hsr) throws Exception
Exceptionpublic NodeLabelsInfo getLabelsOnNode(@Context javax.servlet.http.HttpServletRequest hsr, String nodeId) throws IOException
IOExceptionprotected javax.ws.rs.core.Response killApp(RMApp app, org.apache.hadoop.security.UserGroupInformation callerUGI, javax.servlet.http.HttpServletRequest hsr, String diagnostic) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic AppPriority getAppPriority(@Context javax.servlet.http.HttpServletRequest hsr, String appId) throws org.apache.hadoop.security.authorize.AuthorizationException
org.apache.hadoop.security.authorize.AuthorizationExceptionpublic javax.ws.rs.core.Response updateApplicationPriority(AppPriority targetPriority, @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.AuthorizationExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionInterruptedExceptionIOExceptionpublic AppQueue getAppQueue(@Context javax.servlet.http.HttpServletRequest hsr, String appId) throws org.apache.hadoop.security.authorize.AuthorizationException
org.apache.hadoop.security.authorize.AuthorizationExceptionpublic 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.AuthorizationExceptionorg.apache.hadoop.yarn.exceptions.YarnExceptionInterruptedExceptionIOExceptionprotected javax.ws.rs.core.Response moveApp(RMApp app, org.apache.hadoop.security.UserGroupInformation callerUGI, String targetQueue) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic 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.AuthorizationExceptionIOExceptionInterruptedExceptionpublic 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.AuthorizationExceptionIOExceptionInterruptedExceptionprotected org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext createAppSubmissionContext(ApplicationSubmissionContextInfo newApp) throws IOException
newApp - the information provided by the userIOExceptionprotected org.apache.hadoop.yarn.api.records.Resource createAppSubmissionContextResource(ApplicationSubmissionContextInfo newApp) throws org.apache.hadoop.yarn.webapp.BadRequestException
org.apache.hadoop.yarn.webapp.BadRequestExceptionprotected 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.BadRequestExceptionIOExceptionpublic 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.AuthorizationExceptionIOExceptionInterruptedExceptionExceptionpublic 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.AuthorizationExceptionIOExceptionInterruptedExceptionExceptionpublic 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.AuthorizationExceptionIOExceptionInterruptedExceptionExceptionpublic javax.ws.rs.core.Response createNewReservation(@Context
javax.servlet.http.HttpServletRequest hsr)
throws org.apache.hadoop.security.authorize.AuthorizationException,
IOException,
InterruptedException
hsr - the servlet requestorg.apache.hadoop.security.authorize.AuthorizationException - if the user is not authorized
to invoke this method.IOException - if creation fails.InterruptedException - if interrupted.public javax.ws.rs.core.Response submitReservation(ReservationSubmissionRequestInfo resContext, @Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException
resContext - provides information to construct the
ReservationSubmissionRequesthsr - the servlet requestorg.apache.hadoop.security.authorize.AuthorizationExceptionIOExceptionInterruptedExceptionpublic javax.ws.rs.core.Response updateReservation(ReservationUpdateRequestInfo resContext, @Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException
resContext - provides information to construct the
ReservationUpdateRequesthsr - the servlet requestorg.apache.hadoop.security.authorize.AuthorizationExceptionIOExceptionInterruptedExceptionpublic javax.ws.rs.core.Response deleteReservation(ReservationDeleteRequestInfo resContext, @Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException
resContext - provides information to construct
the ReservationDeleteRequesthsr - the servlet requestorg.apache.hadoop.security.authorize.AuthorizationException - when the user group information cannot be
retrieved.IOException - when a ReservationDeleteRequest cannot be
created from the ReservationDeleteRequestInfo. This
exception is also thrown on
ClientRMService.deleteReservation invokation failure.InterruptedException - if doAs action throws an InterruptedException.public javax.ws.rs.core.Response listReservation(String queue, String reservationId, long startTime, long endTime, boolean includeResourceAllocations, @Context javax.servlet.http.HttpServletRequest hsr) throws Exception
ExceptionCopyright © 2017 Apache Software Foundation. All Rights Reserved.