Interface RMWebServiceProtocol
- All Known Implementing Classes:
RMWebServices
@Private
@Evolving
public interface RMWebServiceProtocol
The protocol between clients and the ResourceManager to
submit/abort jobs and to get information on applications, cluster metrics,
nodes, queues, ACLs and reservations via REST calls.
RMWSConsts.RM_WEB_SERVICE_PATH-
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.ResponseaddToClusterNodeLabels(NodeLabelsInfo newNodeLabels, javax.servlet.http.HttpServletRequest hsr) This method adds specific node labels for specific nodes, and it is reachable by usingRMWSConsts.ADD_NODE_LABELS.javax.ws.rs.core.ResponsecancelDelegationToken(javax.servlet.http.HttpServletRequest hsr) This method cancel the delegation token from the client, and it is reachable by usingRMWSConsts.DELEGATION_TOKEN.checkUserAccessToQueue(String queue, String username, String queueAclType, javax.servlet.http.HttpServletRequest hsr) This method verifies if a user has access to a specified queue.javax.ws.rs.core.ResponsecreateNewApplication(javax.servlet.http.HttpServletRequest hsr) Generates a new ApplicationId which is then sent to the client.javax.ws.rs.core.ResponsecreateNewReservation(javax.servlet.http.HttpServletRequest hsr) Generates a new ReservationId which is then sent to the client.javax.ws.rs.core.ResponsedeleteReservation(ReservationDeleteRequestInfo resContext, javax.servlet.http.HttpServletRequest hsr) Function to delete a Reservation to the RM.dumpSchedulerLogs(String time, javax.servlet.http.HttpServletRequest hsr) This method dumps the scheduler logs for the time got in input, and it is reachable by usingRMWSConsts.SCHEDULER_LOGS.get()This method retrieves the cluster information, and it is reachable by usingRMWSConsts.INFO.getActivities(javax.servlet.http.HttpServletRequest hsr, String nodeId, String groupBy) This method retrieve all the activities in a specific node, and it is reachable by usingRMWSConsts.SCHEDULER_ACTIVITIES.This method retrieves the report for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID.getAppActivities(javax.servlet.http.HttpServletRequest hsr, String appId, String time, Set<String> requestPriorities, Set<String> allocationRequestIds, String groupBy, String limit, Set<String> actions, boolean summarize) This method retrieves all the activities for a specific app for a specific period of time, and it is reachable by usingRMWSConsts.SCHEDULER_APP_ACTIVITIES.getAppAttempts(javax.servlet.http.HttpServletRequest hsr, String appId) This method retrieves all the attempts information for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID_APPATTEMPTS.getAppPriority(javax.servlet.http.HttpServletRequest hsr, String appId) This method retrieves the priority for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID_PRIORITY.getAppQueue(javax.servlet.http.HttpServletRequest hsr, String appId) This method retrieves the queue for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID_QUEUE.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, String name, Set<String> unselectedFields) This method retrieves all the app reports in the cluster, and it is reachable by usingRMWSConsts.APPS.getAppState(javax.servlet.http.HttpServletRequest hsr, String appId) This method retrieves the state for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID_STATE.getAppStatistics(javax.servlet.http.HttpServletRequest hsr, Set<String> stateQueries, Set<String> typeQueries) This method retrieves all the statistics for a specific app, and it is reachable by usingRMWSConsts.APP_STATISTICS.getAppTimeout(javax.servlet.http.HttpServletRequest hsr, String appId, String type) This method retrieves the timeout information for a specific app with a specific type, and it is reachable by usingRMWSConsts.APPS_TIMEOUTS_TYPE.getAppTimeouts(javax.servlet.http.HttpServletRequest hsr, String appId) This method retrieves the timeout information for a specific app, and it is reachable by usingRMWSConsts.APPS_TIMEOUTS.getBulkActivities(javax.servlet.http.HttpServletRequest hsr, String groupBy, int activitiesCount) This method retrieve the last n activities inside scheduler, and it is reachable by usingRMWSConsts.SCHEDULER_BULK_ACTIVITIES.This method retrieves the cluster information, and it is reachable by usingRMWSConsts.INFO.This method retrieves the cluster metrics information, and it is reachable by usingRMWSConsts.METRICS.getClusterNodeLabels(javax.servlet.http.HttpServletRequest hsr) This method retrieves all the node labels in the cluster, and it is reachable by usingRMWSConsts.GET_NODE_LABELS.getClusterUserInfo(javax.servlet.http.HttpServletRequest hsr) This method retrieves the cluster user information, and it is reachable by usingRMWSConsts.CLUSTER_USER_INFO.getLabelsOnNode(javax.servlet.http.HttpServletRequest hsr, String nodeId) This method retrieves all the node labels for specific node, and it is reachable by usingRMWSConsts.NODES_NODEID_GETLABELS.getLabelsToNodes(Set<String> labels) This method retrieves all the node within multiple node labels in the cluster, and it is reachable by usingRMWSConsts.LABEL_MAPPINGS.This method retrieves a specific node information, and it is reachable by usingRMWSConsts.NODES_NODEID.This method retrieves all the nodes information in the cluster, and it is reachable by usingRMWSConsts.NODES.getNodeToLabels(javax.servlet.http.HttpServletRequest hsr) This method retrieves all the node labels with the respective nodes in the cluster, and it is reachable by usingRMWSConsts.GET_NODE_TO_LABELS.getRMNodeLabels(javax.servlet.http.HttpServletRequest hsr) javax.ws.rs.core.ResponsegetSchedulerConfiguration(javax.servlet.http.HttpServletRequest hsr) This method retrieves all the Scheduler configuration, and it is reachable by usingRMWSConsts.SCHEDULER_CONF.This method retrieves the current scheduler status, and it is reachable by usingRMWSConsts.SCHEDULER.javax.ws.rs.core.ResponselistReservation(String queue, String reservationId, long startTime, long endTime, boolean includeResourceAllocations, javax.servlet.http.HttpServletRequest hsr) Function to retrieve a list of all the reservations.javax.ws.rs.core.ResponsepostDelegationToken(DelegationToken tokenData, javax.servlet.http.HttpServletRequest hsr) This method posts a delegation token from the client, and it is reachable by usingRMWSConsts.DELEGATION_TOKEN.javax.ws.rs.core.ResponsepostDelegationTokenExpiration(javax.servlet.http.HttpServletRequest hsr) This method updates the expiration for a delegation token from the client, and it is reachable by usingRMWSConsts.DELEGATION_TOKEN_EXPIRATION.javax.ws.rs.core.ResponseremoveFromClusterNodeLabels(Set<String> oldNodeLabels, javax.servlet.http.HttpServletRequest hsr) This method removes all the node labels for specific nodes, and it is reachable by usingRMWSConsts.REMOVE_NODE_LABELS.javax.ws.rs.core.ResponsereplaceLabelsOnNode(Set<String> newNodeLabelsName, javax.servlet.http.HttpServletRequest hsr, String nodeId) This method replaces all the node labels for specific node, and it is reachable by usingRMWSConsts.NODES_NODEID_REPLACE_LABELS.javax.ws.rs.core.ResponsereplaceLabelsOnNodes(NodeToLabelsEntryList newNodeToLabels, javax.servlet.http.HttpServletRequest hsr) This method replaces all the node labels for specific nodes, and it is reachable by usingRMWSConsts.REPLACE_NODE_TO_LABELS.javax.ws.rs.core.ResponsesignalToContainer(String containerId, String command, javax.servlet.http.HttpServletRequest req) This method sends a signal to container.javax.ws.rs.core.ResponsesubmitApplication(ApplicationSubmissionContextInfo newApp, javax.servlet.http.HttpServletRequest hsr) Function to submit an app to the RM.javax.ws.rs.core.ResponsesubmitReservation(ReservationSubmissionRequestInfo resContext, javax.servlet.http.HttpServletRequest hsr) Function to submit a Reservation to the RM.This method is reachable by usingRMWSConsts.RESERVATION_SUBMIT.javax.ws.rs.core.ResponseupdateApplicationPriority(AppPriority targetPriority, javax.servlet.http.HttpServletRequest hsr, String appId) This method updates the priority for a specific application, and it is reachable by usingRMWSConsts.APPS_APPID_PRIORITY.javax.ws.rs.core.ResponseupdateApplicationTimeout(AppTimeoutInfo appTimeout, javax.servlet.http.HttpServletRequest hsr, String appId) This method updates the timeout information for a specific app, and it is reachable by usingRMWSConsts.APPS_TIMEOUT.javax.ws.rs.core.ResponseupdateAppQueue(AppQueue targetQueue, javax.servlet.http.HttpServletRequest hsr, String appId) This method updates the queue for a specific application, and it is reachable by usingRMWSConsts.APPS_APPID_QUEUE.javax.ws.rs.core.ResponseupdateAppState(AppState targetState, javax.servlet.http.HttpServletRequest hsr, String appId) This method updates the state of the app in input, and it is reachable by usingRMWSConsts.APPS_APPID_STATE.updateNodeResource(javax.servlet.http.HttpServletRequest hsr, String nodeId, ResourceOptionInfo resourceOption) This method changes the resources of a specific node, and it is reachable by usingRMWSConsts.NODE_RESOURCE.javax.ws.rs.core.ResponseupdateReservation(ReservationUpdateRequestInfo resContext, javax.servlet.http.HttpServletRequest hsr) Function to update a Reservation to the RM.javax.ws.rs.core.ResponseupdateSchedulerConfiguration(org.apache.hadoop.yarn.webapp.dao.SchedConfUpdateInfo mutationInfo, javax.servlet.http.HttpServletRequest hsr) This method updates the Scheduler configuration, and it is reachable by usingRMWSConsts.SCHEDULER_CONF.
-
Method Details
-
get
ClusterInfo get()This method retrieves the cluster information, and it is reachable by usingRMWSConsts.INFO.- Returns:
- the cluster information
-
getClusterInfo
ClusterInfo getClusterInfo()This method retrieves the cluster information, and it is reachable by usingRMWSConsts.INFO.- Returns:
- the cluster information
-
getClusterUserInfo
This method retrieves the cluster user information, and it is reachable by usingRMWSConsts.CLUSTER_USER_INFO.- Parameters:
hsr- the servlet request- Returns:
- the cluster user information
-
getClusterMetricsInfo
ClusterMetricsInfo getClusterMetricsInfo()This method retrieves the cluster metrics information, and it is reachable by usingRMWSConsts.METRICS.- Returns:
- the cluster metrics information
- See Also:
-
ApplicationClientProtocol.getClusterMetrics(org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsRequest)
-
getSchedulerInfo
SchedulerTypeInfo getSchedulerInfo()This method retrieves the current scheduler status, and it is reachable by usingRMWSConsts.SCHEDULER.- Returns:
- the current scheduler status
-
dumpSchedulerLogs
This method dumps the scheduler logs for the time got in input, and it is reachable by usingRMWSConsts.SCHEDULER_LOGS.- Parameters:
time- the period of time. It is a FormParam.hsr- the servlet request- Returns:
- the result of the operation
- Throws:
IOException- when it cannot create dump log file
-
getNodes
This method retrieves all the nodes information in the cluster, and it is reachable by usingRMWSConsts.NODES.- Parameters:
states- the states we want to filter. It is a QueryParam.- Returns:
- all nodes in the cluster. If the states param is given, returns all nodes that are in the comma-separated list of states
- See Also:
-
ApplicationClientProtocol.getClusterNodes(org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodesRequest)
-
getNode
This method retrieves a specific node information, and it is reachable by usingRMWSConsts.NODES_NODEID.- Parameters:
nodeId- the node we want to retrieve the information. It is a PathParam.- Returns:
- the information about the node in input
-
updateNodeResource
ResourceInfo updateNodeResource(javax.servlet.http.HttpServletRequest hsr, String nodeId, ResourceOptionInfo resourceOption) throws org.apache.hadoop.security.authorize.AuthorizationException This method changes the resources of a specific node, and it is reachable by usingRMWSConsts.NODE_RESOURCE.- Parameters:
hsr- The servlet request.nodeId- The node we want to retrieve the information for. It is a PathParam.resourceOption- The resource change.- Returns:
- the resources of a specific node.
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- If the user is not authorized.
-
getApps
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, String name, Set<String> unselectedFields) This method retrieves all the app reports in the cluster, and it is reachable by usingRMWSConsts.APPS.- Parameters:
hsr- the servlet requeststateQuery- right now the stateQuery is deprecated. It is a QueryParam.statesQuery- filter the result by states. It is a QueryParam.finalStatusQuery- filter the result by final states. It is a QueryParam.userQuery- filter the result by user. It is a QueryParam.queueQuery- filter the result by queue. It is a QueryParam.count- set a limit of the result. It is a QueryParam.startedBegin- filter the result by started begin time. It is a QueryParam.startedEnd- filter the result by started end time. It is a QueryParam.finishBegin- filter the result by finish begin time. It is a QueryParam.finishEnd- filter the result by finish end time. It is a QueryParam.applicationTypes- filter the result by types. It is a QueryParam.applicationTags- filter the result by tags. It is a QueryParam.name- filter the name of the application. It is a QueryParam.unselectedFields- De-selected params to avoid from report. It is a QueryParam.- Returns:
- all apps in the cluster
- See Also:
-
ApplicationBaseProtocol.getApplications(org.apache.hadoop.yarn.api.protocolrecords.GetApplicationsRequest)
-
getActivities
ActivitiesInfo getActivities(javax.servlet.http.HttpServletRequest hsr, String nodeId, String groupBy) This method retrieve all the activities in a specific node, and it is reachable by usingRMWSConsts.SCHEDULER_ACTIVITIES.- Parameters:
hsr- the servlet requestnodeId- the node we want to retrieve the activities. It is a QueryParam.groupBy- the groupBy type by which the activities should be aggregated. It is a QueryParam.- Returns:
- all the activities in the specific node
-
getBulkActivities
BulkActivitiesInfo getBulkActivities(javax.servlet.http.HttpServletRequest hsr, String groupBy, int activitiesCount) throws InterruptedException This method retrieve the last n activities inside scheduler, and it is reachable by usingRMWSConsts.SCHEDULER_BULK_ACTIVITIES.- Parameters:
hsr- the servlet requestgroupBy- the groupBy type by which the activities should be aggregated. It is a QueryParam.activitiesCount- number of activities- Returns:
- last n activities
- Throws:
InterruptedException- if interrupted.
-
getAppActivities
AppActivitiesInfo getAppActivities(javax.servlet.http.HttpServletRequest hsr, String appId, String time, Set<String> requestPriorities, Set<String> allocationRequestIds, String groupBy, String limit, Set<String> actions, boolean summarize) This method retrieves all the activities for a specific app for a specific period of time, and it is reachable by usingRMWSConsts.SCHEDULER_APP_ACTIVITIES.- Parameters:
hsr- the servlet requestappId- the applicationId we want to retrieve the activities. It is a QueryParam.time- for how long we want to retrieve the activities. It is a QueryParam.requestPriorities- the request priorities we want to retrieve the activities. It is a QueryParam.allocationRequestIds- the allocation request ids we want to retrieve the activities. It is a QueryParam.groupBy- the groupBy type by which the activities should be aggregated. It is a QueryParam.limit- set a limit of the result. It is a QueryParam.actions- the required actions of app activities. It is a QueryParam.summarize- whether app activities in multiple scheduling processes need to be summarized. It is a QueryParam.- Returns:
- all the activities about a specific app for a specific time
-
getAppStatistics
ApplicationStatisticsInfo getAppStatistics(javax.servlet.http.HttpServletRequest hsr, Set<String> stateQueries, Set<String> typeQueries) This method retrieves all the statistics for a specific app, and it is reachable by usingRMWSConsts.APP_STATISTICS.- Parameters:
hsr- the servlet requeststateQueries- filter the result by states. It is a QueryParam.typeQueries- filter the result by type names. It is a QueryParam.- Returns:
- the application's statistics for specific states and types
-
getApp
AppInfo getApp(javax.servlet.http.HttpServletRequest hsr, String appId, Set<String> unselectedFields) This method retrieves the report for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID.- Parameters:
hsr- the servlet requestappId- the Id of the application we want the report. It is a PathParam.unselectedFields- De-selected param list to avoid from report. It is a QueryParam.- Returns:
- the app report for a specific application
- See Also:
-
ApplicationBaseProtocol.getApplicationReport(org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest)
-
getAppState
AppState getAppState(javax.servlet.http.HttpServletRequest hsr, String appId) throws org.apache.hadoop.security.authorize.AuthorizationException This method retrieves the state for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID_STATE.- Parameters:
hsr- the servlet requestappId- the Id of the application we want the state. It is a PathParam.- Returns:
- the state for a specific application
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized
-
updateAppState
javax.ws.rs.core.Response updateAppState(AppState targetState, javax.servlet.http.HttpServletRequest hsr, String appId) throws org.apache.hadoop.security.authorize.AuthorizationException, org.apache.hadoop.yarn.exceptions.YarnException, InterruptedException, IOException This method updates the state of the app in input, and it is reachable by usingRMWSConsts.APPS_APPID_STATE.- Parameters:
targetState- the target state for the app. It is a content param.hsr- the servlet requestappId- the Id of the application we want to update the state. It is a PathParam.- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized to invoke this methodorg.apache.hadoop.yarn.exceptions.YarnException- if app does not existInterruptedException- if interruptedIOException- if doAs action throws an IOException
-
getNodeToLabels
This method retrieves all the node labels with the respective nodes in the cluster, and it is reachable by usingRMWSConsts.GET_NODE_TO_LABELS.- Parameters:
hsr- the servlet request- Returns:
- all the nodes within a node label
- Throws:
IOException- if an IOException happened- See Also:
-
ApplicationClientProtocol.getNodeToLabels(org.apache.hadoop.yarn.api.protocolrecords.GetNodesToLabelsRequest)
-
getRMNodeLabels
- Throws:
IOException
-
getLabelsToNodes
This method retrieves all the node within multiple node labels in the cluster, and it is reachable by usingRMWSConsts.LABEL_MAPPINGS.- Parameters:
labels- filter the result by node labels. It is a QueryParam.- Returns:
- all the nodes within multiple node labels
- Throws:
IOException- if an IOException happened- See Also:
-
ApplicationClientProtocol.getLabelsToNodes(org.apache.hadoop.yarn.api.protocolrecords.GetLabelsToNodesRequest)
-
replaceLabelsOnNodes
javax.ws.rs.core.Response replaceLabelsOnNodes(NodeToLabelsEntryList newNodeToLabels, javax.servlet.http.HttpServletRequest hsr) throws Exception This method replaces all the node labels for specific nodes, and it is reachable by usingRMWSConsts.REPLACE_NODE_TO_LABELS.- Parameters:
newNodeToLabels- the list of new labels. It is a content param.hsr- the servlet request- Returns:
- Response containing the status code
- Throws:
Exception- if an exception happened- See Also:
-
ResourceManagerAdministrationProtocol.replaceLabelsOnNode(org.apache.hadoop.yarn.server.api.protocolrecords.ReplaceLabelsOnNodeRequest)
-
replaceLabelsOnNode
javax.ws.rs.core.Response replaceLabelsOnNode(Set<String> newNodeLabelsName, javax.servlet.http.HttpServletRequest hsr, String nodeId) throws Exception This method replaces all the node labels for specific node, and it is reachable by usingRMWSConsts.NODES_NODEID_REPLACE_LABELS.- Parameters:
newNodeLabelsName- the list of new labels. It is a QueryParam.hsr- the servlet requestnodeId- the node we want to replace the node labels. It is a PathParam.- Returns:
- Response containing the status code
- Throws:
Exception- if an exception happened- See Also:
-
ResourceManagerAdministrationProtocol.replaceLabelsOnNode(org.apache.hadoop.yarn.server.api.protocolrecords.ReplaceLabelsOnNodeRequest)
-
getClusterNodeLabels
This method retrieves all the node labels in the cluster, and it is reachable by usingRMWSConsts.GET_NODE_LABELS.- Parameters:
hsr- the servlet request- Returns:
- all the node labels in the cluster
- Throws:
IOException- if an IOException happened- See Also:
-
ApplicationClientProtocol.getClusterNodeLabels(org.apache.hadoop.yarn.api.protocolrecords.GetClusterNodeLabelsRequest)
-
addToClusterNodeLabels
javax.ws.rs.core.Response addToClusterNodeLabels(NodeLabelsInfo newNodeLabels, javax.servlet.http.HttpServletRequest hsr) throws Exception This method adds specific node labels for specific nodes, and it is reachable by usingRMWSConsts.ADD_NODE_LABELS.- Parameters:
newNodeLabels- the node labels to add. It is a content param.hsr- the servlet request- Returns:
- Response containing the status code
- Throws:
Exception- in case of bad request- See Also:
-
ResourceManagerAdministrationProtocol.addToClusterNodeLabels(org.apache.hadoop.yarn.server.api.protocolrecords.AddToClusterNodeLabelsRequest)
-
removeFromClusterNodeLabels
javax.ws.rs.core.Response removeFromClusterNodeLabels(Set<String> oldNodeLabels, javax.servlet.http.HttpServletRequest hsr) throws Exception This method removes all the node labels for specific nodes, and it is reachable by usingRMWSConsts.REMOVE_NODE_LABELS.- Parameters:
oldNodeLabels- the node labels to remove. It is a QueryParam.hsr- the servlet request- Returns:
- Response containing the status code
- Throws:
Exception- in case of bad request- See Also:
-
ResourceManagerAdministrationProtocol.removeFromClusterNodeLabels(org.apache.hadoop.yarn.server.api.protocolrecords.RemoveFromClusterNodeLabelsRequest)
-
getLabelsOnNode
NodeLabelsInfo getLabelsOnNode(javax.servlet.http.HttpServletRequest hsr, String nodeId) throws IOException This method retrieves all the node labels for specific node, and it is reachable by usingRMWSConsts.NODES_NODEID_GETLABELS.- Parameters:
hsr- the servlet requestnodeId- the node we want to get all the node labels. It is a PathParam.- Returns:
- all the labels for a specific node.
- Throws:
IOException- if an IOException happened
-
getAppPriority
AppPriority getAppPriority(javax.servlet.http.HttpServletRequest hsr, String appId) throws org.apache.hadoop.security.authorize.AuthorizationException This method retrieves the priority for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID_PRIORITY.- Parameters:
hsr- the servlet requestappId- the app we want to get the priority. It is a PathParam.- Returns:
- the priority for a specific application
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- in case of the user is not authorized
-
updateApplicationPriority
javax.ws.rs.core.Response updateApplicationPriority(AppPriority targetPriority, javax.servlet.http.HttpServletRequest hsr, String appId) throws org.apache.hadoop.security.authorize.AuthorizationException, org.apache.hadoop.yarn.exceptions.YarnException, InterruptedException, IOException This method updates the priority for a specific application, and it is reachable by usingRMWSConsts.APPS_APPID_PRIORITY.- Parameters:
targetPriority- the priority we want to set for the app. It is a content param.hsr- the servlet requestappId- the application we want to update its priority. It is a PathParam.- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authenticatedorg.apache.hadoop.yarn.exceptions.YarnException- if the target is nullIOException- if the update fails.InterruptedException- if interrupted.
-
getAppQueue
AppQueue getAppQueue(javax.servlet.http.HttpServletRequest hsr, String appId) throws org.apache.hadoop.security.authorize.AuthorizationException This method retrieves the queue for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID_QUEUE.- Parameters:
hsr- the servlet requestappId- the application we want to retrieve its queue. It is a PathParam.- Returns:
- the Queue for a specific application.
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authenticated
-
updateAppQueue
javax.ws.rs.core.Response updateAppQueue(AppQueue targetQueue, javax.servlet.http.HttpServletRequest hsr, String appId) throws org.apache.hadoop.security.authorize.AuthorizationException, org.apache.hadoop.yarn.exceptions.YarnException, InterruptedException, IOException This method updates the queue for a specific application, and it is reachable by usingRMWSConsts.APPS_APPID_QUEUE.- Parameters:
targetQueue- the queue we want to set. It is a content param.hsr- the servlet requestappId- the application we want to change its queue. It is a PathParam.- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authenticatedorg.apache.hadoop.yarn.exceptions.YarnException- if the app is not foundIOException- if the update fails.InterruptedException- if interrupted.
-
createNewApplication
javax.ws.rs.core.Response createNewApplication(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. This method is reachable by usingRMWSConsts.APPS_NEW_APPLICATION.- Parameters:
hsr- the servlet request- Returns:
- Response containing the app id and the maximum resource capabilities
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized to invoke this methodIOException- if the creation failsInterruptedException- if interrupted- See Also:
-
ApplicationClientProtocol.getNewApplication(org.apache.hadoop.yarn.api.protocolrecords.GetNewApplicationRequest)
-
submitApplication
javax.ws.rs.core.Response submitApplication(ApplicationSubmissionContextInfo newApp, javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException Function to submit an app to the RM. This method is reachable by usingRMWSConsts.APPS.- Parameters:
newApp- structure containing information to construct the ApplicationSubmissionContext. It is a content param.hsr- the servlet request- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized to invoke this methodIOException- if the submission failedInterruptedException- if interrupted- See Also:
-
ApplicationClientProtocol.submitApplication(org.apache.hadoop.yarn.api.protocolrecords.SubmitApplicationRequest)
-
postDelegationToken
javax.ws.rs.core.Response postDelegationToken(DelegationToken tokenData, javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException, Exception This method posts a delegation token from the client, and it is reachable by usingRMWSConsts.DELEGATION_TOKEN.- Parameters:
tokenData- the token to delegate. It is a content param.hsr- the servlet request- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if Kerberos auth failedIOException- if the delegation failedInterruptedException- if interruptedException- in case of bad request- See Also:
-
ApplicationBaseProtocol.getDelegationToken(org.apache.hadoop.yarn.api.protocolrecords.GetDelegationTokenRequest)
-
postDelegationTokenExpiration
javax.ws.rs.core.Response postDelegationTokenExpiration(javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, Exception This method updates the expiration for a delegation token from the client, and it is reachable by usingRMWSConsts.DELEGATION_TOKEN_EXPIRATION.- Parameters:
hsr- the servlet request- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if Kerberos auth failedIOException- if the delegation failedException- in case of bad request- See Also:
-
ApplicationBaseProtocol.renewDelegationToken(org.apache.hadoop.yarn.api.protocolrecords.RenewDelegationTokenRequest)
-
cancelDelegationToken
javax.ws.rs.core.Response cancelDelegationToken(javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException, Exception This method cancel the delegation token from the client, and it is reachable by usingRMWSConsts.DELEGATION_TOKEN.- Parameters:
hsr- the servlet request- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if Kerberos auth failedIOException- if the delegation failedInterruptedException- if interruptedException- in case of bad request- See Also:
-
ApplicationBaseProtocol.cancelDelegationToken(org.apache.hadoop.yarn.api.protocolrecords.CancelDelegationTokenRequest)
-
createNewReservation
javax.ws.rs.core.Response createNewReservation(javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException Generates a new ReservationId which is then sent to the client. This method is reachable by usingRMWSConsts.RESERVATION_NEW.- Parameters:
hsr- the servlet request- Returns:
- Response containing the app id and the maximum resource capabilities
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized to invoke this method.IOException- if creation failedInterruptedException- if interrupted- See Also:
-
ApplicationClientProtocol.getNewReservation(org.apache.hadoop.yarn.api.protocolrecords.GetNewReservationRequest)
-
submitReservation
javax.ws.rs.core.Response submitReservation(ReservationSubmissionRequestInfo resContext, javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException Function to submit a Reservation to the RM.This method is reachable by usingRMWSConsts.RESERVATION_SUBMIT.- Parameters:
resContext- provides information to construct the ReservationSubmissionRequest. It is a content param.hsr- the servlet request- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized to invoke this methodIOException- if creation failedInterruptedException- if interrupted- See Also:
-
ApplicationClientProtocol.submitReservation(org.apache.hadoop.yarn.api.protocolrecords.ReservationSubmissionRequest)
-
updateReservation
javax.ws.rs.core.Response updateReservation(ReservationUpdateRequestInfo resContext, javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException Function to update a Reservation to the RM. This method is reachable by usingRMWSConsts.RESERVATION_UPDATE.- Parameters:
resContext- provides information to construct the ReservationUpdateRequest. It is a content param.hsr- the servlet request- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized to invoke this methodIOException- if the operation failedInterruptedException- if interrupted- See Also:
-
ApplicationClientProtocol.updateReservation(org.apache.hadoop.yarn.api.protocolrecords.ReservationUpdateRequest)
-
deleteReservation
javax.ws.rs.core.Response deleteReservation(ReservationDeleteRequestInfo resContext, javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException Function to delete a Reservation to the RM. This method is reachable by usingRMWSConsts.RESERVATION_DELETE.- Parameters:
resContext- provides information to construct the ReservationDeleteRequest. It is a content param.hsr- the servlet request- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- when the user group information cannot be retrieved.IOException- when aReservationDeleteRequestcannot be created from theReservationDeleteRequestInfo. This exception is also thrown onClientRMService.deleteReservationinvocation failure.InterruptedException- if doAs action throws an InterruptedException.- See Also:
-
ApplicationClientProtocol.deleteReservation(org.apache.hadoop.yarn.api.protocolrecords.ReservationDeleteRequest)
-
listReservation
javax.ws.rs.core.Response listReservation(String queue, String reservationId, long startTime, long endTime, boolean includeResourceAllocations, javax.servlet.http.HttpServletRequest hsr) throws Exception Function to retrieve a list of all the reservations. This method is reachable by usingRMWSConsts.RESERVATION_LIST.- Parameters:
queue- filter the result by queue. It is a QueryParam.reservationId- filter the result by reservationId. It is a QueryParam.startTime- filter the result by start time. It is a QueryParam.endTime- filter the result by end time. It is a QueryParam.includeResourceAllocations- true if the resource allocation should be in the result, false otherwise. It is a QueryParam.hsr- the servlet request- Returns:
- Response containing the status code
- Throws:
Exception- in case of bad request- See Also:
-
ApplicationClientProtocol.listReservations(org.apache.hadoop.yarn.api.protocolrecords.ReservationListRequest)
-
getAppTimeout
AppTimeoutInfo getAppTimeout(javax.servlet.http.HttpServletRequest hsr, String appId, String type) throws org.apache.hadoop.security.authorize.AuthorizationException This method retrieves the timeout information for a specific app with a specific type, and it is reachable by usingRMWSConsts.APPS_TIMEOUTS_TYPE.- Parameters:
hsr- the servlet requestappId- the application we want to get the timeout. It is a PathParam.type- the type of the timeouts. It is a PathParam.- Returns:
- the timeout for a specific application with a specific type.
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized
-
getAppTimeouts
AppTimeoutsInfo getAppTimeouts(javax.servlet.http.HttpServletRequest hsr, String appId) throws org.apache.hadoop.security.authorize.AuthorizationException This method retrieves the timeout information for a specific app, and it is reachable by usingRMWSConsts.APPS_TIMEOUTS.- Parameters:
hsr- the servlet requestappId- the application we want to get the timeouts. It is a PathParam.- Returns:
- the timeouts for a specific application
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized
-
updateApplicationTimeout
javax.ws.rs.core.Response updateApplicationTimeout(AppTimeoutInfo appTimeout, javax.servlet.http.HttpServletRequest hsr, String appId) throws org.apache.hadoop.security.authorize.AuthorizationException, org.apache.hadoop.yarn.exceptions.YarnException, InterruptedException, IOException This method updates the timeout information for a specific app, and it is reachable by usingRMWSConsts.APPS_TIMEOUT.- Parameters:
appTimeout- the appTimeoutInfo. It is a content param.hsr- the servlet requestappId- the application we want to update. It is a PathParam.- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized to invoke this methodorg.apache.hadoop.yarn.exceptions.YarnException- in case of bad requestIOException- if the operation failedInterruptedException- if interrupted- See Also:
-
ApplicationClientProtocol.updateApplicationTimeouts(org.apache.hadoop.yarn.api.protocolrecords.UpdateApplicationTimeoutsRequest)
-
getAppAttempts
This method retrieves all the attempts information for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID_APPATTEMPTS.- Parameters:
hsr- the servlet requestappId- the application we want to get the attempts. It is a PathParam.- Returns:
- all the attempts info for a specific application
- See Also:
-
ApplicationBaseProtocol.getApplicationAttempts(org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptsRequest)
-
checkUserAccessToQueue
RMQueueAclInfo checkUserAccessToQueue(String queue, String username, String queueAclType, javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException This method verifies if a user has access to a specified queue.- Parameters:
queue- queueusername- userqueueAclType- acl type of queue, it could be SUBMIT_APPLICATIONS/ADMINISTER_QUEUEhsr- request- Returns:
- Response containing the status code.
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized to invoke this method.
-
signalToContainer
javax.ws.rs.core.Response signalToContainer(String containerId, String command, javax.servlet.http.HttpServletRequest req) throws org.apache.hadoop.security.authorize.AuthorizationException This method sends a signal to container.- Parameters:
containerId- containerIdcommand- signal command, it could be OUTPUT_THREAD_DUMP/ GRACEFUL_SHUTDOWN/FORCEFUL_SHUTDOWNreq- request- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized to invoke this method.
-
updateSchedulerConfiguration
javax.ws.rs.core.Response updateSchedulerConfiguration(org.apache.hadoop.yarn.webapp.dao.SchedConfUpdateInfo mutationInfo, javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, InterruptedException This method updates the Scheduler configuration, and it is reachable by usingRMWSConsts.SCHEDULER_CONF.- Parameters:
mutationInfo- th information for making scheduler configuration changes (supports adding, removing, or updating a queue, as well as global scheduler conf changes)hsr- the servlet request- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized to invoke this methodInterruptedException- if interrupted
-
getSchedulerConfiguration
javax.ws.rs.core.Response getSchedulerConfiguration(javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException This method retrieves all the Scheduler configuration, and it is reachable by usingRMWSConsts.SCHEDULER_CONF.- Parameters:
hsr- the servlet request- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized to invoke this method.
-