felix.optimizer
Class Scheduler

java.lang.Object
  extended by felix.optimizer.Scheduler

public class Scheduler
extends java.lang.Object

The class of a scheduler, which takes as input a FelixQuery, and outputs an physical execution plan that is ready to be fed into Executor. The output of a scheduler, i.e., ExecutionPlan, can be regarded as a description of the physical plan, which contains the execution order of different statistical operators.
TODO: + better cycle support for operator graph.

Author:
Ce Zhang

Constructor Summary
Scheduler(Felix _felix, FelixQuery _fq, FelixCommandOptions _options)
          The constructor.
 
Method Summary
 OperatorBucketGraph dataDecomposition(java.util.HashSet<StatOperator> ops, CostModel cm)
          Partition the data into different parts.
 OperatorBucketGraph getOperatorBucketGraph()
          Returns operator bucket graph.
 ExecutionPlan orderOperators(OperatorBucketGraph obg)
          Schedule the order of running the operators.
 void parseCommonPredicates(ExecutionPlan _ep)
          Parses common predicates among buckets.
 java.util.ArrayList<ConcurrentOperatorsBucket> rank(java.util.Collection<ConcurrentOperatorsBucket> torank)
          Returns list of operator buckets sorted by precedence.
 java.util.HashSet<StatOperator> ruleDecomposition(CostModel cm)
          Partition the rules into different operators.
 ExecutionPlan schedule()
          The entry of this optimizer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scheduler

public Scheduler(Felix _felix,
                 FelixQuery _fq,
                 FelixCommandOptions _options)
The constructor.

Parameters:
_felix -
_fq -
_options -
Method Detail

ruleDecomposition

public java.util.HashSet<StatOperator> ruleDecomposition(CostModel cm)
Partition the rules into different operators.

Parameters:
cm -
Returns:

dataDecomposition

public OperatorBucketGraph dataDecomposition(java.util.HashSet<StatOperator> ops,
                                             CostModel cm)
Partition the data into different parts. This method will partition one operator returned by ruleDecomposition(felix.optimizer.CostModel) into different ones, with each of them deals with different portions of data. These operators will be put into a ConcurrentOperatorsBucket, which means they can be executed in parallel.

Parameters:
ops -
cm -
Returns:

rank

public java.util.ArrayList<ConcurrentOperatorsBucket> rank(java.util.Collection<ConcurrentOperatorsBucket> torank)
Returns list of operator buckets sorted by precedence.

Parameters:
torank -
Returns:

orderOperators

public ExecutionPlan orderOperators(OperatorBucketGraph obg)
Schedule the order of running the operators.

Parameters:
obg -
Returns:

getOperatorBucketGraph

public OperatorBucketGraph getOperatorBucketGraph()
Returns operator bucket graph.

Returns:

parseCommonPredicates

public void parseCommonPredicates(ExecutionPlan _ep)
Parses common predicates among buckets.

Parameters:
_ep -

schedule

public ExecutionPlan schedule()
The entry of this optimizer.

Returns: