Class ResourceHandlerModule
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.ResourceHandlerModule
Provides mechanisms to get various resource handlers - cpu, memory, network,
disk etc., - based on configuration.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CGroupsHandlerReturns a (possibly null) reference to a cGroupsHandler.static StringReturns relative root for cgroups.static ResourceHandlerChaingetConfiguredResourceHandlerChain(org.apache.hadoop.conf.Configuration conf, Context nmContext) static CpuResourceHandlerstatic DiskResourceHandlerstatic MemoryResourceHandlerstatic ResourceHandlergetNetworkTaggingHandler(org.apache.hadoop.conf.Configuration conf) static DiskResourceHandlerinitDiskResourceHandler(org.apache.hadoop.conf.Configuration conf) static MemoryResourceHandlerinitMemoryResourceHandler(org.apache.hadoop.conf.Configuration conf) static ResourceHandlerinitNetworkResourceHandler(org.apache.hadoop.conf.Configuration conf) initOutboundBandwidthResourceHandler(org.apache.hadoop.conf.Configuration conf) parseConfiguredCGroupPath(String cgroupMountPath) If a cgroup mount directory is specified, it returns cgroup directories with valid names.
-
Constructor Details
-
ResourceHandlerModule
public ResourceHandlerModule()
-
-
Method Details
-
getCGroupsHandler
Returns a (possibly null) reference to a cGroupsHandler. This handler is non-null only if one or more of the known cgroups-based resource handlers are in use and have been initialized. -
getCgroupsRelativeRoot
Returns relative root for cgroups. Returns null if cGroupsHandler is not initialized, or if the path is empty. -
getNetworkResourceHandler
-
getDiskResourceHandler
-
getMemoryResourceHandler
-
getCpuResourceHandler
-
initNetworkResourceHandler
public static ResourceHandler initNetworkResourceHandler(org.apache.hadoop.conf.Configuration conf) throws ResourceHandlerException - Throws:
ResourceHandlerException
-
getNetworkTaggingHandler
public static ResourceHandler getNetworkTaggingHandler(org.apache.hadoop.conf.Configuration conf) throws ResourceHandlerException - Throws:
ResourceHandlerException
-
initOutboundBandwidthResourceHandler
public static OutboundBandwidthResourceHandler initOutboundBandwidthResourceHandler(org.apache.hadoop.conf.Configuration conf) throws ResourceHandlerException - Throws:
ResourceHandlerException
-
initDiskResourceHandler
public static DiskResourceHandler initDiskResourceHandler(org.apache.hadoop.conf.Configuration conf) throws ResourceHandlerException - Throws:
ResourceHandlerException
-
initMemoryResourceHandler
public static MemoryResourceHandler initMemoryResourceHandler(org.apache.hadoop.conf.Configuration conf) throws ResourceHandlerException - Throws:
ResourceHandlerException
-
getConfiguredResourceHandlerChain
public static ResourceHandlerChain getConfiguredResourceHandlerChain(org.apache.hadoop.conf.Configuration conf, Context nmContext) throws ResourceHandlerException - Throws:
ResourceHandlerException
-
parseConfiguredCGroupPath
public static Map<String,Set<String>> parseConfiguredCGroupPath(String cgroupMountPath) throws IOException If a cgroup mount directory is specified, it returns cgroup directories with valid names. The requirement is that each hierarchy has to be named with the comma separated names of subsystems supported. For example: /sys/fs/cgroup/cpu,cpuacct- Parameters:
cgroupMountPath- Root cgroup mount path (/sys/fs/cgroup in the example above)- Returns:
- A path to cgroup subsystem set mapping in the same format as
AbstractCGroupsHandler.parseMtab(String) - Throws:
IOException- if the specified directory cannot be listed
-