Executor Class Reference

Represents the main control instance. More...

#include <executor.h>

Collaboration diagram for Executor:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Executor (CmdLine *_cmd)
 Constructor.
virtual ~Executor ()
void start ()
 Runs the executor.

Private Member Functions

void initStreams ()
 Initializes all required input/output streams.
void parseQuery ()
 Parses the input query.
void optimizeQuery ()
 Statically computes an optimized version of the input query.
void collectQueryInformation ()
 Gathers informations from the input query that are required in further steps.
void buildVariableTree ()
 Builds the variable tree.
void buildDependencies ()
 Builds the dependency sets.
void buildProjectionTree ()
 Builds the projection tree.
void buildSignOffQuery ()
 Builds the rewritten query with signOff-statements.
void insertSignOffs (vector< SignOffExpression * > &signoffs)
 Inserts the signOff-statements into the input query.
void initProjectionDFA ()
 Initializes the projection DFA.
void initStreamParser ()
 Initializes the stream preprocessor.
void preprocessStream ()
 Preprocess the input stream without query evaluation.
void evalQuery ()
 Evaluates the (rewritten) input query.
void finalDebugPrint (bool sppmode)
 Prints final debug output.

Private Attributes

OutputStreamdebug_ostream
OutputStreameval_ostream
Expressionquery
 The parsed input query.
Bufferbuffer
FSAMapfsamap
ParVarMapparvarmap
PathEnvironmentpenv
VariableTreevt
vector< DependencySet * > * depset
ProjectionTreept
PassiveProjectionTreeppt
ProjectionDFApdfa
CmdLinecmd


Detailed Description

Represents the main control instance.

Represents the main control instance. The executor controls the work flow and is responsible for calling the modules (like statical analysis and evaluation) in a well-defined order.

Author:
Michael Schmidt

modified by Steffi Scherzinger

Gunnar Jehl

Version:
2.1
License:
Software License Agreement (BSD License)

Definition at line 82 of file executor.h.


Constructor & Destructor Documentation

Executor::Executor ( CmdLine _cmd  ) 

Constructor.

Constructor - creating object for a CmdLine object.

Parameters:
[in] _cmd Pointer to a CmdLine object (the command line object stores all command line arguments).

Definition at line 52 of file executor.cpp.

Executor::~Executor (  )  [virtual]


Member Function Documentation

void Executor::buildDependencies (  )  [private]

Builds the dependency sets.

Builds the dependency sets.

Return values:
void 

Definition at line 617 of file executor.cpp.

References cmd, CmdLine::debug, debug_ostream, depset, Expression::extractDependencies(), VarName::getInstance(), VarName::getVarname(), ParVarMap::getVarsq(), NEWLINE, parvarmap, ppt, VarName::print(), and query.

Referenced by start().

void Executor::buildProjectionTree (  )  [private]

void Executor::buildSignOffQuery (  )  [private]

Builds the rewritten query with signOff-statements.

Builds the rewritten query with signOff-statements. The signOff-statements are inserted according to the role list.

Note:
No new query object is created, but instead the original query is rewritten!
Return values:
void 

Definition at line 767 of file executor.cpp.

References cmd, CmdLine::debug, debug_ostream, RoleList::getInstance(), RoleList::getRoles(), insertSignOffs(), Expression::mergeSequences(), NEWLINE, query, and RoleList::sortRolesForSignOffs().

Referenced by start().

void Executor::buildVariableTree (  )  [private]

Builds the variable tree.

Builds the variable tree.

Return values:
void 

Definition at line 602 of file executor.cpp.

References cmd, CmdLine::debug, debug_ostream, NEWLINE, VariableTree::print(), and vt.

Referenced by start().

void Executor::collectQueryInformation (  )  [private]

Gathers informations from the input query that are required in further steps.

Gathers informations from the input query that are required in further steps. In particular, this method computes the first straight ancestor (FSA) map, ParVar map, the path environment and initialized the role list accordingly. All information is stored in the respective member variables.

Return values:
void 

Definition at line 557 of file executor.cpp.

References cmd, CmdLine::debug, debug_ostream, Expression::extractFSAMap(), Expression::extractParVarMap(), fsamap, ParVarMap::getInstance(), FSAMap::getInstance(), RoleList::initInstance(), NEWLINE, parvarmap, penv, ppt, PathEnvironment::print(), ParVarMap::print(), FSAMap::print(), query, and TAGID_ROOT.

Referenced by start().

void Executor::evalQuery (  )  [private]

Evaluates the (rewritten) input query.

Evaluates the (rewritten) input query. Once everything is initialized properly, this method can be used to start query evaluation.

Note:
To be called right at the end of the statical analysis phase!
Return values:
void 

Definition at line 917 of file executor.cpp.

References buffer, BufferNode::clear(), cmd, CmdLine::debug, debug_ostream, Expression::eval(), eval_ostream, EVAL_QUERY, OutputStream::getArg(), Buffer::getRoot(), OutputStream::getType(), Expression::init(), NEWLINE, and query.

Referenced by start().

void Executor::finalDebugPrint ( bool  sppmode  )  [private]

Prints final debug output.

Prints final debug output. If the debug mode is turned on, this methd prints some final debug information (like final buffer, tagmap, projection DFA etc.).

Parameters:
[in] sppmode true if in debug-mode, false otherwise.
Return values:
void 

Definition at line 960 of file executor.cpp.

References buffer, cmd, CmdLine::debug, debug_ostream, Buffer::debugPrint(), TagMap::getInstance(), NEWLINE, pdfa, ProjectionDFA::print(), and TagMap::print().

Referenced by start().

void Executor::initProjectionDFA (  )  [private]

Initializes the projection DFA.

Initializes the projection DFA.

Return values:
void 

Definition at line 863 of file executor.cpp.

References cmd, CmdLine::debug, debug_ostream, NEWLINE, pdfa, ppt, ProjectionDFA::print(), and pt.

Referenced by start().

void Executor::initStreamParser (  )  [private]

Initializes the stream preprocessor.

Initializes the stream preprocessor. This initialization step comprises the initialization of an (empty) buffer and the single StreamPreProcessor object that will be used to project the input stream.

Return values:
void 

Definition at line 878 of file executor.cpp.

References buffer, cmd, CmdLine::debug, debug_ostream, Buffer::debugPrint(), StreamPreProcessor::initInstance(), NEWLINE, and pdfa.

Referenced by start().

void Executor::initStreams (  )  [private]

void Executor::insertSignOffs ( vector< SignOffExpression * > &  signoffs  )  [private]

Inserts the signOff-statements into the input query.

Inserts the signOff-statements into the input query. This method is a help method of buildSignOffQuery().

Parameters:
[in] signoffs Pointer to a vector containing pointers to all SignOffExpression objects.
Return values:
void 

Definition at line 848 of file executor.cpp.

References Expression::placeSignOffs(), query, and TAGID_ROOT.

Referenced by buildSignOffQuery().

void Executor::optimizeQuery (  )  [private]

Statically computes an optimized version of the input query.

Statically computes an optimized version of the input query. In particular, this method merges sequences, rewrites aggregate functions etc.

Return values:
void 

Definition at line 497 of file executor.cpp.

References cmd, CmdLine::debug, debug_ostream, VarName::getInstance(), Expression::mergeSequences(), NEWLINE, VarName::print(), query, Expression::rewriteAggregateFuncts(), Expression::rewriteEmptyFuncts(), Expression::rewriteVarstepCondExps(), Expression::rewriteVarsteps(), and Expression::rewriteWhereExps().

Referenced by start().

void Executor::parseQuery (  )  [private]

void Executor::preprocessStream (  )  [private]

Preprocess the input stream without query evaluation.

Preprocess the input stream without query evaluation. This method is used to preprocess the input stream without evaluating the input query. While not required in 'regular' query evaluation runs, it is helpful for debugging purposes.

Return values:
void 

Definition at line 896 of file executor.cpp.

References buffer, cmd, CmdLine::debug, debug_ostream, Buffer::debugPrint(), StreamPreProcessor::getInstance(), NEWLINE, Buffer::print(), and StreamPreProcessor::readAll().

Referenced by start().

void Executor::start (  ) 

Runs the executor.

Runs the executor, i.e. executes the program according to the specified command line arguments. In doing so, the method calls (depending on the command line arguments) the private methods of this class in a well-defined order.

Return values:
void 

Definition at line 217 of file executor.cpp.

References buildDependencies(), buildProjectionTree(), buildSignOffQuery(), buildVariableTree(), cmd, collectQueryInformation(), evalQuery(), finalDebugPrint(), Exception::getDebugMsg(), StreamManager::getInstance(), initProjectionDFA(), initStreamParser(), initStreams(), optimizeQuery(), parseQuery(), CmdLine::preprocess_stream_debug, CmdLine::preprocess_stream_no_debug, preprocessStream(), and Exception::terminate().

Referenced by main().


Member Data Documentation

Buffer * Executor::buffer [private]

The Buffer used during evaluation.

Definition at line 247 of file executor.h.

Referenced by evalQuery(), finalDebugPrint(), initStreamParser(), preprocessStream(), and ~Executor().

CmdLine * Executor::cmd [private]

vector< DependencySet * > * Executor::depset [private]

The vector containing pointers to all DependencySet objects.

Definition at line 277 of file executor.h.

Referenced by buildDependencies(), buildProjectionTree(), and ~Executor().

The evaluation OutputStream.

Definition at line 234 of file executor.h.

Referenced by evalQuery(), and initStreams().

FSAMap * Executor::fsamap [private]

The map that contains variables to first straight ancestor (FSA) mappings.

Definition at line 253 of file executor.h.

Referenced by collectQueryInformation().

The map that contains variables to parent variable (ParVar) mappings.

Definition at line 259 of file executor.h.

Referenced by buildDependencies(), and collectQueryInformation().

The projection DFA used for stream preprojection.

Definition at line 295 of file executor.h.

Referenced by finalDebugPrint(), initProjectionDFA(), initStreamParser(), and ~Executor().

The path environment for the variables used inside the query.

Definition at line 265 of file executor.h.

Referenced by collectQueryInformation(), and ~Executor().

The passive projection tree used to construct the ProjectionDFA.

Definition at line 289 of file executor.h.

Referenced by buildDependencies(), buildProjectionTree(), collectQueryInformation(), initProjectionDFA(), and ~Executor().

The constructed projection tree used to construct the ProjectionDFA.

Definition at line 283 of file executor.h.

Referenced by buildProjectionTree(), initProjectionDFA(), and ~Executor().

The parsed input query.

The parsed input query, which will be modified in the statical analysis phase, e.g. by some optimization steps or enrichment with signOff-statements.

Definition at line 241 of file executor.h.

Referenced by buildDependencies(), buildSignOffQuery(), collectQueryInformation(), evalQuery(), insertSignOffs(), optimizeQuery(), parseQuery(), and ~Executor().

The constructed variable tree.

Definition at line 271 of file executor.h.

Referenced by buildProjectionTree(), buildVariableTree(), and ~Executor().


Generated on Sun May 24 20:20:23 2009 for G(arbage) C(ollected) X(Query) Engine by  doxygen 1.5.9