@InterfaceAudience.Private @InterfaceStability.Unstable public class DelegatingLinuxContainerRuntime extends Object implements LinuxContainerRuntime
ContainerRuntime
implementation that delegates all
operations to either a DefaultLinuxContainerRuntime
instance or a
DockerLinuxContainerRuntime
instance, depending on whether the
DockerLinuxContainerRuntime
instance believes the operation to be
requesting a Docker container.Constructor and Description |
---|
DelegatingLinuxContainerRuntime() |
Modifier and Type | Method and Description |
---|---|
String[] |
getIpAndHost(Container container)
Return the host and ip of the container
|
void |
initialize(org.apache.hadoop.conf.Configuration conf)
Initialize the runtime.
|
void |
launchContainer(ContainerRuntimeContext ctx)
Launch a container.
|
void |
prepareContainer(ContainerRuntimeContext ctx)
Prepare a container to be ready for launch.
|
void |
reapContainer(ContainerRuntimeContext ctx)
Perform any container cleanup that may be required.
|
void |
signalContainer(ContainerRuntimeContext ctx)
Signal a container.
|
boolean |
useWhitelistEnv(Map<String,String> env)
Whether to propagate the whitelist of environment variables from the
nodemanager environment into the container environment.
|
public void initialize(org.apache.hadoop.conf.Configuration conf) throws ContainerExecutionException
LinuxContainerRuntime
initialize
in interface LinuxContainerRuntime
conf
- the Configuration
to useContainerExecutionException
- if an error occurs while initializing
the runtimepublic boolean useWhitelistEnv(Map<String,String> env)
ContainerRuntime
useWhitelistEnv
in interface ContainerRuntime
env
- the container's environment variablesYarnConfiguration.NM_ENV_WHITELIST
public void prepareContainer(ContainerRuntimeContext ctx) throws ContainerExecutionException
ContainerRuntime
prepareContainer
in interface ContainerRuntime
ctx
- the ContainerRuntimeContext
ContainerExecutionException
- if an error occurs while preparing
the containerpublic void launchContainer(ContainerRuntimeContext ctx) throws ContainerExecutionException
ContainerRuntime
launchContainer
in interface ContainerRuntime
ctx
- the ContainerRuntimeContext
ContainerExecutionException
- if an error occurs while launching
the containerpublic void signalContainer(ContainerRuntimeContext ctx) throws ContainerExecutionException
ContainerRuntime
signalContainer
in interface ContainerRuntime
ctx
- the ContainerRuntimeContext
ContainerExecutionException
- if an error occurs while signaling
the containerpublic void reapContainer(ContainerRuntimeContext ctx) throws ContainerExecutionException
ContainerRuntime
reapContainer
in interface ContainerRuntime
ctx
- the ContainerRuntimeContext
ContainerExecutionException
- if an error occurs while reaping
the containerpublic String[] getIpAndHost(Container container) throws ContainerExecutionException
ContainerRuntime
getIpAndHost
in interface ContainerRuntime
container
- the Container
ContainerExecutionException
- if an error occurs while getting the ip
and hostnameCopyright © 2018 Apache Software Foundation. All Rights Reserved.