Package org.apache.storm.daemon.supervisor

## Class LocalContainer

- java.lang.Object
- - org.apache.storm.daemon.supervisor.Container
  - - org.apache.storm.daemon.supervisor.LocalContainer

- All Implemented Interfaces:
    `Killable`

      public class LocalContainer
      extends Container

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.storm.daemon.supervisor.Container

      `Container.ContainerType`

  - ### Field Summary

    - ### Fields inherited from class org.apache.storm.daemon.supervisor.Container

      `assignment, conf, containerMemoryTracker, ops, port, resourceIsolationManager, runAsUser, supervisorId, supervisorPort, symlinksDisabled, topoConf, topologyId, type, workerId`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `LocalContainer​(Map<String,​Object> conf, String supervisorId, int supervisorPort, int port, LocalAssignment assignment, IContext sharedContext, StormMetricsRegistry metricsRegistry, ContainerMemoryTracker containerMemoryTracker, Supervisor.Iface localSupervisor)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `areAllProcessesDead()` | Check whether all processes are dead.
    `protected void` | `createArtifactsLink()` | Create symlink from the containers directory/artifacts to the artifacts directory.
    `protected void` | `createBlobstoreLinks()` | Create symlinks for each of the blobs from the container's directory to corresponding links in the storm dist directory.
    `boolean` | `didMainProcessExit()` | Return true if the main process exited, else false.
    `void` | `kill()` | Kill the processes in this container nicely.
    `void` | `launch()` | Launch the process for the first time.
    `void` | `relaunch()` | Restart the processes in this container.
    `boolean` | `runProfiling​(ProfileRequest request, boolean stop)` | Run a profiling request.

    - ### Methods inherited from class org.apache.storm.daemon.supervisor.Container

      `cleanUp, cleanUpForRestart, deleteSavedWorkerUser, forceKill, getMemoryReservationMb, getMemoryUsageMb, getTotalTopologyMemoryReserved, getTotalTopologyMemoryUsed, getTotalWorkersForThisTopology, getWorkerId, getWorkerUser, isMemoryLimitViolated, readHeartbeat, readTopoConf, saveWorkerUser, setup, toString, updateMemoryAccounting, writeLogMetadata`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### LocalContainer

          public LocalContainer​(Map<String,​Object> conf,
                                String supervisorId,
                                int supervisorPort,
                                int port,
                                LocalAssignment assignment,
                                IContext sharedContext,
                                StormMetricsRegistry metricsRegistry,
                                ContainerMemoryTracker containerMemoryTracker,
                                Supervisor.Iface localSupervisor)
                         throws IOException

      Throws:
        `IOException`

  - ### Method Detail

    - #### createArtifactsLink

          protected void createArtifactsLink()

      Description copied from class: `Container`
      Create symlink from the containers directory/artifacts to the artifacts directory.
      Overrides:
        `createArtifactsLink` in class `Container`

    - #### createBlobstoreLinks

          protected void createBlobstoreLinks()

      Description copied from class: `Container`
      Create symlinks for each of the blobs from the container's directory to corresponding links in the storm dist directory.
      Overrides:
        `createBlobstoreLinks` in class `Container`

    - #### launch

          public void launch()
                      throws IOException

      Description copied from class: `Container`
      Launch the process for the first time. PREREQUISITE: setup has run and passed
      Specified by:
        `launch` in class `Container`
      Throws:
        `IOException` - on any error

    - #### kill

          public void kill()
                    throws IOException

      Description copied from interface: `Killable`
      Kill the processes in this container nicely. kill -15 equivalent
      Specified by:
        `kill` in interface `Killable`
      Overrides:
        `kill` in class `Container`
      Throws:
        `IOException` - on any error

    - #### areAllProcessesDead

          public boolean areAllProcessesDead()
                                      throws IOException

      Description copied from interface: `Killable`
      Check whether all processes are dead.
      Specified by:
        `areAllProcessesDead` in interface `Killable`
      Overrides:
        `areAllProcessesDead` in class `Container`
      Returns:
        true if all of the processes are dead, else false
      Throws:
        `IOException` - on any error

    - #### relaunch

          public void relaunch()
                        throws IOException

      Description copied from class: `Container`
      Restart the processes in this container. PREREQUISITE: cleanUpForRestart has run and passed
      Specified by:
        `relaunch` in class `Container`
      Throws:
        `IOException` - on any error

    - #### didMainProcessExit

          public boolean didMainProcessExit()

      Description copied from class: `Container`
      Return true if the main process exited, else false. This is just best effort return false if unknown.
      Specified by:
        `didMainProcessExit` in class `Container`

    - #### runProfiling

          public boolean runProfiling​(ProfileRequest request,
                                      boolean stop)
                               throws IOException,
                                      InterruptedException

      Description copied from class: `Container`
      Run a profiling request.
      Specified by:
        `runProfiling` in class `Container`
      Parameters:
        `request` - the request to run
        `stop` - is this a stop request?
      Returns:
        true if it succeeded, else false
      Throws:
        `IOException` - on any error
        `InterruptedException` - if running the command is interrupted.