Search in sources :

Example 21 with ShellCommandExecutor

use of org.apache.hadoop.util.Shell.ShellCommandExecutor in project hadoop by apache.

the class WindowsBasedProcessTree method getAllProcessInfoFromShell.

// helper method to override while testing
String getAllProcessInfoFromShell() {
    try {
        ShellCommandExecutor shellExecutor = new ShellCommandExecutor(new String[] { Shell.getWinUtilsFile().getCanonicalPath(), "task", "processList", taskProcessId });
        shellExecutor.execute();
        return shellExecutor.getOutput();
    } catch (IOException e) {
        LOG.error(StringUtils.stringifyException(e));
    }
    return null;
}
Also used : ShellCommandExecutor(org.apache.hadoop.util.Shell.ShellCommandExecutor) IOException(java.io.IOException)

Aggregations

ShellCommandExecutor (org.apache.hadoop.util.Shell.ShellCommandExecutor)21 IOException (java.io.IOException)19 ExitCodeException (org.apache.hadoop.util.Shell.ExitCodeException)6 Test (org.junit.Test)3 File (java.io.File)2 ZipFile (java.util.zip.ZipFile)2 BufferedReader (java.io.BufferedReader)1 FileNotFoundException (java.io.FileNotFoundException)1 StringReader (java.io.StringReader)1 ArrayList (java.util.ArrayList)1 Configuration (org.apache.hadoop.conf.Configuration)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 Path (org.apache.hadoop.fs.Path)1 DistributedFileSystem (org.apache.hadoop.hdfs.DistributedFileSystem)1 MiniDFSCluster (org.apache.hadoop.hdfs.MiniDFSCluster)1 TestContext (org.apache.hadoop.test.MultithreadedTestUtil.TestContext)1 Shell (org.apache.hadoop.util.Shell)1 YarnException (org.apache.hadoop.yarn.exceptions.YarnException)1 YarnRuntimeException (org.apache.hadoop.yarn.exceptions.YarnRuntimeException)1 Matchers.anyBoolean (org.mockito.Matchers.anyBoolean)1