Class ClientSupervisorUtils
- java.lang.Object
-
- org.apache.storm.daemon.supervisor.ClientSupervisorUtils
-
public class ClientSupervisorUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static com.codahale.metrics.Meter
numWorkerLaunchExceptions
-
Constructor Summary
Constructors Constructor Description ClientSupervisorUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Process
launchProcess(List<String> command, Map<String,String> environment, String logPrefix, ExitCodeCallback exitCodeCallback, File dir)
Launch a new process as perProcessBuilder
with a given callback.static Process
processLauncher(Map<String,Object> conf, String user, List<String> commandPrefix, List<String> args, Map<String,String> environment, String logPreFix, ExitCodeCallback exitCodeCallback, File dir)
static int
processLauncherAndWait(Map<String,Object> conf, String user, List<String> args, Map<String,String> environment, String logPreFix)
static int
processLauncherAndWait(Map<String,Object> conf, String user, List<String> args, Map<String,String> environment, String logPreFix, File dir)
static void
setupStormCodeDir(Map<String,Object> conf, String user, String dir)
static void
setupWorkerArtifactsDir(Map<String,Object> conf, String user, String dir)
-
-
-
Method Detail
-
processLauncherAndWait
public static int processLauncherAndWait(Map<String,Object> conf, String user, List<String> args, Map<String,String> environment, String logPreFix) throws IOException
- Throws:
IOException
-
processLauncherAndWait
public static int processLauncherAndWait(Map<String,Object> conf, String user, List<String> args, Map<String,String> environment, String logPreFix, File dir) throws IOException
- Throws:
IOException
-
processLauncher
public static Process processLauncher(Map<String,Object> conf, String user, List<String> commandPrefix, List<String> args, Map<String,String> environment, String logPreFix, ExitCodeCallback exitCodeCallback, File dir) throws IOException
- Throws:
IOException
-
launchProcess
public static Process launchProcess(List<String> command, Map<String,String> environment, String logPrefix, ExitCodeCallback exitCodeCallback, File dir) throws IOException
Launch a new process as perProcessBuilder
with a given callback.- Parameters:
command
- the command to be executed in the new processenvironment
- the environment to be applied to the process. Can be null.logPrefix
- a prefix for log entries from the output of the process. Can be null.exitCodeCallback
- code to be called passing the exit code value when the process completesdir
- the working directory of the new process- Returns:
- the new process
- Throws:
IOException
-
setupStormCodeDir
public static void setupStormCodeDir(Map<String,Object> conf, String user, String dir) throws IOException
- Throws:
IOException
-
setupWorkerArtifactsDir
public static void setupWorkerArtifactsDir(Map<String,Object> conf, String user, String dir) throws IOException
- Throws:
IOException
-
-