Interface RESTRequestInterceptor
- All Superinterfaces:
org.apache.hadoop.conf.Configurable,org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebServiceProtocol
- All Known Implementing Classes:
AbstractRESTRequestInterceptor,DefaultRequestInterceptorREST,FederationInterceptorREST
public interface RESTRequestInterceptor
extends org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebServiceProtocol, org.apache.hadoop.conf.Configurable
Defines the contract to be implemented by the request interceptor classes,
that can be used to intercept and inspect messages sent from the client to
the resource manager server.
This class includes 4 methods getAppAttempts, getAppAttempt, getContainers
and getContainer that belong to
WebServices. They are in this class
to make sure that RouterWebServices implements the same REST methods of
RMWebServices.-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfogetAppAttempt(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String appId, String appAttemptId) org.apache.hadoop.yarn.server.webapp.dao.ContainerInfogetContainer(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String appId, String appAttemptId, String containerId) org.apache.hadoop.yarn.server.webapp.dao.ContainersInfogetContainers(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String appId, String appAttemptId) Returns the next interceptor in the chain.Get RouterClientRMService.voidThis method is called for initializing the interceptor.voidsetNextInterceptor(RESTRequestInterceptor nextInterceptor) Sets the next interceptor in the pipeline.voidsetRouterClientRMService(RouterClientRMService routerClientRMService) Set RouterClientRMService.voidshutdown()This method is called to release the resources held by the interceptor.Methods inherited from interface org.apache.hadoop.conf.Configurable
getConf, setConfMethods inherited from interface org.apache.hadoop.yarn.server.resourcemanager.webapp.RMWebServiceProtocol
addToClusterNodeLabels, cancelDelegationToken, checkUserAccessToQueue, createNewApplication, createNewReservation, deleteReservation, dumpSchedulerLogs, get, getActivities, getApp, getAppActivities, getAppAttempts, getAppPriority, getAppQueue, getApps, getAppState, getAppStatistics, getAppTimeout, getAppTimeouts, getBulkActivities, getClusterInfo, getClusterMetricsInfo, getClusterNodeLabels, getClusterUserInfo, getLabelsOnNode, getLabelsToNodes, getNode, getNodes, getNodeToLabels, getRMNodeLabels, getSchedulerConfiguration, getSchedulerInfo, listReservation, postDelegationToken, postDelegationTokenExpiration, removeFromClusterNodeLabels, replaceLabelsOnNode, replaceLabelsOnNodes, signalToContainer, submitApplication, submitReservation, updateApplicationPriority, updateApplicationTimeout, updateAppQueue, updateAppState, updateNodeResource, updateReservation, updateSchedulerConfiguration
-
Method Details
-
init
This method is called for initializing the interceptor. This is guaranteed to be called only once in the lifetime of this instance.- Parameters:
user- the name of the client
-
shutdown
void shutdown()This method is called to release the resources held by the interceptor. This will be called when the application pipeline is being destroyed. The concrete implementations should dispose the resources and forward the request to the next interceptor, if any. -
setNextInterceptor
Sets the next interceptor in the pipeline. The concrete implementation of this interface should always pass the request to the nextInterceptor after inspecting the message. The last interceptor in the chain is responsible to send the messages to the resource manager service and so the last interceptor will not receive this method call.- Parameters:
nextInterceptor- the RESTRequestInterceptor to set in the pipeline
-
getNextInterceptor
RESTRequestInterceptor getNextInterceptor()Returns the next interceptor in the chain.- Returns:
- the next interceptor in the chain
-
getAppAttempt
org.apache.hadoop.yarn.server.webapp.dao.AppAttemptInfo getAppAttempt(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String appId, String appAttemptId) - Parameters:
req- the servlet requestres- the servlet responseappId- the application we want to get the appAttempt. It is a PathParam.appAttemptId- the AppAttempt we want to get the info. It is a PathParam.- Returns:
- AppAttemptInfo of the specific AppAttempt
- See Also:
-
WebServices.getAppAttempt(HttpServletRequest, HttpServletResponse, String, String)
-
getContainers
org.apache.hadoop.yarn.server.webapp.dao.ContainersInfo getContainers(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String appId, String appAttemptId) - Parameters:
req- the servlet requestres- the servlet responseappId- the application we want to get the containers info. It is a PathParam.appAttemptId- the AppAttempt we want to get the info. It is a PathParam.- Returns:
- ContainersInfo of all the containers that belong to the specific AppAttempt
- See Also:
-
WebServices.getContainers(HttpServletRequest, HttpServletResponse, String, String)
-
getContainer
org.apache.hadoop.yarn.server.webapp.dao.ContainerInfo getContainer(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, String appId, String appAttemptId, String containerId) - Parameters:
req- the servlet requestres- the servlet responseappId- the application we want to get the containers info. It is a PathParam.appAttemptId- the AppAttempt we want to get the info. It is a PathParam.containerId- the container we want to get the info. It is a PathParam.- Returns:
- ContainerInfo of the specific ContainerId
- See Also:
-
WebServices.getContainer(HttpServletRequest, HttpServletResponse, String, String, String)
-
setRouterClientRMService
Set RouterClientRMService.- Parameters:
routerClientRMService- routerClientRMService.
-
getRouterClientRMService
RouterClientRMService getRouterClientRMService()Get RouterClientRMService.- Returns:
- RouterClientRMService
-