Class CGroupsMemoryResourceHandlerImpl
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.AbstractCGroupsMemoryResourceHandler
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.CGroupsMemoryResourceHandlerImpl
- All Implemented Interfaces:
MemoryResourceHandler,ResourceHandler
@Private
@Unstable
public class CGroupsMemoryResourceHandlerImpl
extends AbstractCGroupsMemoryResourceHandler
Handler class to handle the memory controller. YARN already ships a
physical memory monitor in Java but it isn't as
good as CGroups. This handler sets the soft and hard memory limits. The soft
limit is set to 90% of the hard limit.
-
Field Summary
Fields inherited from class org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.AbstractCGroupsMemoryResourceHandler
MEMORY, OPPORTUNISTIC_SOFT_LIMIT -
Method Summary
Modifier and TypeMethodDescriptionbootstrap(org.apache.hadoop.conf.Configuration conf) Bootstrap resource susbsystem.protected voidupdateGuaranteedMemoryLimits(String cgroupId, long containerSoftLimit) protected voidupdateMemoryHardLimit(String cgroupId, long containerHardLimit) protected voidupdateOpportunisticMemoryLimits(String cgroupId) Methods inherited from class org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.AbstractCGroupsMemoryResourceHandler
getCGroupsHandler, postComplete, preStart, reacquireContainer, teardown, toString, updateContainer
-
Method Details
-
bootstrap
public List<PrivilegedOperation> bootstrap(org.apache.hadoop.conf.Configuration conf) throws ResourceHandlerException Description copied from interface:ResourceHandlerBootstrap resource susbsystem.- Specified by:
bootstrapin interfaceResourceHandler- Overrides:
bootstrapin classAbstractCGroupsMemoryResourceHandler- Returns:
- (possibly empty) list of operations that require elevated privileges
- Throws:
ResourceHandlerException
-
updateMemoryHardLimit
protected void updateMemoryHardLimit(String cgroupId, long containerHardLimit) throws ResourceHandlerException - Specified by:
updateMemoryHardLimitin classAbstractCGroupsMemoryResourceHandler- Throws:
ResourceHandlerException
-
updateOpportunisticMemoryLimits
- Specified by:
updateOpportunisticMemoryLimitsin classAbstractCGroupsMemoryResourceHandler- Throws:
ResourceHandlerException
-
updateGuaranteedMemoryLimits
protected void updateGuaranteedMemoryLimits(String cgroupId, long containerSoftLimit) throws ResourceHandlerException - Specified by:
updateGuaranteedMemoryLimitsin classAbstractCGroupsMemoryResourceHandler- Throws:
ResourceHandlerException
-