Package com.linkedin.venice.utils
Class ForkedJavaProcess
java.lang.Object
java.lang.Process
com.linkedin.venice.utils.ForkedJavaProcess
Adapted from https://stackoverflow.com/a/723914/791758
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()static ForkedJavaProcessstatic ForkedJavaProcessstatic ForkedJavaProcessstatic ForkedJavaProcessexec(Class appClass, List<String> args, List<String> jvmArgs, boolean killOnExit, Optional<LogContext> loggerPrefix) static ForkedJavaProcessexec(Class appClass, List<String> args, List<String> jvmArgs, String classPath, boolean killOnExit, Optional<LogContext> logContext) intstatic Stringlongpid()static voidintwaitFor()Methods inherited from class java.lang.Process
children, descendants, destroyForcibly, errorReader, errorReader, info, inputReader, inputReader, isAlive, onExit, outputWriter, outputWriter, supportsNormalTermination, toHandle, waitFor
-
Method Details
-
exec
public static ForkedJavaProcess exec(Class appClass, List<String> args, List<String> jvmArgs, String classPath, boolean killOnExit, Optional<LogContext> logContext) throws IOException - Throws:
IOException
-
exec
public static ForkedJavaProcess exec(Class appClass, List<String> args, List<String> jvmArgs, boolean killOnExit, Optional<LogContext> loggerPrefix) throws IOException - Throws:
IOException
-
exec
public static ForkedJavaProcess exec(Class appClass, List<String> args, List<String> jvmArgs, boolean killOnExit) throws IOException - Throws:
IOException
-
exec
public static ForkedJavaProcess exec(Class appClass, List<String> args, List<String> jvmArgs) throws IOException - Throws:
IOException
-
exec
- Throws:
IOException
-
getClasspath
-
destroy
public void destroy() -
processAndExtractLevelFromForkedProcessLog
public static void processAndExtractLevelFromForkedProcessLog(ForkedJavaProcess.LogInfo logInfo, String log) -
pid
public long pid() -
getOutputStream
- Specified by:
getOutputStreamin classProcess
-
getInputStream
- Specified by:
getInputStreamin classProcess
-
getErrorStream
- Specified by:
getErrorStreamin classProcess
-
waitFor
- Specified by:
waitForin classProcess- Throws:
InterruptedException
-
exitValue
public int exitValue()
-