org.apache.pig.backend.executionengine
Interface ExecutionEngine

All Known Implementing Classes:
HExecutionEngine, LocalExecutionEngine

public interface ExecutionEngine

TODO: provide a manner to generate/collect logging information for DBG purposes TODO: add keys for properties/statistics


Method Summary
 Collection<String> activeScopes()
          List scopes that are active in the back-end
 void close()
          Clean-up and releasing of resources.
 PhysicalPlan compile(LogicalPlan plan, Properties properties)
          Compiles a logical plan into a physical plan, given a set of configuration properties that apply at the plan-level.
 List<ExecJob> execute(PhysicalPlan plan, String jobName)
          Execute the physical plan in blocking mode.
 void explain(PhysicalPlan plan, PrintStream stream, String format, boolean verbose)
          Explain executor specific information.
 Properties getConfiguration()
          Provides configuration information about the execution engine itself.
 DataStorage getDataStorage()
           
 Map<String,Object> getStatistics()
          Provides statistics on the Execution Engine: number of nodes, node failure rates, average load, average job wait time...
 void init()
          Place holder for possible initialization activities.
 void reclaimScope(String scope)
          A mechanism to communicate to the back-end that a set of logical plans go out of scope
 Collection<ExecJob> runningJobs(Properties properties)
          Return currently running jobs (can be useful for admin purposes)
 List<ExecJob> submit(PhysicalPlan plan, String jobName)
          Execute the physical plan in non-blocking mode
 void updateConfiguration(Properties newConfiguration)
          Provides a way to dynamically change configuration parameters at the Execution Engine level.
 

Method Detail

init

void init()
          throws ExecException
Place holder for possible initialization activities.

Throws:
ExecException

close

void close()
           throws ExecException
Clean-up and releasing of resources.

Throws:
ExecException

getDataStorage

DataStorage getDataStorage()

getConfiguration

Properties getConfiguration()
                            throws ExecException
Provides configuration information about the execution engine itself.

Returns:
- information about the configuration used to connect to execution engine
Throws:
ExecException

updateConfiguration

void updateConfiguration(Properties newConfiguration)
                         throws ExecException
Provides a way to dynamically change configuration parameters at the Execution Engine level.

Parameters:
newConfiguration - - the new configuration settings
Throws:
when - configuration conflicts are detected
ExecException

getStatistics

Map<String,Object> getStatistics()
                                 throws ExecException
Provides statistics on the Execution Engine: number of nodes, node failure rates, average load, average job wait time...

Returns:
ExecutionEngineProperties
Throws:
ExecException

compile

PhysicalPlan compile(LogicalPlan plan,
                     Properties properties)
                     throws ExecException
Compiles a logical plan into a physical plan, given a set of configuration properties that apply at the plan-level. For instance desired degree of parallelism for this plan, which could be different from the "default" one set at the execution engine level.

Parameters:
plan - logical plan to compile
properties -
Returns:
physical plan
Throws:
ExecException

execute

List<ExecJob> execute(PhysicalPlan plan,
                      String jobName)
                      throws ExecException
Execute the physical plan in blocking mode.

Parameters:
plan - PhysicalPlan to execute.
jobName - Name of this plan, will be used to identify the plan
Throws:
ExecException

submit

List<ExecJob> submit(PhysicalPlan plan,
                     String jobName)
                     throws ExecException
Execute the physical plan in non-blocking mode

Parameters:
plan - PhysicalPlan to submit.
jobName - Name of this plan, will be used to identify the plan
Throws:
ExecException

explain

void explain(PhysicalPlan plan,
             PrintStream stream,
             String format,
             boolean verbose)
Explain executor specific information.

Parameters:
plan - PhysicalPlan to explain
stream - Stream to print output to
format - Format to print in
verbose - Amount of information to print

runningJobs

Collection<ExecJob> runningJobs(Properties properties)
                                throws ExecException
Return currently running jobs (can be useful for admin purposes)

Returns:
All jobs that are currently active in hte execution engine.
Throws:
ExecException

activeScopes

Collection<String> activeScopes()
                                throws ExecException
List scopes that are active in the back-end

Returns:
All scopes that are currently active in the execution engine.
Throws:
ExecException

reclaimScope

void reclaimScope(String scope)
                  throws ExecException
A mechanism to communicate to the back-end that a set of logical plans go out of scope

Parameters:
scope -
Throws:
ExecException


Copyright © ${year} The Apache Software Foundation