Skip to content

Instantly share code, notes, and snippets.

@jthelin
Created March 12, 2015 18:15
Show Gist options
  • Save jthelin/afd5a64d765fae54abde to your computer and use it in GitHub Desktop.
Save jthelin/afd5a64d765fae54abde to your computer and use it in GitHub Desktop.
DShell.cmd - Simple wrapper around Hadoop's distributed shell prog org.apache.hadoop.yarn.applications.distributedshell.Client
@setlocal
@Echo OFF
if "%1" == "" (
set ShellCmd=-help
) else (
set ShellCmd=-shell_command %1
shift
)
if "%1" == "" (
set ShellArgs=
) else (
set ShellArgs=-shell_args %*
)
set HadoopCmd=%HADOOP_HOME%\bin\hadoop.cmd
call "%HadoopCmd%" org.apache.hadoop.yarn.applications.distributedshell.Client -jar "%HADOOP_HOME%\share\hadoop\yarn\hadoop-yarn-applications-distributedshell-2.6.0.jar" %ShellCmd% %ShellArgs%
if ERRORLEVEL 1 (
Echo Error %ERRORLEVEL% from DShell cmd: %ShellCmd% %ShellArgs%
exit /B %ERRORLEVEL%
) else (
Echo DShell cmd completed successfully: %ShellCmd% %ShellArgs%
exit /B 0
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment