[
https://issues.apache.org/jira/browse/YARN-1435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13838343#comment-13838343
]
Zhijie Shen commented on YARN-1435:
-----------------------------------
1. Shall we make the variables static and capitalize the names? Maybe not
specify the absolute path to bash, in case it is the other place (though it is
a rare case)?
{code}
+ private final String linux_bash_command = "/bin/bash";
+ private final String windows_command = "cmd /c";
{code}
2. Maybe it's good to change the hardcoded variables bellow to static? And some
others in Client.java?
{code}
// Hardcoded path to shell script in launch container's local env
private final String ExecShellStringPath = "ExecShellScript.sh";
// Hardcoded path to custom log_properties
private final String log4jPath = "log4j.properties";
private final String shellCommandPath = "shellCommands";
private final String shellArgsPath = "shellArgs";
{code}
3. You may want to comment why in windows, the output can not be assert
line-by-line.
{code}
+ if (Shell.WINDOWS && !count
+ && output.getName().trim().equals("stdout")) {
+ Assert.assertTrue(stdOutContent.containsAll(expectedContent));
+ }
{code}
4. Can we use copyFromLocal as well for Windows?
{code}
+ ds = new DataInputStream(new FileInputStream(shellScriptPath));
+ byte[] command = new byte[ds.available()];
+ ds.readFully(command);
+ ostream = FileSystem
+ .create(fs, shellDst, new FsPermission((short) 0710));
+ ostream.write(command);
+ } finally {
+ IOUtils.closeQuietly(ds);
+ IOUtils.closeQuietly(ostream);
+ }
{code}
> Distributed Shell should not run other commands except "sh", and run the
> custom script at the same time.
> --------------------------------------------------------------------------------------------------------
>
> Key: YARN-1435
> URL: https://issues.apache.org/jira/browse/YARN-1435
> Project: Hadoop YARN
> Issue Type: Bug
> Components: applications/distributed-shell
> Affects Versions: 2.3.0
> Reporter: Tassapol Athiapinya
> Assignee: Xuan Gong
> Attachments: YARN-1435.1.patch, YARN-1435.1.patch, YARN-1435.2.patch
>
>
> Currently, if we want to run custom script at DS. We can do it like this :
> --shell_command sh --shell_script custom_script.sh
> But it may be better to separate running shell_command and shell_script
--
This message was sent by Atlassian JIRA
(v6.1#6144)