Module datarush.library
Class LocalCommandRunner
java.lang.Object
com.pervasive.datarush.operators.io.vectorwise.LocalCommandRunner
- All Implemented Interfaces:
CommandRunner
Run a command on the local machine using a locally started process.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Clean up any resources that were acquired to execute shell commands.voidInitialization required before executing a command.intrunCommand(List<String> args, InputStream stdIn, OutputStream stdOut, OutputStream stdErr) Run the specified command.
-
Constructor Details
-
LocalCommandRunner
public LocalCommandRunner()
-
-
Method Details
-
initialize
public void initialize()Description copied from interface:CommandRunnerInitialization required before executing a command.- Specified by:
initializein interfaceCommandRunner
-
runCommand
public int runCommand(List<String> args, InputStream stdIn, OutputStream stdOut, OutputStream stdErr) throws IOException Description copied from interface:CommandRunnerRun the specified command. The given input stream is passed to the command as it's standard input. The standard output and standard error are captured in the given output streams. The exit code of the command as passed by the execution shell is returned.- Specified by:
runCommandin interfaceCommandRunner- Parameters:
args- list of arguments for the command line executionstdIn- input stream used as standard instdOut- output stream that captures standard outstdErr- output stream that captures standard err- Returns:
- exit code of the shell command
- Throws:
IOException- thrown if any errors occur
-
dispose
public void dispose()Description copied from interface:CommandRunnerClean up any resources that were acquired to execute shell commands. This method should always be called even if any errors occur running shell commands.- Specified by:
disposein interfaceCommandRunner
-