public class ExecutableManager
extends java.lang.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 java.lang.Throwable |
outerrThreadsError |
protected long |
outputBytes |
protected long |
outputRecords |
protected java.io.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(java.lang.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 java.io.DataOutputStream stdin
protected long inputRecords
protected long inputBytes
protected long outputRecords
protected long outputBytes
protected volatile java.lang.Throwable outerrThreadsError
public ExecutableManager()
ExecutableManager
.public void configure(POStream stream) throws java.io.IOException, ExecException
ExecutableManager
.stream
- POStream operatorjava.io.IOException
ExecException
public void close() throws java.io.IOException
ExecutableManager
.java.io.IOException
protected void exec() throws java.io.IOException
stderr
of
the managed process.java.io.IOException
public void run() throws java.io.IOException
ExecutableManager
.java.io.IOException
protected void processError(java.lang.String error)
ExecuatbleManager
just sends out the received
error message to the stderr
of itself.error
- error message from the managed process.Copyright © 2007-2017 The Apache Software Foundation