private CommandLineThreadWrapper executeCommand(final ExecutorService processExecutor, final String commandLine)
    throws IOException {
    ProcessBuilder builder = new ProcessBuilder(Arrays.asList(commandLine.split("\\s+")));
    builder.redirectErrorStream(true);
    Process process = builder.start();
    CommandLineThread commandLineThread = new CommandLineThread(process);
    LogStreamReader logStream = new LogStreamReader(process.getInputStream());
    Thread logStreamThread = new Thread(logStream, "LogStreamReader");
    // log collecting thread should be always put first in the executor
    processExecutor.execute(logStreamThread);
    processExecutor.execute(commandLineThread);
    return  new CommandLineThreadWrapper(commandLine, commandLineThread,
      logStreamThread, logStream, process);
  }
Execute external script command
@param processExecutor {@link ExecutorService} executes the process when threads are available in the pool
@param commandLine {String} command that starts the python process to compress config files
@return {@link CommandLineThreadWrapper}
@throws IOException
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ClientConfigResourceProvider.java