Class AbstractCGroupsMemoryResourceHandler
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.AbstractCGroupsMemoryResourceHandler
- All Implemented Interfaces:
MemoryResourceHandler,ResourceHandler
- Direct Known Subclasses:
CGroupsMemoryResourceHandlerImpl,CGroupsV2MemoryResourceHandlerImpl
@Unstable
@Private
public abstract class AbstractCGroupsMemoryResourceHandler
extends Object
implements MemoryResourceHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final CGroupsHandler.CGroupControllerprotected static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbootstrap(org.apache.hadoop.conf.Configuration conf) Bootstrap resource susbsystem.protected CGroupsHandlerpostComplete(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 launchedprotected abstract voidupdateGuaranteedMemoryLimits(String cgroupId, long containerSoftLimit) protected abstract voidupdateMemoryHardLimit(String cgroupId, long containerHardLimit) protected abstract voidupdateOpportunisticMemoryLimits(String cgroupId)
-
Field Details
-
MEMORY
-
OPPORTUNISTIC_SOFT_LIMIT
protected static final int OPPORTUNISTIC_SOFT_LIMIT- See Also:
-
-
Constructor Details
-
AbstractCGroupsMemoryResourceHandler
-
-
Method Details
-
getCGroupsHandler
-
bootstrap
public List<PrivilegedOperation> bootstrap(org.apache.hadoop.conf.Configuration conf) 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
-
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
-
updateMemoryHardLimit
protected abstract void updateMemoryHardLimit(String cgroupId, long containerHardLimit) throws ResourceHandlerException - Throws:
ResourceHandlerException
-
updateOpportunisticMemoryLimits
protected abstract void updateOpportunisticMemoryLimits(String cgroupId) throws ResourceHandlerException - Throws:
ResourceHandlerException
-
updateGuaranteedMemoryLimits
protected abstract void updateGuaranteedMemoryLimits(String cgroupId, long containerSoftLimit) throws ResourceHandlerException - 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
-
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
-
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
-
toString
-