#include <executor.h>
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 | |
OutputStream * | debug_ostream |
OutputStream * | eval_ostream |
Expression * | query |
The parsed input query. | |
Buffer * | buffer |
FSAMap * | fsamap |
ParVarMap * | parvarmap |
PathEnvironment * | penv |
VariableTree * | vt |
vector< DependencySet * > * | depset |
ProjectionTree * | pt |
PassiveProjectionTree * | ppt |
ProjectionDFA * | pdfa |
CmdLine * | cmd |
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.
Definition at line 82 of file executor.h.
Executor::Executor | ( | CmdLine * | _cmd | ) |
Constructor.
Constructor - creating object for a CmdLine object.
[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] |
Destructor.
Definition at line 59 of file executor.cpp.
References buffer, cmd, CmdLine::debug, debug_ostream, depset, StreamManager::getInstance(), VarName::getInstance(), TagMap::getInstance(), StreamPreProcessor::getInstance(), RoleList::getInstance(), ParVarMap::getInstance(), FSAMap::getInstance(), OutputStream::isWriteable(), NEWLINE, pdfa, penv, ppt, pt, query, and vt.
void Executor::buildDependencies | ( | ) | [private] |
Builds the dependency sets.
Builds the dependency sets.
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] |
Builds the projection tree.
Builds the projection tree.
void |
Definition at line 683 of file executor.cpp.
References cmd, CmdLine::debug, debug_ostream, depset, VarName::getInstance(), ProjectionTree::getLabels(), VarName::getVarname(), ProjectionTree::labelTree(), NEWLINE, ppt, ProjectionTreeLabels::print(), PassiveProjectionTree::print(), ProjectionTree::print(), pt, ProjectionTree::removeRedundantRoles(), ProjectionTree::removeUnneededNodes(), and vt.
Referenced by start().
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.
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.
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.
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.
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.).
[in] | sppmode | true if in debug-mode, false otherwise. |
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.
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.
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] |
Initializes all required input/output streams.
Initializes all required input/output streams.
void |
Definition at line 345 of file executor.cpp.
References cmd, debug_ostream, CmdLine::dout_arg, CmdLine::dout_ostream_type, CmdLine::eout_arg, CmdLine::eout_ostream_type, eval_ostream, StreamManager::initInstance(), InputStream::isReadable(), OutputStream::isWriteable(), OutputStream::open(), InputStream::open(), CmdLine::query_arg, CmdLine::query_istream_type, CmdLine::xml_arg, and CmdLine::xml_istream_type.
Referenced by start().
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().
[in] | signoffs | Pointer to a vector containing pointers to all SignOffExpression objects. |
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.
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] |
Parses the input query.
Parses the input query.
void |
Definition at line 435 of file executor.cpp.
References cmd, CmdLine::debug, debug_ostream, VarName::getInstance(), StreamManager::getInstance(), StreamManager::getXMLInputStream(), DocExpression::isEmptyPath(), NEWLINE, InputStream::open(), parse_query(), VarName::print(), StreamManager::print(), query, and InputStream::setArg().
Referenced by start().
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.
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.
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().
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] |
The command line argument object that stores the passed command line arguments.
Definition at line 301 of file executor.h.
Referenced by buildDependencies(), buildProjectionTree(), buildSignOffQuery(), buildVariableTree(), collectQueryInformation(), evalQuery(), finalDebugPrint(), initProjectionDFA(), initStreamParser(), initStreams(), optimizeQuery(), parseQuery(), preprocessStream(), start(), and ~Executor().
OutputStream * Executor::debug_ostream [private] |
The debug OutputStream.
Definition at line 228 of file executor.h.
Referenced by buildDependencies(), buildProjectionTree(), buildSignOffQuery(), buildVariableTree(), collectQueryInformation(), evalQuery(), finalDebugPrint(), initProjectionDFA(), initStreamParser(), initStreams(), optimizeQuery(), parseQuery(), preprocessStream(), and ~Executor().
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().
OutputStream * Executor::eval_ostream [private] |
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().
ParVarMap * Executor::parvarmap [private] |
The map that contains variables to parent variable (ParVar) mappings.
Definition at line 259 of file executor.h.
Referenced by buildDependencies(), and collectQueryInformation().
ProjectionDFA * Executor::pdfa [private] |
The projection DFA used for stream preprojection.
Definition at line 295 of file executor.h.
Referenced by finalDebugPrint(), initProjectionDFA(), initStreamParser(), and ~Executor().
PathEnvironment * Executor::penv [private] |
The path environment for the variables used inside the query.
Definition at line 265 of file executor.h.
Referenced by collectQueryInformation(), and ~Executor().
PassiveProjectionTree * Executor::ppt [private] |
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().
ProjectionTree * Executor::pt [private] |
The constructed projection tree used to construct the ProjectionDFA.
Definition at line 283 of file executor.h.
Referenced by buildProjectionTree(), initProjectionDFA(), and ~Executor().
Expression * Executor::query [private] |
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().
VariableTree * Executor::vt [private] |
The constructed variable tree.
Definition at line 271 of file executor.h.
Referenced by buildProjectionTree(), buildVariableTree(), and ~Executor().