/** * Launches a sub-process that will start the configured Spark application. * <p> * The {@link #startApplication(SparkAppHandle.Listener...)} method is preferred when launching * Spark, since it provides better control of the child application. * * @return A process handle for the Spark app. */ public Process launch() throws IOException { Process childProc = createBuilder().start(); if (redirectToLog) { String loggerName = builder.getEffectiveConfig().get(CHILD_PROCESS_LOGGER_NAME); new OutputRedirector(childProc.getInputStream(), loggerName, REDIRECTOR_FACTORY); } return childProc; }
/** * Launches a sub-process that will start the configured Spark application. * <p> * The {@link #startApplication(SparkAppHandle.Listener...)} method is preferred when launching * Spark, since it provides better control of the child application. * * @return A process handle for the Spark app. */ public Process launch() throws IOException { Process childProc = createBuilder().start(); if (redirectToLog) { String loggerName = builder.getEffectiveConfig().get(CHILD_PROCESS_LOGGER_NAME); new OutputRedirector(childProc.getInputStream(), loggerName, REDIRECTOR_FACTORY); } return childProc; }
/** * Launches a sub-process that will start the configured Spark application. * <p> * The {@link #startApplication(SparkAppHandle.Listener...)} method is preferred when launching * Spark, since it provides better control of the child application. * * @return A process handle for the Spark app. */ public Process launch() throws IOException { ProcessBuilder pb = createBuilder(); boolean outputToLog = outputStream == null; boolean errorToLog = !redirectErrorStream && errorStream == null; String loggerName = getLoggerName(); if (loggerName != null && outputToLog && errorToLog) { pb.redirectErrorStream(true); } Process childProc = pb.start(); if (loggerName != null) { InputStream logStream = outputToLog ? childProc.getInputStream() : childProc.getErrorStream(); new OutputRedirector(logStream, loggerName, REDIRECTOR_FACTORY); } return childProc; }
/** * Launches a sub-process that will start the configured Spark application. * <p> * The {@link #startApplication(SparkAppHandle.Listener...)} method is preferred when launching * Spark, since it provides better control of the child application. * * @return A process handle for the Spark app. */ public Process launch() throws IOException { ProcessBuilder pb = createBuilder(); boolean outputToLog = outputStream == null; boolean errorToLog = !redirectErrorStream && errorStream == null; String loggerName = getLoggerName(); if (loggerName != null && outputToLog && errorToLog) { pb.redirectErrorStream(true); } Process childProc = pb.start(); if (loggerName != null) { InputStream logStream = outputToLog ? childProc.getInputStream() : childProc.getErrorStream(); new OutputRedirector(logStream, loggerName, REDIRECTOR_FACTORY); } return childProc; }
ProcessBuilder pb = createBuilder();
ProcessBuilder pb = createBuilder();
ProcessBuilder pb = createBuilder();
ProcessBuilder pb = createBuilder();