List of usage examples for org.apache.hadoop.util Shell WINUTILS
String WINUTILS
To view the source code for org.apache.hadoop.util Shell WINUTILS.
Click Source Link
From source file:com.lenovo.tensorhusky.common.utils.WindowsBasedProcessTree.java
License:Apache License
public static boolean isAvailable() { if (Shell.WINDOWS) { ShellCommandExecutor shellExecutor = new ShellCommandExecutor(new String[] { Shell.WINUTILS, "help" }); try {/*from w ww . ja v a 2 s. co m*/ shellExecutor.execute(); } catch (IOException e) { LOG.error(StringUtils.stringifyException(e)); } finally { String output = shellExecutor.getOutput(); if (output != null && output.contains("Prints to stdout a list of processes in the task")) { return true; } } } return false; }
From source file:com.lenovo.tensorhusky.common.utils.WindowsBasedProcessTree.java
License:Apache License
String getAllProcessInfoFromShell() {
ShellCommandExecutor shellExecutor = new ShellCommandExecutor(
new String[] { Shell.WINUTILS, "task", "processList", taskProcessId });
try {/*from w w w. ja v a 2 s .co m*/
shellExecutor.execute();
return shellExecutor.getOutput();
} catch (IOException e) {
LOG.error(StringUtils.stringifyException(e));
}
return null;
}
From source file:com.lenovo.tensorhusky.common.utils.WindowsResourceCalculatorPlugin.java
License:Apache License
String getSystemInfoInfoFromShell() {
ShellCommandExecutor shellExecutor = new ShellCommandExecutor(
new String[] { Shell.WINUTILS, "systeminfo" });
try {/* w w w.j a v a2s . c om*/
shellExecutor.execute();
return shellExecutor.getOutput();
} catch (IOException e) {
LOG.error(StringUtils.stringifyException(e));
}
return null;
}