|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.impl.streaming.StreamingCommand
public class StreamingCommand
StreamingCommand
represents the specification of an external
command to be executed in a Pig Query.
StreamingCommand
encapsulates all relevant details of the
command specified by the user either directly via the STREAM
operator or indirectly via a DEFINE
operator. It includes
details such as input/output/error specifications and also files to be
shipped to the cluster and files to be cached.
Nested Class Summary | |
---|---|
static class |
StreamingCommand.Handle
Handle to communicate with the external process. |
static class |
StreamingCommand.HandleSpec
Specification about the usage of the StreamingCommand.Handle to communicate
with the external process. |
Field Summary | |
---|---|
static int |
MAX_TASKS
|
Constructor Summary | |
---|---|
StreamingCommand(PigContext pigContext,
String[] argv)
Create a new StreamingCommand with the given command. |
Method Summary | |
---|---|
void |
addHandleSpec(StreamingCommand.Handle handle,
StreamingCommand.HandleSpec handleSpec)
Attach a StreamingCommand.HandleSpec to a given StreamingCommand.Handle |
void |
addPathToCache(String path)
Add a file to be cached on execute nodes on the cluster. |
void |
addPathToShip(String path)
Add a file to be shipped to the cluster. |
Object |
clone()
|
List<String> |
getCacheSpecs()
Get the list of files which need to be cached on the execute nodes. |
String[] |
getCommandArgs()
Get the parsed command arguments. |
String |
getExecutable()
Get the command to be executed. |
List<StreamingCommand.HandleSpec> |
getHandleSpecs(StreamingCommand.Handle handle)
Get specifications for the given Handle . |
StreamingCommand.HandleSpec |
getInputSpec()
Get the input specification of the StreamingCommand . |
String |
getLogDir()
Get the directory where the log-files of the command are persisted. |
int |
getLogFilesLimit()
Get the maximum number of tasks whose stderr logs files are persisted. |
StreamingCommand.HandleSpec |
getOutputSpec()
Get the specification of the primary output of the StreamingCommand . |
boolean |
getPersistStderr()
Should the stderr of the managed process be persisted? |
boolean |
getShipFiles()
Get whether files for this command should be shipped or not. |
List<String> |
getShipSpecs()
Get the list of files which need to be shipped to the cluster. |
void |
setCommandArgs(String[] argv)
Set the command line arguments for the StreamingCommand . |
void |
setExecutable(String executable)
Set the executable for the StreamingCommand . |
void |
setInputSpec(StreamingCommand.HandleSpec spec)
Set the input specification for the StreamingCommand . |
void |
setLogDir(String logDir)
Set the directory where the log-files of the command are persisted. |
void |
setLogFilesLimit(int logFilesLimit)
Set the maximum number of tasks whose stderr logs files are persisted. |
void |
setOutputSpec(StreamingCommand.HandleSpec spec)
Set the specification for the primary output of the StreamingCommand . |
void |
setPersistStderr(boolean persistStderr)
Specify if the stderr of the managed process should be persisted. |
void |
setShipFiles(boolean shipFiles)
Set whether files should be shipped or not. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_TASKS
Constructor Detail |
---|
public StreamingCommand(PigContext pigContext, String[] argv)
StreamingCommand
with the given command.
pigContext
- PigContext structureargv
- parsed arguments of the command
Method Detail |
---|
public String getExecutable()
public void setExecutable(String executable)
StreamingCommand
.
executable
- the executable for the StreamingCommand
public void setCommandArgs(String[] argv)
StreamingCommand
.
argv
- the command line arguments for the
StreamingCommand
public String[] getCommandArgs()
String[]
public List<String> getShipSpecs()
public List<String> getCacheSpecs()
public void addPathToShip(String path) throws IOException
path
- path of the file to be shipped to the cluster
IOException
public void addPathToCache(String path) throws IOException
path
- path of the file to be cached on the execute nodes
IOException
public void addHandleSpec(StreamingCommand.Handle handle, StreamingCommand.HandleSpec handleSpec)
StreamingCommand.HandleSpec
to a given StreamingCommand.Handle
handle
- Handle
to which the specification is to
be attached.handleSpec
- HandleSpec
for the given handle.public void setInputSpec(StreamingCommand.HandleSpec spec)
StreamingCommand
.
spec
- input specificationpublic StreamingCommand.HandleSpec getInputSpec()
StreamingCommand
.
StreamingCommand
public void setOutputSpec(StreamingCommand.HandleSpec spec)
StreamingCommand
.
spec
- specification for the primary output of the
StreamingCommand
public StreamingCommand.HandleSpec getOutputSpec()
StreamingCommand
.
StreamingCommand
public List<StreamingCommand.HandleSpec> getHandleSpecs(StreamingCommand.Handle handle)
Handle
.
handle
- Handle
of the stream
Handle
public boolean getPersistStderr()
true
if the stderr of the managed process should be
persisted, false
otherwise.public void setPersistStderr(boolean persistStderr)
persistStderr
- true
if the stderr of the managed
process should be persisted, else false
public String getLogDir()
public void setLogDir(String logDir)
logDir
- the directory where the log-files of the command are persistedpublic int getLogFilesLimit()
public void setLogFilesLimit(int logFilesLimit)
logFilesLimit
- the maximum number of tasks whose stderr logs files
are persistedpublic void setShipFiles(boolean shipFiles)
shipFiles
- true
if files of this command should be
shipped, false
otherwisepublic boolean getShipFiles()
true
if files of this command should be shipped,
false
otherwisepublic String toString()
toString
in class Object
public Object clone()
clone
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |