Class ContainerLauncher
java.lang.Object
org.apache.storm.daemon.supervisor.ContainerLauncher
- Direct Known Subclasses:
- BasicContainerLauncher,- LocalContainerLauncher
Launches containers.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract ContainerlaunchContainer(int port, LocalAssignment assignment, LocalState state) Launch a container in a given slot.static ContainerLaunchermake(Map<String, Object> conf, String supervisorId, int supervisorPort, IContext sharedContext, StormMetricsRegistry metricsRegistry, ContainerMemoryTracker containerMemoryTracker, Supervisor.Iface localSupervisor) Factory to create the right container launcher for the config and the environment.abstract ContainerrecoverContainer(int port, LocalAssignment assignment, LocalState state) Recover a container for a running process.abstract KillablerecoverContainer(String workerId, LocalState localState) Try to recover a container using just the worker ID.
- 
Constructor Details- 
ContainerLauncherprotected ContainerLauncher()
 
- 
- 
Method Details- 
makepublic static ContainerLauncher make(Map<String, Object> conf, String supervisorId, int supervisorPort, IContext sharedContext, StormMetricsRegistry metricsRegistry, ContainerMemoryTracker containerMemoryTracker, Supervisor.Iface localSupervisor) throws IOExceptionFactory to create the right container launcher for the config and the environment.- Parameters:
- conf- the config
- supervisorId- the ID of the supervisor
- supervisorPort- the parent supervisor thrift server port
- sharedContext- Used in local mode to let workers talk together without netty
- metricsRegistry- The metrics registry.
- containerMemoryTracker- The shared memory tracker for the supervisor's containers
- localSupervisor- The local supervisor Thrift interface. Only used for local clusters, distributed clusters use Thrift directly.
- Returns:
- the proper container launcher
- Throws:
- IOException- on any error
 
- 
launchContainerpublic abstract Container launchContainer(int port, LocalAssignment assignment, LocalState state) throws IOException Launch a container in a given slot.- Parameters:
- port- the port to run this on
- assignment- what to launch
- state- the current state of the supervisor
- Returns:
- The container that can be used to manager the processes.
- Throws:
- IOException- on any error
 
- 
recoverContainerpublic abstract Container recoverContainer(int port, LocalAssignment assignment, LocalState state) throws IOException, ContainerRecoveryException Recover a container for a running process.- Parameters:
- port- the port the assignment is running on
- assignment- the assignment that was launched
- state- the current state of the supervisor
- Returns:
- The container that can be used to manage the processes.
- Throws:
- IOException- on any error
- ContainerRecoveryException- if the Container could not be recovered
 
- 
recoverContainerpublic abstract Killable recoverContainer(String workerId, LocalState localState) throws IOException, ContainerRecoveryException Try to recover a container using just the worker ID. The result is really only useful for killing the container and so is returning a Killable. Even if a Container is returned do not case the result to Container because only the Killable APIs are guaranteed to work.- Parameters:
- workerId- the id of the worker to use
- localState- the state of the running supervisor
- Returns:
- a Killable that can be used to kill the underlying container.
- Throws:
- IOException- on any error
- ContainerRecoveryException- if the Container could not be recovered
 
 
-