Class RMWebServices
java.lang.Object
org.apache.hadoop.yarn.server.webapp.WebServices
org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebServices
- All Implemented Interfaces:
RMWebServiceProtocol,org.apache.hadoop.yarn.server.webapp.AppInfoProvider
@Singleton
@Path("/ws/v1/cluster")
public class RMWebServices
extends org.apache.hadoop.yarn.server.webapp.WebServices
implements RMWebServiceProtocol
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intFields inherited from class org.apache.hadoop.yarn.server.webapp.WebServices
appBaseProt -
Constructor Summary
ConstructorsConstructorDescriptionRMWebServices(ResourceManager rm, org.apache.hadoop.conf.Configuration conf) -
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.static StringThis method ensures that the output String has only valid XML unicode characters as specified by the XML 1.0 standard.javax.ws.rs.core.ResponseformatSchedulerConfiguration(javax.servlet.http.HttpServletRequest hsr) 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.org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfogetAppAttempt(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String appId, String appAttemptId) 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.protected org.apache.hadoop.yarn.api.records.ApplicationAttemptReportgetApplicationAttemptReport(org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptReportRequest request) protected List<org.apache.hadoop.yarn.api.records.ApplicationAttemptReport>getApplicationAttemptsReport(org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptsRequest request) protected org.apache.hadoop.yarn.api.records.ApplicationReportgetApplicationReport(org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest request) protected List<org.apache.hadoop.yarn.api.records.ApplicationReport>getApplicationsReport(org.apache.hadoop.yarn.api.protocolrecords.GetApplicationsRequest request) 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 limit, 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.org.apache.hadoop.yarn.util.LRUCache<org.apache.hadoop.yarn.util.AppsCacheKey,AppsInfo> 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.org.apache.hadoop.yarn.server.webapp.dao.ContainerInfogetContainer(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String appId, String appAttemptId, String containerId) protected org.apache.hadoop.yarn.api.records.ContainerReportgetContainerReport(org.apache.hadoop.yarn.api.protocolrecords.GetContainerReportRequest request) org.apache.hadoop.yarn.server.webapp.dao.ContainersInfogetContainers(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String appId, String appAttemptId) protected List<org.apache.hadoop.yarn.api.records.ContainerReport>getContainersReport(org.apache.hadoop.yarn.api.protocolrecords.GetContainersRequest request) 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.javax.ws.rs.core.ResponsegetSchedulerConfigurationVersion(javax.servlet.http.HttpServletRequest hsr) This method retrieves the current scheduler status, and it is reachable by usingRMWSConsts.SCHEDULER.protected Booleanprotected javax.ws.rs.core.ResponsekillApp(RMApp app, org.apache.hadoop.security.UserGroupInformation callerUGI, javax.servlet.http.HttpServletRequest hsr, String diagnostic) 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.protected javax.ws.rs.core.Responsejavax.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.voidsetResponse(javax.servlet.http.HttpServletResponse response) javax.ws.rs.core.ResponsesignalToContainer(String containerId, String command, javax.servlet.http.HttpServletRequest hsr) 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.javax.ws.rs.core.ResponsevalidateAndGetSchedulerConfiguration(org.apache.hadoop.yarn.webapp.dao.SchedConfUpdateInfo mutationInfo, javax.servlet.http.HttpServletRequest hsr) Methods inherited from class org.apache.hadoop.yarn.server.webapp.WebServices
getApp, getApp, getApp, getAppAttempts, getApps, getContainer, getNodeHttpAddress, getUser, initForReadableEndpoints, parseApplicationAttemptId, parseApplicationId, parseContainerId, parseQueries, validateIds
-
Field Details
-
DEFAULT_QUEUE
- See Also:
-
DEFAULT_RESERVATION_ID
- See Also:
-
DEFAULT_START_TIME
- See Also:
-
DEFAULT_END_TIME
- See Also:
-
DEFAULT_INCLUDE_RESOURCE
- See Also:
-
DEFAULT_SUMMARIZE
- See Also:
-
DEFAULT_ACTIVITIES_COUNT
- See Also:
-
MAX_ACTIVITIES_COUNT
public static final int MAX_ACTIVITIES_COUNT- See Also:
-
DELEGATION_TOKEN_HEADER
- See Also:
-
-
Constructor Details
-
RMWebServices
@Inject public RMWebServices(@Named("rm") ResourceManager rm, @Named("conf") org.apache.hadoop.conf.Configuration conf)
-
-
Method Details
-
hasAccess
-
get
@GET @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public ClusterInfo get()Description copied from interface:RMWebServiceProtocolThis method retrieves the cluster information, and it is reachable by usingRMWSConsts.INFO.- Specified by:
getin interfaceRMWebServiceProtocol- Returns:
- the cluster information
-
getClusterInfo
@GET @Path("/info") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public ClusterInfo getClusterInfo()Description copied from interface:RMWebServiceProtocolThis method retrieves the cluster information, and it is reachable by usingRMWSConsts.INFO.- Specified by:
getClusterInfoin interfaceRMWebServiceProtocol- Returns:
- the cluster information
-
getClusterUserInfo
@GET @Path("/userinfo") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public ClusterUserInfo getClusterUserInfo(@Context javax.servlet.http.HttpServletRequest hsr) Description copied from interface:RMWebServiceProtocolThis method retrieves the cluster user information, and it is reachable by usingRMWSConsts.CLUSTER_USER_INFO.- Specified by:
getClusterUserInfoin interfaceRMWebServiceProtocol- Parameters:
hsr- the servlet request- Returns:
- the cluster user information
-
getClusterMetricsInfo
@GET @Path("/metrics") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public ClusterMetricsInfo getClusterMetricsInfo()Description copied from interface:RMWebServiceProtocolThis method retrieves the cluster metrics information, and it is reachable by usingRMWSConsts.METRICS.- Specified by:
getClusterMetricsInfoin interfaceRMWebServiceProtocol- Returns:
- the cluster metrics information
- See Also:
-
ApplicationClientProtocol.getClusterMetrics(org.apache.hadoop.yarn.api.protocolrecords.GetClusterMetricsRequest)
-
getSchedulerInfo
@GET @Path("/scheduler") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public SchedulerTypeInfo getSchedulerInfo()Description copied from interface:RMWebServiceProtocolThis method retrieves the current scheduler status, and it is reachable by usingRMWSConsts.SCHEDULER.- Specified by:
getSchedulerInfoin interfaceRMWebServiceProtocol- Returns:
- the current scheduler status
-
dumpSchedulerLogs
@POST @Path("/scheduler/logs") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public String dumpSchedulerLogs(@FormParam("time") String time, @Context javax.servlet.http.HttpServletRequest hsr) throws IOException Description copied from interface:RMWebServiceProtocolThis method dumps the scheduler logs for the time got in input, and it is reachable by usingRMWSConsts.SCHEDULER_LOGS.- Specified by:
dumpSchedulerLogsin interfaceRMWebServiceProtocol- 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
@GET @Path("/nodes") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public NodesInfo getNodes(@QueryParam("states") String states) Description copied from interface:RMWebServiceProtocolThis method retrieves all the nodes information in the cluster, and it is reachable by usingRMWSConsts.NODES.- Specified by:
getNodesin interfaceRMWebServiceProtocol- 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
@GET @Path("/nodes/{nodeId}") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public NodeInfo getNode(@PathParam("nodeId") String nodeId) Description copied from interface:RMWebServiceProtocolThis method retrieves a specific node information, and it is reachable by usingRMWSConsts.NODES_NODEID.- Specified by:
getNodein interfaceRMWebServiceProtocol- Parameters:
nodeId- the node we want to retrieve the information. It is a PathParam.- Returns:
- the information about the node in input
-
updateNodeResource
@POST @Path("/nodes/{nodeId}/resource") @Consumes({"application/json","application/xml"}) @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public ResourceInfo updateNodeResource(@Context javax.servlet.http.HttpServletRequest hsr, @PathParam("nodeId") String nodeId, ResourceOptionInfo resourceOption) throws org.apache.hadoop.security.authorize.AuthorizationException Description copied from interface:RMWebServiceProtocolThis method changes the resources of a specific node, and it is reachable by usingRMWSConsts.NODE_RESOURCE.- Specified by:
updateNodeResourcein interfaceRMWebServiceProtocol- 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.
-
escapeInvalidXMLCharacters
This method ensures that the output String has only valid XML unicode characters as specified by the XML 1.0 standard. For reference, please see the standard.- Parameters:
str- The String whose invalid xml characters we want to escape.- Returns:
- The str String after escaping invalid xml characters.
-
getApps
@GET @Path("/apps") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public AppsInfo getApps(@Context javax.servlet.http.HttpServletRequest hsr, @QueryParam("state") String stateQuery, @QueryParam("states") Set<String> statesQuery, @QueryParam("finalStatus") String finalStatusQuery, @QueryParam("user") String userQuery, @QueryParam("queue") String queueQuery, @QueryParam("limit") String limit, @QueryParam("startedTimeBegin") String startedBegin, @QueryParam("startedTimeEnd") String startedEnd, @QueryParam("finishedTimeBegin") String finishBegin, @QueryParam("finishedTimeEnd") String finishEnd, @QueryParam("applicationTypes") Set<String> applicationTypes, @QueryParam("applicationTags") Set<String> applicationTags, @QueryParam("name") String name, @QueryParam("deSelects") Set<String> unselectedFields) Description copied from interface:RMWebServiceProtocolThis method retrieves all the app reports in the cluster, and it is reachable by usingRMWSConsts.APPS.- Specified by:
getAppsin interfaceRMWebServiceProtocol- 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.limit- 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
@GET @Path("/scheduler/activities") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public ActivitiesInfo getActivities(@Context javax.servlet.http.HttpServletRequest hsr, @QueryParam("nodeId") String nodeId, @QueryParam("groupBy") String groupBy) Description copied from interface:RMWebServiceProtocolThis method retrieve all the activities in a specific node, and it is reachable by usingRMWSConsts.SCHEDULER_ACTIVITIES.- Specified by:
getActivitiesin interfaceRMWebServiceProtocol- 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
@GET @Path("/scheduler/bulk-activities") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public BulkActivitiesInfo getBulkActivities(@Context javax.servlet.http.HttpServletRequest hsr, @QueryParam("groupBy") String groupBy, @QueryParam("activitiesCount") @DefaultValue("10") int activitiesCount) throws InterruptedException Description copied from interface:RMWebServiceProtocolThis method retrieve the last n activities inside scheduler, and it is reachable by usingRMWSConsts.SCHEDULER_BULK_ACTIVITIES.- Specified by:
getBulkActivitiesin interfaceRMWebServiceProtocol- 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
@GET @Path("/scheduler/app-activities/{appid}") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public AppActivitiesInfo getAppActivities(@Context javax.servlet.http.HttpServletRequest hsr, @PathParam("appid") String appId, @QueryParam("maxTime") String time, @QueryParam("requestPriorities") Set<String> requestPriorities, @QueryParam("allocationRequestIds") Set<String> allocationRequestIds, @QueryParam("groupBy") String groupBy, @QueryParam("limit") String limit, @QueryParam("actions") Set<String> actions, @QueryParam("summarize") @DefaultValue("false") boolean summarize) Description copied from interface:RMWebServiceProtocolThis method retrieves all the activities for a specific app for a specific period of time, and it is reachable by usingRMWSConsts.SCHEDULER_APP_ACTIVITIES.- Specified by:
getAppActivitiesin interfaceRMWebServiceProtocol- 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
@GET @Path("/appstatistics") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public ApplicationStatisticsInfo getAppStatistics(@Context javax.servlet.http.HttpServletRequest hsr, @QueryParam("states") Set<String> stateQueries, @QueryParam("applicationTypes") Set<String> typeQueries) Description copied from interface:RMWebServiceProtocolThis method retrieves all the statistics for a specific app, and it is reachable by usingRMWSConsts.APP_STATISTICS.- Specified by:
getAppStatisticsin interfaceRMWebServiceProtocol- 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
@GET @Path("/apps/{appid}") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public AppInfo getApp(@Context javax.servlet.http.HttpServletRequest hsr, @PathParam("appid") String appId, @QueryParam("deSelects") Set<String> unselectedFields) Description copied from interface:RMWebServiceProtocolThis method retrieves the report for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID.- Specified by:
getAppin interfaceRMWebServiceProtocol- 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)
-
getAppAttempts
@GET @Path("/apps/{appid}/appattempts") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public AppAttemptsInfo getAppAttempts(@Context javax.servlet.http.HttpServletRequest hsr, @PathParam("appid") String appId) Description copied from interface:RMWebServiceProtocolThis method retrieves all the attempts information for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID_APPATTEMPTS.- Specified by:
getAppAttemptsin interfaceRMWebServiceProtocol- 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)
-
getAppAttempt
@GET @Path("/apps/{appid}/appattempts/{appattemptid}") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo getAppAttempt(@Context javax.servlet.http.HttpServletRequest req, @Context javax.servlet.http.HttpServletResponse res, @PathParam("appid") String appId, @PathParam("appattemptid") String appAttemptId) - Overrides:
getAppAttemptin classorg.apache.hadoop.yarn.server.webapp.WebServices
-
getContainers
@GET @Path("/apps/{appid}/appattempts/{appattemptid}/containers") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public org.apache.hadoop.yarn.server.webapp.dao.ContainersInfo getContainers(@Context javax.servlet.http.HttpServletRequest req, @Context javax.servlet.http.HttpServletResponse res, @PathParam("appid") String appId, @PathParam("appattemptid") String appAttemptId) - Overrides:
getContainersin classorg.apache.hadoop.yarn.server.webapp.WebServices
-
getContainer
@GET @Path("/apps/{appid}/appattempts/{appattemptid}/containers/{containerid}") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public org.apache.hadoop.yarn.server.webapp.dao.ContainerInfo getContainer(@Context javax.servlet.http.HttpServletRequest req, @Context javax.servlet.http.HttpServletResponse res, @PathParam("appid") String appId, @PathParam("appattemptid") String appAttemptId, @PathParam("containerid") String containerId) - Overrides:
getContainerin classorg.apache.hadoop.yarn.server.webapp.WebServices
-
getAppState
@GET @Path("/apps/{appid}/state") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public AppState getAppState(@Context javax.servlet.http.HttpServletRequest hsr, @PathParam("appid") String appId) throws org.apache.hadoop.security.authorize.AuthorizationException Description copied from interface:RMWebServiceProtocolThis method retrieves the state for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID_STATE.- Specified by:
getAppStatein interfaceRMWebServiceProtocol- 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
@PUT @Path("/apps/{appid}/state") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) @Consumes({"application/json","application/xml"}) public javax.ws.rs.core.Response updateAppState(AppState targetState, @Context javax.servlet.http.HttpServletRequest hsr, @PathParam("appid") String appId) throws org.apache.hadoop.security.authorize.AuthorizationException, org.apache.hadoop.yarn.exceptions.YarnException, InterruptedException, IOException Description copied from interface:RMWebServiceProtocolThis method updates the state of the app in input, and it is reachable by usingRMWSConsts.APPS_APPID_STATE.- Specified by:
updateAppStatein interfaceRMWebServiceProtocol- 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
@GET @Path("/get-node-to-labels") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public NodeToLabelsInfo getNodeToLabels(@Context javax.servlet.http.HttpServletRequest hsr) throws IOException Description copied from interface:RMWebServiceProtocolThis method retrieves all the node labels with the respective nodes in the cluster, and it is reachable by usingRMWSConsts.GET_NODE_TO_LABELS.- Specified by:
getNodeToLabelsin interfaceRMWebServiceProtocol- 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)
-
getLabelsToNodes
@GET @Path("/label-mappings") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public LabelsToNodesInfo getLabelsToNodes(@QueryParam("labels") Set<String> labels) throws IOException Description copied from interface:RMWebServiceProtocolThis method retrieves all the node within multiple node labels in the cluster, and it is reachable by usingRMWSConsts.LABEL_MAPPINGS.- Specified by:
getLabelsToNodesin interfaceRMWebServiceProtocol- 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
@POST @Path("/replace-node-to-labels") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public javax.ws.rs.core.Response replaceLabelsOnNodes(NodeToLabelsEntryList newNodeToLabels, @Context javax.servlet.http.HttpServletRequest hsr) throws IOException Description copied from interface:RMWebServiceProtocolThis method replaces all the node labels for specific nodes, and it is reachable by usingRMWSConsts.REPLACE_NODE_TO_LABELS.- Specified by:
replaceLabelsOnNodesin interfaceRMWebServiceProtocol- Parameters:
newNodeToLabels- the list of new labels. It is a content param.hsr- the servlet request- Returns:
- Response containing the status code
- Throws:
IOException- See Also:
-
ResourceManagerAdministrationProtocol.replaceLabelsOnNode(org.apache.hadoop.yarn.server.api.protocolrecords.ReplaceLabelsOnNodeRequest)
-
replaceLabelsOnNode
@POST @Path("/nodes/{nodeId}/replace-labels") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public javax.ws.rs.core.Response replaceLabelsOnNode(@QueryParam("labels") Set<String> newNodeLabelsName, @Context javax.servlet.http.HttpServletRequest hsr, @PathParam("nodeId") String nodeId) throws Exception Description copied from interface:RMWebServiceProtocolThis method replaces all the node labels for specific node, and it is reachable by usingRMWSConsts.NODES_NODEID_REPLACE_LABELS.- Specified by:
replaceLabelsOnNodein interfaceRMWebServiceProtocol- 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
@GET @Path("/get-node-labels") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public NodeLabelsInfo getClusterNodeLabels(@Context javax.servlet.http.HttpServletRequest hsr) throws IOException Description copied from interface:RMWebServiceProtocolThis method retrieves all the node labels in the cluster, and it is reachable by usingRMWSConsts.GET_NODE_LABELS.- Specified by:
getClusterNodeLabelsin interfaceRMWebServiceProtocol- 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)
-
getRMNodeLabels
@GET @Path("/get-rm-node-labels") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public NodeLabelsInfo getRMNodeLabels(@Context javax.servlet.http.HttpServletRequest hsr) throws IOException - Specified by:
getRMNodeLabelsin interfaceRMWebServiceProtocol- Throws:
IOException
-
addToClusterNodeLabels
@POST @Path("/add-node-labels") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public javax.ws.rs.core.Response addToClusterNodeLabels(NodeLabelsInfo newNodeLabels, @Context javax.servlet.http.HttpServletRequest hsr) throws Exception Description copied from interface:RMWebServiceProtocolThis method adds specific node labels for specific nodes, and it is reachable by usingRMWSConsts.ADD_NODE_LABELS.- Specified by:
addToClusterNodeLabelsin interfaceRMWebServiceProtocol- 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
@POST @Path("/remove-node-labels") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public javax.ws.rs.core.Response removeFromClusterNodeLabels(@QueryParam("labels") Set<String> oldNodeLabels, @Context javax.servlet.http.HttpServletRequest hsr) throws Exception Description copied from interface:RMWebServiceProtocolThis method removes all the node labels for specific nodes, and it is reachable by usingRMWSConsts.REMOVE_NODE_LABELS.- Specified by:
removeFromClusterNodeLabelsin interfaceRMWebServiceProtocol- 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
@GET @Path("/nodes/{nodeId}/get-labels") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public NodeLabelsInfo getLabelsOnNode(@Context javax.servlet.http.HttpServletRequest hsr, @PathParam("nodeId") String nodeId) throws IOException Description copied from interface:RMWebServiceProtocolThis method retrieves all the node labels for specific node, and it is reachable by usingRMWSConsts.NODES_NODEID_GETLABELS.- Specified by:
getLabelsOnNodein interfaceRMWebServiceProtocol- 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
-
killApp
protected javax.ws.rs.core.Response killApp(RMApp app, org.apache.hadoop.security.UserGroupInformation callerUGI, javax.servlet.http.HttpServletRequest hsr, String diagnostic) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
getAppPriority
@GET @Path("/apps/{appid}/priority") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public AppPriority getAppPriority(@Context javax.servlet.http.HttpServletRequest hsr, @PathParam("appid") String appId) throws org.apache.hadoop.security.authorize.AuthorizationException Description copied from interface:RMWebServiceProtocolThis method retrieves the priority for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID_PRIORITY.- Specified by:
getAppPriorityin interfaceRMWebServiceProtocol- 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
@PUT @Path("/apps/{appid}/priority") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) @Consumes({"application/json","application/xml"}) public javax.ws.rs.core.Response updateApplicationPriority(AppPriority targetPriority, @Context javax.servlet.http.HttpServletRequest hsr, @PathParam("appid") String appId) throws org.apache.hadoop.security.authorize.AuthorizationException, org.apache.hadoop.yarn.exceptions.YarnException, InterruptedException, IOException Description copied from interface:RMWebServiceProtocolThis method updates the priority for a specific application, and it is reachable by usingRMWSConsts.APPS_APPID_PRIORITY.- Specified by:
updateApplicationPriorityin interfaceRMWebServiceProtocol- 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 nullInterruptedException- if interrupted.IOException- if the update fails.
-
getAppQueue
@GET @Path("/apps/{appid}/queue") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public AppQueue getAppQueue(@Context javax.servlet.http.HttpServletRequest hsr, @PathParam("appid") String appId) throws org.apache.hadoop.security.authorize.AuthorizationException Description copied from interface:RMWebServiceProtocolThis method retrieves the queue for a specific app, and it is reachable by usingRMWSConsts.APPS_APPID_QUEUE.- Specified by:
getAppQueuein interfaceRMWebServiceProtocol- 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
@PUT @Path("/apps/{appid}/queue") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) @Consumes({"application/json","application/xml"}) public javax.ws.rs.core.Response updateAppQueue(AppQueue targetQueue, @Context javax.servlet.http.HttpServletRequest hsr, @PathParam("appid") String appId) throws org.apache.hadoop.security.authorize.AuthorizationException, org.apache.hadoop.yarn.exceptions.YarnException, InterruptedException, IOException Description copied from interface:RMWebServiceProtocolThis method updates the queue for a specific application, and it is reachable by usingRMWSConsts.APPS_APPID_QUEUE.- Specified by:
updateAppQueuein interfaceRMWebServiceProtocol- 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 foundInterruptedException- if interrupted.IOException- if the update fails.
-
moveApp
protected javax.ws.rs.core.Response moveApp(RMApp app, org.apache.hadoop.security.UserGroupInformation callerUGI, String targetQueue) throws IOException, InterruptedException - Throws:
IOExceptionInterruptedException
-
createNewApplication
@POST @Path("/apps/new-application") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public javax.ws.rs.core.Response createNewApplication(@Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException Description copied from interface:RMWebServiceProtocolGenerates a new ApplicationId which is then sent to the client. This method is reachable by usingRMWSConsts.APPS_NEW_APPLICATION.- Specified by:
createNewApplicationin interfaceRMWebServiceProtocol- 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
@POST @Path("/apps") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) @Consumes({"application/json","application/xml"}) public javax.ws.rs.core.Response submitApplication(ApplicationSubmissionContextInfo newApp, @Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException Description copied from interface:RMWebServiceProtocolFunction to submit an app to the RM. This method is reachable by usingRMWSConsts.APPS.- Specified by:
submitApplicationin interfaceRMWebServiceProtocol- 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
@POST @Path("/delegation-token") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) @Consumes({"application/json","application/xml"}) 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 Description copied from interface:RMWebServiceProtocolThis method posts a delegation token from the client, and it is reachable by usingRMWSConsts.DELEGATION_TOKEN.- Specified by:
postDelegationTokenin interfaceRMWebServiceProtocol- 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
@POST @Path("/delegation-token/expiration") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) @Consumes({"application/json","application/xml"}) public javax.ws.rs.core.Response postDelegationTokenExpiration(@Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException, Exception Description copied from interface:RMWebServiceProtocolThis method updates the expiration for a delegation token from the client, and it is reachable by usingRMWSConsts.DELEGATION_TOKEN_EXPIRATION.- Specified by:
postDelegationTokenExpirationin interfaceRMWebServiceProtocol- 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 requestInterruptedException- See Also:
-
ApplicationBaseProtocol.renewDelegationToken(org.apache.hadoop.yarn.api.protocolrecords.RenewDelegationTokenRequest)
-
cancelDelegationToken
@DELETE @Path("/delegation-token") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public javax.ws.rs.core.Response cancelDelegationToken(@Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException, Exception Description copied from interface:RMWebServiceProtocolThis method cancel the delegation token from the client, and it is reachable by usingRMWSConsts.DELEGATION_TOKEN.- Specified by:
cancelDelegationTokenin interfaceRMWebServiceProtocol- 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
@POST @Path("/reservation/new-reservation") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public javax.ws.rs.core.Response createNewReservation(@Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException Description copied from interface:RMWebServiceProtocolGenerates a new ReservationId which is then sent to the client. This method is reachable by usingRMWSConsts.RESERVATION_NEW.- Specified by:
createNewReservationin interfaceRMWebServiceProtocol- 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
@POST @Path("/reservation/submit") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) @Consumes({"application/json","application/xml"}) public javax.ws.rs.core.Response submitReservation(ReservationSubmissionRequestInfo resContext, @Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException Description copied from interface:RMWebServiceProtocolFunction to submit a Reservation to the RM.This method is reachable by usingRMWSConsts.RESERVATION_SUBMIT.- Specified by:
submitReservationin interfaceRMWebServiceProtocol- 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
@POST @Path("/reservation/update") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) @Consumes({"application/json","application/xml"}) public javax.ws.rs.core.Response updateReservation(ReservationUpdateRequestInfo resContext, @Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException Description copied from interface:RMWebServiceProtocolFunction to update a Reservation to the RM. This method is reachable by usingRMWSConsts.RESERVATION_UPDATE.- Specified by:
updateReservationin interfaceRMWebServiceProtocol- 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
@POST @Path("/reservation/delete") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) @Consumes({"application/json","application/xml"}) public javax.ws.rs.core.Response deleteReservation(ReservationDeleteRequestInfo resContext, @Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, IOException, InterruptedException Description copied from interface:RMWebServiceProtocolFunction to delete a Reservation to the RM. This method is reachable by usingRMWSConsts.RESERVATION_DELETE.- Specified by:
deleteReservationin interfaceRMWebServiceProtocol- 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
@GET @Path("/reservation/list") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public javax.ws.rs.core.Response listReservation(@QueryParam("queue") @DefaultValue("default") String queue, @QueryParam("reservation-id") @DefaultValue("") String reservationId, @QueryParam("start-time") @DefaultValue("0") long startTime, @QueryParam("end-time") @DefaultValue("-1") long endTime, @QueryParam("include-resource-allocations") @DefaultValue("false") boolean includeResourceAllocations, @Context javax.servlet.http.HttpServletRequest hsr) throws Exception Description copied from interface:RMWebServiceProtocolFunction to retrieve a list of all the reservations. This method is reachable by usingRMWSConsts.RESERVATION_LIST.- Specified by:
listReservationin interfaceRMWebServiceProtocol- 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
@GET @Path("/apps/{appid}/timeouts/{type}") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public AppTimeoutInfo getAppTimeout(@Context javax.servlet.http.HttpServletRequest hsr, @PathParam("appid") String appId, @PathParam("type") String type) throws org.apache.hadoop.security.authorize.AuthorizationException Description copied from interface:RMWebServiceProtocolThis method retrieves the timeout information for a specific app with a specific type, and it is reachable by usingRMWSConsts.APPS_TIMEOUTS_TYPE.- Specified by:
getAppTimeoutin interfaceRMWebServiceProtocol- 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
@GET @Path("/apps/{appid}/timeouts") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public AppTimeoutsInfo getAppTimeouts(@Context javax.servlet.http.HttpServletRequest hsr, @PathParam("appid") String appId) throws org.apache.hadoop.security.authorize.AuthorizationException Description copied from interface:RMWebServiceProtocolThis method retrieves the timeout information for a specific app, and it is reachable by usingRMWSConsts.APPS_TIMEOUTS.- Specified by:
getAppTimeoutsin interfaceRMWebServiceProtocol- 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
@PUT @Path("/apps/{appid}/timeout") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) @Consumes({"application/json","application/xml"}) public javax.ws.rs.core.Response updateApplicationTimeout(AppTimeoutInfo appTimeout, @Context javax.servlet.http.HttpServletRequest hsr, @PathParam("appid") String appId) throws org.apache.hadoop.security.authorize.AuthorizationException, org.apache.hadoop.yarn.exceptions.YarnException, InterruptedException, IOException Description copied from interface:RMWebServiceProtocolThis method updates the timeout information for a specific app, and it is reachable by usingRMWSConsts.APPS_TIMEOUT.- Specified by:
updateApplicationTimeoutin interfaceRMWebServiceProtocol- 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 requestInterruptedException- if interruptedIOException- if the operation failed- See Also:
-
ApplicationClientProtocol.updateApplicationTimeouts(org.apache.hadoop.yarn.api.protocolrecords.UpdateApplicationTimeoutsRequest)
-
getApplicationReport
protected org.apache.hadoop.yarn.api.records.ApplicationReport getApplicationReport(org.apache.hadoop.yarn.api.protocolrecords.GetApplicationReportRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException - Overrides:
getApplicationReportin classorg.apache.hadoop.yarn.server.webapp.WebServices- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOException
-
getApplicationsReport
protected List<org.apache.hadoop.yarn.api.records.ApplicationReport> getApplicationsReport(org.apache.hadoop.yarn.api.protocolrecords.GetApplicationsRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException - Overrides:
getApplicationsReportin classorg.apache.hadoop.yarn.server.webapp.WebServices- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOException
-
getApplicationAttemptReport
protected org.apache.hadoop.yarn.api.records.ApplicationAttemptReport getApplicationAttemptReport(org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptReportRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException - Overrides:
getApplicationAttemptReportin classorg.apache.hadoop.yarn.server.webapp.WebServices- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOException
-
getApplicationAttemptsReport
protected List<org.apache.hadoop.yarn.api.records.ApplicationAttemptReport> getApplicationAttemptsReport(org.apache.hadoop.yarn.api.protocolrecords.GetApplicationAttemptsRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException - Overrides:
getApplicationAttemptsReportin classorg.apache.hadoop.yarn.server.webapp.WebServices- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOException
-
getContainerReport
protected org.apache.hadoop.yarn.api.records.ContainerReport getContainerReport(org.apache.hadoop.yarn.api.protocolrecords.GetContainerReportRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException - Overrides:
getContainerReportin classorg.apache.hadoop.yarn.server.webapp.WebServices- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOException
-
getContainersReport
protected List<org.apache.hadoop.yarn.api.records.ContainerReport> getContainersReport(org.apache.hadoop.yarn.api.protocolrecords.GetContainersRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException - Overrides:
getContainersReportin classorg.apache.hadoop.yarn.server.webapp.WebServices- Throws:
org.apache.hadoop.yarn.exceptions.YarnExceptionIOException
-
formatSchedulerConfiguration
@GET @Path("/scheduler-conf/format") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public javax.ws.rs.core.Response formatSchedulerConfiguration(@Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException - Throws:
org.apache.hadoop.security.authorize.AuthorizationException
-
validateAndGetSchedulerConfiguration
@POST @Path("/scheduler-conf/validate") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) @Consumes({"application/json","application/xml"}) public javax.ws.rs.core.Response validateAndGetSchedulerConfiguration(org.apache.hadoop.yarn.webapp.dao.SchedConfUpdateInfo mutationInfo, @Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException - Throws:
org.apache.hadoop.security.authorize.AuthorizationException
-
updateSchedulerConfiguration
@PUT @Path("/scheduler-conf") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) @Consumes({"application/json","application/xml"}) public javax.ws.rs.core.Response updateSchedulerConfiguration(org.apache.hadoop.yarn.webapp.dao.SchedConfUpdateInfo mutationInfo, @Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException, InterruptedException Description copied from interface:RMWebServiceProtocolThis method updates the Scheduler configuration, and it is reachable by usingRMWSConsts.SCHEDULER_CONF.- Specified by:
updateSchedulerConfigurationin interfaceRMWebServiceProtocol- 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
@GET @Path("/scheduler-conf") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public javax.ws.rs.core.Response getSchedulerConfiguration(@Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException Description copied from interface:RMWebServiceProtocolThis method retrieves all the Scheduler configuration, and it is reachable by usingRMWSConsts.SCHEDULER_CONF.- Specified by:
getSchedulerConfigurationin interfaceRMWebServiceProtocol- 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.
-
getSchedulerConfigurationVersion
@GET @Path("/scheduler-conf/version") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public javax.ws.rs.core.Response getSchedulerConfigurationVersion(@Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException - Throws:
org.apache.hadoop.security.authorize.AuthorizationException
-
checkUserAccessToQueue
@GET @Path("/queues/{queue}/access") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public RMQueueAclInfo checkUserAccessToQueue(@PathParam("queue") String queue, @QueryParam("user") String username, @QueryParam("queue-acl-type") @DefaultValue("SUBMIT_APPLICATIONS") String queueAclType, @Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException Description copied from interface:RMWebServiceProtocolThis method verifies if a user has access to a specified queue.- Specified by:
checkUserAccessToQueuein interfaceRMWebServiceProtocol- 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
@POST @Path("/containers/{containerid}/signal/{command}") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) @Consumes({"application/json","application/xml"}) public javax.ws.rs.core.Response signalToContainer(@PathParam("containerid") String containerId, @PathParam("command") String command, @Context javax.servlet.http.HttpServletRequest hsr) throws org.apache.hadoop.security.authorize.AuthorizationException Description copied from interface:RMWebServiceProtocolThis method sends a signal to container.- Specified by:
signalToContainerin interfaceRMWebServiceProtocol- Parameters:
containerId- containerIdcommand- signal command, it could be OUTPUT_THREAD_DUMP/ GRACEFUL_SHUTDOWN/FORCEFUL_SHUTDOWNhsr- request- Returns:
- Response containing the status code
- Throws:
org.apache.hadoop.security.authorize.AuthorizationException- if the user is not authorized to invoke this method.
-
getSchedulerOverview
@GET @Path("/scheduler-overview") @Produces({"application/json; charset=utf-8","application/xml; charset=utf-8"}) public SchedulerOverviewInfo getSchedulerOverview() -
getAppsLRUCache
@VisibleForTesting public org.apache.hadoop.yarn.util.LRUCache<org.apache.hadoop.yarn.util.AppsCacheKey,AppsInfo> getAppsLRUCache() -
setResponse
@VisibleForTesting public void setResponse(javax.servlet.http.HttpServletResponse response)
-