public class ExecutableManager extends Object
ExecutableManager
manages an external executable which processes data
in a Pig query.
The ExecutableManager
is responsible for startup/teardown of
the external process and also for managing it. It feeds input records to the
executable via it's stdin
, collects the output records from
the stdout
and also diagnostic information from the
stdout
.Modifier and Type | Field and Description |
---|---|
protected StreamingCommand |
command |
protected int |
exitCode |
protected long |
inputBytes |
protected long |
inputRecords |
protected Throwable |
outerrThreadsError |
protected long |
outputBytes |
protected long |
outputRecords |
protected DataOutputStream |
stdin |
Constructor and Description |
---|
ExecutableManager()
Create a new
ExecutableManager . |
Modifier and Type | Method and Description |
---|---|
void |
close()
Close and cleanup the
ExecutableManager . |
void |
configure(POStream stream)
Configure and initialize the
ExecutableManager . |
protected void |
exec()
Start execution of the external process.
|
protected void |
processError(String error)
Workhorse to process the stderr stream of the managed process.
|
void |
run()
Start execution of the
ExecutableManager . |
protected StreamingCommand command
protected int exitCode
protected DataOutputStream stdin
protected long inputRecords
protected long inputBytes
protected long outputRecords
protected long outputBytes
protected volatile Throwable outerrThreadsError
public ExecutableManager()
ExecutableManager
.public void configure(POStream stream) throws IOException, ExecException
ExecutableManager
.stream
- POStream operatorIOException
ExecException
public void close() throws IOException
ExecutableManager
.IOException
protected void exec() throws IOException
stderr
of
the managed process.IOException
public void run() throws IOException
ExecutableManager
.IOException
protected void processError(String error)
ExecuatbleManager
just sends out the received
error message to the stderr
of itself.error
- error message from the managed process.Copyright © 2007-2012 The Apache Software Foundation