/** * This method writes out the launch environment of a container. This can be * overridden by extending ContainerExecutors to provide different behaviors * @param out the output stream to which the environment is written (usually * a script file which will be executed by the Launcher) * @param environment The environment variables and their values * @param resources The resources which have been localized for this container * Symlinks will be created to these localized resources * @param command The command that will be run. * @param logDir The log dir to copy debugging information to * @throws IOException if any errors happened writing to the OutputStream, * while creating symlinks */ public void writeLaunchEnv(OutputStream out, Map<String, String> environment, Map<Path, List<String>> resources, List<String> command, Path logDir) throws IOException { this.writeLaunchEnv(out, environment, resources, command, logDir, ContainerLaunch.CONTAINER_SCRIPT); }
/** * This method writes out the launch environment of a container to the * default container launch script. For the default container script path see * {@link ContainerLaunch#CONTAINER_SCRIPT}. * * @param out the output stream to which the environment is written (usually * a script file which will be executed by the Launcher) * @param environment the environment variables and their values * @param resources the resources which have been localized for this * container. Symlinks will be created to these localized resources * @param command the command that will be run * @param logDir the log dir to which to copy debugging information * @param user the username of the job owner * @param nmVars the set of environment vars that are explicitly set by NM * @throws IOException if any errors happened writing to the OutputStream, * while creating symlinks */ public void writeLaunchEnv(OutputStream out, Map<String, String> environment, Map<Path, List<String>> resources, List<String> command, Path logDir, String user, LinkedHashSet<String> nmVars) throws IOException { this.writeLaunchEnv(out, environment, resources, command, logDir, user, ContainerLaunch.CONTAINER_SCRIPT, nmVars); }
exec.writeLaunchEnv(containerScriptOutStream, environment, localResources, launchContext.getCommands());
exec.writeLaunchEnv(containerScriptOutStream, environment, localResources, launchContext.getCommands());
exec.writeLaunchEnv(containerScriptOutStream, environment, localResources, launchContext.getCommands(), new Path(containerLogDirs.get(0)));
exec.writeLaunchEnv(containerScriptOutStream, environment, localResources, launchContext.getCommands(), containerLogDir, user, nmEnvVars);