Package org.apache.storm.utils

# Class ShellProcess

java.lang.Object
org.apache.storm.utils.ShellProcess

All Implemented Interfaces:
  `Serializable`

public class ShellProcess extends Object implements Serializable

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `String`
  `componentName`
  `static final org.slf4j.Logger`
  `LOG`
  `Number`
  `pid`
  `ISerializer`
  `serializer`
  `static org.slf4j.Logger`
  `ShellLogger`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ShellProcess(String[] command)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `destroy()`
  `String`
  `getComponentName()`
  `String`
  `getErrorsString()`
  `int`
  `getExitCode()`
  Get exit code.
  `Number`
  `getPid()`
  Get PID.
  `String`
  `getProcessInfoString()`
  `String`
  `getProcessTerminationInfoString()`
  `Number`
  `launch(Map<String,Object> conf, TopologyContext context)`
  `Number`
  `launch(Map<String,Object> conf, TopologyContext context, boolean changeDirectory)`
  `void`
  `logErrorStream()`
  `ShellMsg`
  `readShellMsg()`
  `void`
  `setEnv(Map<String,String> env)`
  `void`
  `writeBoltMsg(BoltMsg msg)`
  `void`
  `writeSpoutMsg(SpoutMsg msg)`
  `void`
  `writeTaskIds(List<Integer> taskIds)`

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

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

- ## Field Details

  - ### LOG

    public static final org.slf4j.Logger LOG

  - ### ShellLogger

    public static org.slf4j.Logger ShellLogger

  - ### serializer

    public ISerializer serializer

  - ### pid

    public Number pid

  - ### componentName

    public String componentName

- ## Constructor Details

  - ### ShellProcess

    public ShellProcess(String[] command)

- ## Method Details

  - ### setEnv

    public void setEnv(Map<String,String> env)

  - ### launch

    public Number launch(Map<String,Object> conf, TopologyContext context)

  - ### launch

    public Number launch(Map<String,Object> conf, TopologyContext context, boolean changeDirectory)

  - ### destroy

    public void destroy()

  - ### readShellMsg

    public ShellMsg readShellMsg() throws IOException
    Throws:
      `IOException`

  - ### writeBoltMsg

    public void writeBoltMsg(BoltMsg msg) throws IOException
    Throws:
      `IOException`

  - ### writeSpoutMsg

    public void writeSpoutMsg(SpoutMsg msg) throws IOException
    Throws:
      `IOException`

  - ### writeTaskIds

    public void writeTaskIds(List<Integer> taskIds) throws IOException
    Throws:
      `IOException`

  - ### logErrorStream

    public void logErrorStream()

  - ### getErrorsString

    public String getErrorsString()

  - ### getPid

    public Number getPid()
    Get PID.
    Returns:
      pid, if the process has been launched, null otherwise.

  - ### getComponentName

    public String getComponentName()

  - ### getExitCode

    public int getExitCode()
    Get exit code.
    Returns:
      exit code of the process if process is terminated, -1 if process is not started or terminated.

  - ### getProcessInfoString

    public String getProcessInfoString()

  - ### getProcessTerminationInfoString

    public String getProcessTerminationInfoString()