Class ResourceHandlerChain
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.ResourceHandlerChain
- All Implemented Interfaces:
ResourceHandler
A helper class to delegate funcationality to a 'chain' of
ResourceHandler(s)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbootstrap(org.apache.hadoop.conf.Configuration configuration) Bootstrap resource susbsystem.postComplete(org.apache.hadoop.yarn.api.records.ContainerId containerId) Perform any tasks necessary after container completion.Prepare a resource environment for container launchreacquireContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId) Require state for container that was already launchedteardown()Teardown environment for resource subsystem if requested.toString()updateContainer(Container container) Update state for container that was already launched
-
Constructor Details
-
ResourceHandlerChain
-
-
Method Details
-
bootstrap
public List<PrivilegedOperation> bootstrap(org.apache.hadoop.conf.Configuration configuration) throws ResourceHandlerException Description copied from interface:ResourceHandlerBootstrap resource susbsystem.- Specified by:
bootstrapin interfaceResourceHandler- Returns:
- (possibly empty) list of operations that require elevated privileges
- Throws:
ResourceHandlerException
-
preStart
Description copied from interface:ResourceHandlerPrepare a resource environment for container launch- Specified by:
preStartin interfaceResourceHandler- Parameters:
container- Container being launched- Returns:
- (possibly empty) list of operations that require elevated privileges e.g a) create a custom cgroup b) add pid for container to tasks file for a cgroup.
- Throws:
ResourceHandlerException
-
reacquireContainer
public List<PrivilegedOperation> reacquireContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws ResourceHandlerException Description copied from interface:ResourceHandlerRequire state for container that was already launched- Specified by:
reacquireContainerin interfaceResourceHandler- Parameters:
containerId- id of the container being reacquired.- Returns:
- (possibly empty) list of operations that require elevated privileges
- Throws:
ResourceHandlerException
-
updateContainer
public List<PrivilegedOperation> updateContainer(Container container) throws ResourceHandlerException Description copied from interface:ResourceHandlerUpdate state for container that was already launched- Specified by:
updateContainerin interfaceResourceHandler- Parameters:
container- the container being updated.- Returns:
- (possibly empty) list of operations that require elevated privileges
- Throws:
ResourceHandlerException
-
postComplete
public List<PrivilegedOperation> postComplete(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws ResourceHandlerException Description copied from interface:ResourceHandlerPerform any tasks necessary after container completion.- Specified by:
postCompletein interfaceResourceHandler- Parameters:
containerId- of the container that was completed.- Returns:
- (possibly empty) list of operations that require elevated privileges
- Throws:
ResourceHandlerException
-
teardown
Description copied from interface:ResourceHandlerTeardown environment for resource subsystem if requested. This method needs to be used with care since it could impact running containers.- Specified by:
teardownin interfaceResourceHandler- Returns:
- (possibly empty) list of operations that require elevated privileges
- Throws:
ResourceHandlerException
-
getResourceHandlerList
-
toString
-