Class NetworkPacketTaggingHandlerImpl
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.NetworkPacketTaggingHandlerImpl
- All Implemented Interfaces:
ResourceHandler
@Private
@Unstable
public class NetworkPacketTaggingHandlerImpl
extends Object
implements ResourceHandler
The network packet tagging handler implementation.
-
Constructor Summary
ConstructorsConstructorDescriptionNetworkPacketTaggingHandlerImpl(PrivilegedOperationExecutor privilegedOperationExecutor, CGroupsHandler cGroupsHandler) -
Method Summary
Modifier and TypeMethodDescriptionbootstrap(org.apache.hadoop.conf.Configuration configuration) Bootstrapping network-tagging-handler - mounts net_cls controller.createNetworkTagMappingManager(org.apache.hadoop.conf.Configuration conf) postComplete(org.apache.hadoop.yarn.api.records.ContainerId containerId) Cleanup operation once container is completed - deletes cgroup.Pre-start hook for network-tagging-handler.reacquireContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId) Reacquires state for a container - reads the classid from the cgroup being used for the container being reacquired.teardown()Teardown environment for resource subsystem if requested.toString()updateContainer(Container container) Update state for container that was already launched
-
Constructor Details
-
NetworkPacketTaggingHandlerImpl
public NetworkPacketTaggingHandlerImpl(PrivilegedOperationExecutor privilegedOperationExecutor, CGroupsHandler cGroupsHandler)
-
-
Method Details
-
bootstrap
public List<PrivilegedOperation> bootstrap(org.apache.hadoop.conf.Configuration configuration) throws ResourceHandlerException Bootstrapping network-tagging-handler - mounts net_cls controller.- Specified by:
bootstrapin interfaceResourceHandler- Parameters:
configuration- yarn configuration in use- Returns:
- (potentially empty) list of privileged operations to execute.
- Throws:
ResourceHandlerException
-
preStart
Pre-start hook for network-tagging-handler. A cgroup is created and a net_cls classid is generated and written to a cgroup file.- Specified by:
preStartin interfaceResourceHandler- Parameters:
container- Container being launched- Returns:
- privileged operations for some cgroups operations.
- Throws:
ResourceHandlerException
-
reacquireContainer
public List<PrivilegedOperation> reacquireContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId) throws ResourceHandlerException Reacquires state for a container - reads the classid from the cgroup being used for the container being reacquired.- Specified by:
reacquireContainerin interfaceResourceHandler- Parameters:
containerId- if of the container being reacquired.- Returns:
- (potentially empty) list of privileged operations
- 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 Cleanup operation once container is completed - deletes cgroup.- Specified by:
postCompletein interfaceResourceHandler- Parameters:
containerId- of the container that was completed.- Returns:
- a list of PrivilegedOperations.
- 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
-
createNetworkTagMappingManager
@Private @VisibleForTesting public NetworkTagMappingManager createNetworkTagMappingManager(org.apache.hadoop.conf.Configuration conf) -
toString
-