|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.impl.streaming.ExecutableManager
public class ExecutableManager
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
.
Field Summary | |
---|---|
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 Summary | |
---|---|
ExecutableManager()
Create a new ExecutableManager . |
Method Summary | |
---|---|
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 void |
setupEnvironment(ProcessBuilder pb)
Set up the run-time environment of the managed process. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public ExecutableManager()
ExecutableManager
.
Method Detail |
---|
public void configure(POStream stream) throws IOException, ExecException
ExecutableManager
.
stream
- POStream operator
IOException
ExecException
public void close() throws IOException
ExecutableManager
.
IOException
protected void setupEnvironment(ProcessBuilder pb)
pb
- ProcessBuilder
used to exec the processprotected 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |