Class Router
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.service.CompositeService
org.apache.hadoop.yarn.server.router.Router
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service
public class Router
extends org.apache.hadoop.service.CompositeService
The router is a stateless YARN component which is the entry point to the
cluster. It can be deployed on multiple nodes behind a Virtual IP (VIP) with
a LoadBalancer.
The Router exposes the ApplicationClientProtocol (RPC and REST) to the
outside world, transparently hiding the presence of ResourceManager(s), which
allows users to request and update reservations, submit and kill
applications, and request status on running applications.
In addition, it exposes the ResourceManager Admin API.
This provides a placeholder for throttling mis-behaving clients (YARN-1546)
and masks the access to multiple RMs (YARN-3659).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.service.CompositeService
org.apache.hadoop.service.CompositeService.CompositeServiceShutdownHookNested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RouterClientRMServiceprotected RouterRMAdminServicestatic final intPriority of the Router shutdown hook.protected StringFields inherited from class org.apache.hadoop.service.CompositeService
STOP_ONLY_STARTED_SERVICES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RouterClientRMServiceprotected RouterRMAdminServiceprotected voidstatic longorg.apache.hadoop.yarn.server.webproxy.FedAppReportFetcherstatic StringgetProxyHostAndPort(org.apache.hadoop.conf.Configuration conf) org.apache.hadoop.yarn.webapp.WebAppstatic voidstatic voidremoveApplication(org.apache.hadoop.conf.Configuration conf, String applicationId) protected voidserviceInit(org.apache.hadoop.conf.Configuration config) protected voidprotected voidprotected voidshutDown()voidMethods inherited from class org.apache.hadoop.service.CompositeService
addIfService, addService, getServices, removeServiceMethods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Field Details
-
clientRMProxyService
-
rmAdminProxyService
-
webAppAddress
-
SHUTDOWN_HOOK_PRIORITY
public static final int SHUTDOWN_HOOK_PRIORITYPriority of the Router shutdown hook.- See Also:
-
-
Constructor Details
-
Router
public Router()
-
-
Method Details
-
doSecureLogin
- Throws:
IOException
-
serviceInit
- Overrides:
serviceInitin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
serviceStart
- Overrides:
serviceStartin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
serviceStop
- Overrides:
serviceStopin classorg.apache.hadoop.service.CompositeService- Throws:
Exception
-
shutDown
protected void shutDown() -
createClientRMProxyService
-
createRMAdminProxyService
-
getWebapp
@Private public org.apache.hadoop.yarn.webapp.WebApp getWebapp() -
startWepApp
@VisibleForTesting public void startWepApp() -
getProxyHostAndPort
-
main
-
getClientRMProxyService
-
getRmAdminProxyService
-
getClusterTimeStamp
public static long getClusterTimeStamp() -
getFetcher
@VisibleForTesting public org.apache.hadoop.yarn.server.webproxy.FedAppReportFetcher getFetcher() -
removeApplication
@VisibleForTesting public static void removeApplication(org.apache.hadoop.conf.Configuration conf, String applicationId) throws Exception - Throws:
Exception
-