org.objectweb.medor.eval.lib
Class MedorEvaluator

java.lang.Object
  extended byorg.objectweb.medor.eval.lib.MedorEvaluator
All Implemented Interfaces:
QueryEvaluator

public class MedorEvaluator
extends java.lang.Object
implements QueryEvaluator

This class is a simple evaluator of query tree, supporting the data prefetching

Author:
S.Chassande-Barrioz

Constructor Summary
MedorEvaluator(QueryTree query, long cacheSize)
           
 
Method Summary
 TupleCollection evaluate(ParameterOperand[] parameters, ConnectionResources resources, java.util.Map evaluationMDMap)
          First, it allocates a tree of Evaluator (Wrapper or NodeEvaluator) for the query tree associated to this evaluator.
 TupleCollection evaluate(ParameterOperand[] parameters, ConnectionResources resources, PrefetchBuffer prefetchBuffer, java.util.Map evalMDMap)
          Launch the evaluation of a query.
 long getCacheSize()
           
 QueryTree getQueryTree()
           
 ConnectionResources getRequiredConnectionResources()
           
 WrapperFactory getWrapperFactory()
          Returns the associated WrapperFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MedorEvaluator

public MedorEvaluator(QueryTree query,
                      long cacheSize)
               throws EvaluationException
Method Detail

getWrapperFactory

public WrapperFactory getWrapperFactory()
Description copied from interface: QueryEvaluator
Returns the associated WrapperFactory. This is used to be able to bind specific Wrappers to DataStore types.

Specified by:
getWrapperFactory in interface QueryEvaluator
Returns:
the associated WrapperFactory

evaluate

public TupleCollection evaluate(ParameterOperand[] parameters,
                                ConnectionResources resources,
                                java.util.Map evaluationMDMap)
                         throws EvaluationException
First, it allocates a tree of Evaluator (Wrapper or NodeEvaluator) for the query tree associated to this evaluator. In a second step it launches the evalution of the query.

Specified by:
evaluate in interface QueryEvaluator
Parameters:
parameters - is the array of parameters
resources - is the holder of connection used by the wrapper to access the data support.
evaluationMDMap - contains a map associating an EvaluationMetaData object to each of the query nodes of the query tree currently associated to the QueryEvaluator.
Throws:
EvaluationException

evaluate

public TupleCollection evaluate(ParameterOperand[] parameters,
                                ConnectionResources resources,
                                PrefetchBuffer prefetchBuffer,
                                java.util.Map evalMDMap)
                         throws EvaluationException
Description copied from interface: QueryEvaluator
Launch the evaluation of a query. This method is able to prefetch data of the query in a prefetch buffer.

Specified by:
evaluate in interface QueryEvaluator
Parameters:
parameters - is a ConnectionResources containing associations between the DataStore names used in the QueryTree and the connection objects to use for the evaluation.
prefetchBuffer - is the prefetchBuffer instance where buffer data must be put. If this field is null, then no data prefetching mus be done.
resources - is a ConnectionResources containing associations between the DataStore names used in the QueryTree and the connection objects to use for the evaluation.It can be null.
Throws:
EvaluationException

getQueryTree

public QueryTree getQueryTree()
Specified by:
getQueryTree in interface QueryEvaluator
Returns:
the evaluable (optimized) query tree associated to the current QueryEvaluator.

getCacheSize

public long getCacheSize()
Specified by:
getCacheSize in interface QueryEvaluator
Returns:
the cache size used in different node of the QueryNode tree.

getRequiredConnectionResources

public ConnectionResources getRequiredConnectionResources()
Specified by:
getRequiredConnectionResources in interface QueryEvaluator