@InterfaceAudience.Private @InterfaceStability.Unstable public class DelegatingLinuxContainerRuntime extends Object implements LinuxContainerRuntime
ContainerRuntime
implementation that delegates all
operations to a DefaultLinuxContainerRuntime
instance, a
DockerLinuxContainerRuntime
instance, a
JavaSandboxLinuxContainerRuntime
instance, or a custom instance
depending on whether each instance believes the operation to be within its
scope.Constructor and Description |
---|
DelegatingLinuxContainerRuntime() |
Modifier and Type | Method and Description |
---|---|
org.apache.hadoop.hdfs.protocol.datatransfer.IOStreamPair |
execContainer(ContainerExecContext ctx)
Run a program in container.
|
String |
getExposedPorts(Container container)
Return the exposed ports of the container.
|
String[] |
getIpAndHost(Container container)
Return the host and ip of the container.
|
Map<String,org.apache.hadoop.yarn.api.records.LocalResource> |
getLocalResources(Container container) |
void |
initialize(org.apache.hadoop.conf.Configuration conf,
Context nmContext)
Initialize the runtime.
|
boolean |
isRuntimeRequested(Map<String,String> env)
Return whether the given environment variables indicate that the operation
is requesting this 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 |
relaunchContainer(ContainerRuntimeContext ctx)
Relaunch a container.
|
void |
signalContainer(ContainerRuntimeContext ctx)
Signal a container.
|
void |
start() |
void |
stop() |
public void initialize(org.apache.hadoop.conf.Configuration conf, Context nmContext) throws ContainerExecutionException
LinuxContainerRuntime
initialize
in interface LinuxContainerRuntime
conf
- the Configuration
to usenmContext
- NMContextContainerExecutionException
- if an error occurs while initializing
the runtimepublic boolean isRuntimeRequested(Map<String,String> env)
LinuxContainerRuntime
isRuntimeRequested
in interface LinuxContainerRuntime
env
- the environment variable settings for the operationpublic 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 relaunchContainer(ContainerRuntimeContext ctx) throws ContainerExecutionException
ContainerRuntime
relaunchContainer
in interface ContainerRuntime
ctx
- the ContainerRuntimeContext
ContainerExecutionException
- if an error occurs while relaunching
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 hostnamepublic String getExposedPorts(Container container) throws ContainerExecutionException
ContainerRuntime
getExposedPorts
in interface ContainerRuntime
container
- the Container
ContainerExecutionException
- if an error occurs while getting
the exposed portspublic org.apache.hadoop.hdfs.protocol.datatransfer.IOStreamPair execContainer(ContainerExecContext ctx) throws ContainerExecutionException
ContainerRuntime
execContainer
in interface ContainerRuntime
ctx
- the ContainerExecContext
ContainerExecutionException
public Map<String,org.apache.hadoop.yarn.api.records.LocalResource> getLocalResources(Container container) throws IOException
getLocalResources
in interface LinuxContainerRuntime
IOException
public void start()
start
in interface LinuxContainerRuntime
public void stop()
stop
in interface LinuxContainerRuntime
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.