3636/**
3737 * A helper to control a {@link Process} running the main Elasticsearch server.
3838 *
39- * <p> The process can be started by calling {@link #start(Terminal, ProcessInfo, ServerArgs, Path )}.
39+ * <p> The process can be started by calling {@link #start(Terminal, ProcessInfo, ServerArgs)}.
4040 * The process is controlled by internally sending arguments and control signals on stdin,
4141 * and receiving control signals on stderr. The start method does not return until the
4242 * server is ready to process requests and has exited the bootstrap thread.
@@ -66,8 +66,7 @@ public class ServerProcess {
6666
6767 // this allows mocking the process building by tests
6868 interface OptionsBuilder {
69- List <String > getJvmOptions (Path configDir , Path pluginsDir , Path tmpDir , String envOptions ) throws InterruptedException ,
70- IOException , UserException ;
69+ List <String > getJvmOptions (Path configDir , Path tmpDir , String envOptions ) throws InterruptedException , IOException , UserException ;
7170 }
7271
7372 // this allows mocking the process building by tests
@@ -81,20 +80,18 @@ interface ProcessStarter {
8180 * @param terminal A terminal to connect the standard inputs and outputs to for the new process.
8281 * @param processInfo Info about the current process, for passing through to the subprocess.
8382 * @param args Arguments to the server process.
84- * @param pluginsDir The directory in which plugins can be found
8583 * @return A running server process that is ready for requests
8684 * @throws UserException If the process failed during bootstrap
8785 */
88- public static ServerProcess start (Terminal terminal , ProcessInfo processInfo , ServerArgs args , Path pluginsDir ) throws UserException {
89- return start (terminal , processInfo , args , pluginsDir , JvmOptionsParser ::determineJvmOptions , ProcessBuilder ::start );
86+ public static ServerProcess start (Terminal terminal , ProcessInfo processInfo , ServerArgs args ) throws UserException {
87+ return start (terminal , processInfo , args , JvmOptionsParser ::determineJvmOptions , ProcessBuilder ::start );
9088 }
9189
9290 // package private so tests can mock options building and process starting
9391 static ServerProcess start (
9492 Terminal terminal ,
9593 ProcessInfo processInfo ,
9694 ServerArgs args ,
97- Path pluginsDir ,
9895 OptionsBuilder optionsBuilder ,
9996 ProcessStarter processStarter
10097 ) throws UserException {
@@ -103,7 +100,7 @@ static ServerProcess start(
103100
104101 boolean success = false ;
105102 try {
106- jvmProcess = createProcess (processInfo , args .configDir (), pluginsDir , optionsBuilder , processStarter );
103+ jvmProcess = createProcess (processInfo , args .configDir (), optionsBuilder , processStarter );
107104 errorPump = new ErrorPumpThread (terminal .getErrorWriter (), jvmProcess .getErrorStream ());
108105 errorPump .start ();
109106 sendArgs (args , jvmProcess .getOutputStream ());
@@ -138,7 +135,7 @@ public long pid() {
138135 /**
139136 * Detaches the server process from the current process, enabling the current process to exit.
140137 *
141- * @throws IOException If an I/O error occured while reading stderr or closing any of the standard streams
138+ * @throws IOException If an I/O error occurred while reading stderr or closing any of the standard streams
142139 */
143140 public synchronized void detach () throws IOException {
144141 errorPump .drain ();
@@ -178,7 +175,7 @@ private static void sendArgs(ServerArgs args, OutputStream processStdin) {
178175 args .writeTo (out );
179176 out .flush ();
180177 } catch (IOException ignore ) {
181- // A failure to write here means the process has problems, and it will die anyways . We let this fall through
178+ // A failure to write here means the process has problems, and it will die anyway . We let this fall through
182179 // so the pump thread can complete, writing out the actual error. All we get here is the failure to write to
183180 // the process pipe, which isn't helpful to print.
184181 }
@@ -198,7 +195,6 @@ private void sendShutdownMarker() {
198195 private static Process createProcess (
199196 ProcessInfo processInfo ,
200197 Path configDir ,
201- Path pluginsDir ,
202198 OptionsBuilder optionsBuilder ,
203199 ProcessStarter processStarter
204200 ) throws InterruptedException , IOException , UserException {
@@ -208,7 +204,7 @@ private static Process createProcess(
208204 envVars .put ("LIBFFI_TMPDIR" , tempDir .toString ());
209205 }
210206
211- List <String > jvmOptions = optionsBuilder .getJvmOptions (configDir , pluginsDir , tempDir , envVars .remove ("ES_JAVA_OPTS" ));
207+ List <String > jvmOptions = optionsBuilder .getJvmOptions (configDir , tempDir , envVars .remove ("ES_JAVA_OPTS" ));
212208 // also pass through distribution type
213209 jvmOptions .add ("-Des.distribution.type=" + processInfo .sysprops ().get ("es.distribution.type" ));
214210
@@ -233,7 +229,7 @@ private static Process createProcess(
233229 /**
234230 * Returns the java.io.tmpdir Elasticsearch should use, creating it if necessary.
235231 *
236- * <p> On non-Windows OS, this will be created as a sub-directory of the default temporary directory.
232+ * <p> On non-Windows OS, this will be created as a subdirectory of the default temporary directory.
237233 * Note that this causes the created temporary directory to be a private temporary directory.
238234 */
239235 private static Path setupTempDir (ProcessInfo processInfo , String tmpDirOverride ) throws UserException , IOException {
0 commit comments