Hybrid Query Processing Engine for Coprocessing in Database Systems
HyPE
|
This class represents an operation, which abstracts from algorithms and summarizes them under an abstract task, like sorting, join, selection, projection etc. More...
#include <operation.hpp>
Public Types | |
typedef std::map< std::string, std::tr1::shared_ptr < Algorithm > > | MapNameToAlgorithm |
Public Member Functions | |
Operation (const std::string &name) | |
~Operation () | |
bool | addAlgorithm (const std::string &name_of_algorithm, DeviceSpecification comp_dev, const std::string &name_of_statistical_method, const std::string &name_of_recomputation_strategy) |
void | removeAlgorithm (const std::string &name) |
const SchedulingDecision | getOptimalAlgorithm (const Tuple &input_values, DeviceTypeConstraint dev_constr=ANY_DEVICE) |
bool | hasAlgorithm (const std::string &name_of_algorithm) |
returns true if an algrithm named "name_of_algorithm" is registered for this operation and false otherwise | |
const AlgorithmPtr | getAlgorithm (const std::string &name_of_algorithm) |
bool | setNewOptimizationCriterion (const std::string &name_of_optimization_criterion) |
bool | addObservation (const std::string &name_of_algorithm, const MeasurementPair &mp) |
const std::vector< AlgorithmPtr > | getAlgorithms () |
const std::map< double, std::string > | getEstimatedExecutionTimesforAlgorithms (const Tuple &input_values) |
const std::string | getName () const throw () |
void | incrementNumberOfRightDecisions () throw () |
void | incrementNumberOfTotalDecisions () throw () |
uint64_t | getNextTimestamp () throw () |
uint64_t | getCurrentTimestamp () const throw () |
Private Attributes | |
MapNameToAlgorithm | map_algorithmname_to_pointer_ |
std::tr1::shared_ptr < OptimizationCriterion_Internal > | ptr_to_optimization_criterion_ |
std::string | name_ |
unsigned int | number_of_right_decisions_ |
unsigned int | number_of_total_decisions_ |
uint64_t | logical_time_ |
An operation gets assigned two things. First is a list of algorithms, which represent the set of algorithms available to process operation O, which is basically the algorithm pool of the decision model. Second is an optimization_criterion, which is implemented by drived classes of stemod::core::OptimizationCriterion. The optimization criterion takes the computed estimated execution times of each algorithm and decides on the optimal algorithm, where the user specifies what is optimal by specifying an OptimizationCriterion.
Note that the stemod::core::OptimizationCriterioc can be exchanged at run-time, because the Operation class uses the pointer to implementation technique (or pimpl-idiom). This makes it highly adaptable.
Definition at line 38 of file operation.hpp.
typedef std::map<std::string,std::tr1::shared_ptr<Algorithm> > hype::core::Operation::MapNameToAlgorithm |
Definition at line 41 of file operation.hpp.
hype::core::Operation::Operation | ( | const std::string & | name | ) |
Definition at line 8 of file operation.cpp.
References setNewOptimizationCriterion().
Definition at line 12 of file operation.cpp.
References hype::core::PlotScriptGenerator::create(), hype::core::PlotScriptGenerator::createAverageRelativeErrorScript(), hype::core::PlotScriptGenerator::createRelativeErrorScript(), hype::core::PlotScriptGenerator::createWindowedAverageRelativeErrorScript(), map_algorithmname_to_pointer_, and name_.
bool hype::core::Operation::addAlgorithm | ( | const std::string & | name_of_algorithm, |
DeviceSpecification | comp_dev, | ||
const std::string & | name_of_statistical_method, | ||
const std::string & | name_of_recomputation_strategy | ||
) |
Definition at line 49 of file operation.cpp.
References debug, map_algorithmname_to_pointer_, name_, quiet, and verbose.
bool hype::core::Operation::addObservation | ( | const std::string & | name_of_algorithm, |
const MeasurementPair & | mp | ||
) |
Definition at line 134 of file operation.cpp.
References map_algorithmname_to_pointer_.
const AlgorithmPtr hype::core::Operation::getAlgorithm | ( | const std::string & | name_of_algorithm | ) |
Definition at line 80 of file operation.cpp.
References map_algorithmname_to_pointer_.
Referenced by hype::core::OptimizationCriterion_Internal::getOptimalAlgorithm(), hype::core::Throughput2::getOptimalAlgorithm_internal(), and hype::core::SimpleRoundRobin::getOptimalAlgorithm_internal().
const std::vector< AlgorithmPtr > hype::core::Operation::getAlgorithms | ( | ) |
Definition at line 89 of file operation.cpp.
References map_algorithmname_to_pointer_.
Referenced by hype::core::OptimizationCriterion_Internal::getOptimalAlgorithm(), hype::core::Throughput2::getOptimalAlgorithm_internal(), hype::core::Throughput::getOptimalAlgorithm_internal(), hype::core::SimpleRoundRobin::getOptimalAlgorithm_internal(), hype::core::WaitingTimeAwareResponseTime::getOptimalAlgorithm_internal(), hype::core::ResponseTime::getOptimalAlgorithm_internal(), and hype::core::ProbabilityBasedOutsourcing::getOptimalAlgorithm_internal().
uint64_t hype::core::Operation::getCurrentTimestamp | ( | ) | const throw () |
Definition at line 178 of file operation.cpp.
References logical_time_.
Referenced by hype::core::OptimizationCriterion_Internal::getOptimalAlgorithm(), hype::core::Throughput2::getOptimalAlgorithm_internal(), and hype::core::Throughput::getOptimalAlgorithm_internal().
const std::map< double, std::string > hype::core::Operation::getEstimatedExecutionTimesforAlgorithms | ( | const Tuple & | input_values | ) |
Definition at line 147 of file operation.cpp.
References debug, hype::core::EstimatedTime::getTimeinNanoseconds(), map_algorithmname_to_pointer_, quiet, and verbose.
Referenced by hype::core::Throughput::getOptimalAlgorithm_internal(), and hype::core::Throughput2::getOptimalAlgorithm_internal().
const std::string hype::core::Operation::getName | ( | ) | const throw () |
Definition at line 163 of file operation.cpp.
References name_.
Referenced by hype::core::ResponseTime::getOptimalAlgorithm_internal(), hype::core::Throughput2::getOptimalAlgorithm_internal(), hype::core::Throughput::getOptimalAlgorithm_internal(), hype::core::ProbabilityBasedOutsourcing::getOptimalAlgorithm_internal(), and hype::core::Algorithm::~Algorithm().
uint64_t hype::core::Operation::getNextTimestamp | ( | ) | throw () |
Definition at line 174 of file operation.cpp.
References logical_time_.
Referenced by hype::core::Throughput::getOptimalAlgorithm_internal().
const SchedulingDecision hype::core::Operation::getOptimalAlgorithm | ( | const Tuple & | input_values, |
DeviceTypeConstraint | dev_constr = ANY_DEVICE |
||
) |
Definition at line 109 of file operation.cpp.
References name_, and ptr_to_optimization_criterion_.
bool hype::core::Operation::hasAlgorithm | ( | const std::string & | name_of_algorithm | ) |
Definition at line 120 of file operation.cpp.
References map_algorithmname_to_pointer_.
void hype::core::Operation::incrementNumberOfRightDecisions | ( | ) | throw () |
Definition at line 167 of file operation.cpp.
References number_of_right_decisions_.
void hype::core::Operation::incrementNumberOfTotalDecisions | ( | ) | throw () |
Definition at line 170 of file operation.cpp.
References number_of_total_decisions_.
void hype::core::Operation::removeAlgorithm | ( | const std::string & | name | ) |
Definition at line 74 of file operation.cpp.
bool hype::core::Operation::setNewOptimizationCriterion | ( | const std::string & | name_of_optimization_criterion | ) |
Definition at line 98 of file operation.cpp.
References hype::core::getNewOptimizationCriterionbyName(), name_, and ptr_to_optimization_criterion_.
Referenced by Operation().
uint64_t hype::core::Operation::logical_time_ [private] |
Definition at line 90 of file operation.hpp.
Referenced by getCurrentTimestamp(), and getNextTimestamp().
Definition at line 84 of file operation.hpp.
Referenced by addAlgorithm(), addObservation(), getAlgorithm(), getAlgorithms(), getEstimatedExecutionTimesforAlgorithms(), hasAlgorithm(), and ~Operation().
std::string hype::core::Operation::name_ [private] |
Definition at line 87 of file operation.hpp.
Referenced by addAlgorithm(), getName(), getOptimalAlgorithm(), setNewOptimizationCriterion(), and ~Operation().
unsigned int hype::core::Operation::number_of_right_decisions_ [private] |
Definition at line 88 of file operation.hpp.
Referenced by incrementNumberOfRightDecisions().
unsigned int hype::core::Operation::number_of_total_decisions_ [private] |
Definition at line 89 of file operation.hpp.
Referenced by incrementNumberOfTotalDecisions().
std::tr1::shared_ptr<OptimizationCriterion_Internal> hype::core::Operation::ptr_to_optimization_criterion_ [private] |
Definition at line 85 of file operation.hpp.
Referenced by getOptimalAlgorithm(), and setNewOptimizationCriterion().