org.apache.pig
Interface ExecType

All Superinterfaces:
Serializable
All Known Implementing Classes:
LocalExecType, MRExecType

@InterfaceAudience.Public
@InterfaceStability.Evolving
public interface ExecType
extends Serializable

The type of query execution. Pig will cycle through all implementations of ExecType and choose the first one that matches the Properties passed in. This ExecType then dictates the ExecutionEngine used for processing and other behaviour throughout Pig. Any implementing classes should be noted in the META-INF/services folder titled org.apache.pig.ExecType as per the Java ServiceLoader specification.


Field Summary
static ExecType LOCAL
           
static ExecType MAPREDUCE
           
 
Method Summary
 boolean accepts(Properties properties)
          An ExecType is selected based off the Properties for the given script.
 ExecutionEngine getExecutionEngine(PigContext pigContext)
          Returns the Execution Engine that this ExecType is associated with.
 Class<? extends ExecutionEngine> getExecutionEngineClass()
          Returns the Execution Engine class that this ExecType is associated with.
 boolean isLocal()
          An ExecType is classified as local if it runs in-process and through the local filesystem.
 String name()
          Returns the canonical name for this ExecType.
 

Field Detail

LOCAL

static final ExecType LOCAL

MAPREDUCE

static final ExecType MAPREDUCE
Method Detail

accepts

boolean accepts(Properties properties)
An ExecType is selected based off the Properties for the given script. There may be multiple settings that trigger the selection of a given ExecType. For example, distributed MR mode is currently triggered if the user specifies "mapred" or "mapreduce". It is desirable to override the toString method of the given ExecType to uniquely identify the ExecType. The initialize method should return true if it accepts the properties or false if it does not. The Java ServiceLoader framework will be used to iterate through and select the correct ExecType.


getExecutionEngine

ExecutionEngine getExecutionEngine(PigContext pigContext)
Returns the Execution Engine that this ExecType is associated with. Once the ExecType the script is running in is determined by the PigServer, it will then call this method to get an instance of the ExecutionEngine associated with this ExecType to delegate all further execution to on the backend.


getExecutionEngineClass

Class<? extends ExecutionEngine> getExecutionEngineClass()
Returns the Execution Engine class that this ExecType is associated with. This method simply returns the class of the ExecutionEngine associated with this ExecType, and not an instance of it.


isLocal

boolean isLocal()
An ExecType is classified as local if it runs in-process and through the local filesystem. While an ExecutionEngine may have a more nuanced notion of local mode, these are the qualifications Pig requires. ExecutionEngines can extend the ExecType interface to additionally differentiate between ExecTypes as necessary.


name

String name()
Returns the canonical name for this ExecType.

Returns:


Copyright © 2007-2012 The Apache Software Foundation