Hybrid Query Processing Engine for Coprocessing in Database Systems
HyPE
hype::core::Algorithm Class Reference

This class represents an algorithm. It abstracts important features and encapsulates information of the algorithm. At the same time, it is highly adaptable. More...

#include <algorithm.hpp>

Collaboration diagram for hype::core::Algorithm:

List of all members.

Public Member Functions

 Algorithm (const std::string &name_of_algorithm, const std::string &name_of_statistical_method, const std::string &name_of_recomputation_strategy, Operation &operation, DeviceSpecification comp_dev)
 Initializes Algorithm according to Parameters name_of_algorithm, name_of_statistical_method, name_of_recomputation_strategy.
 ~Algorithm ()
 Destroys the Algorithm and writes the statistics to disc file.
bool setStatisticalMethod (std::tr1::shared_ptr< StatisticalMethod_Internal > ptr_statistical_method)
bool setRecomputationHeuristic (std::tr1::shared_ptr< RecomputationHeuristic_Internal > ptr_recomp_heuristic)
const std::string getName () const
const EstimatedTime getEstimatedExecutionTime (const Tuple &input_values)
unsigned int getNumberOfDecisionsforThisAlgorithm () const throw ()
unsigned int getNumberOfTerminatedExecutions () const throw ()
double getTotalExecutionTime () const throw ()
 returns the total time this algorithm spend in execution
bool addMeasurementPair (const MeasurementPair &mp)
AlgorithmStatisticsgetAlgorithmStatistics ()
bool inTrainingPhase () const throw ()
bool inRetrainingPhase () const throw ()
uint64_t getTimeOfLastExecution () const throw ()
void setTimeOfLastExecution (uint64_t new_timestamp) throw ()
void incrementNumberofDecisionsforThisAlgorithm () throw ()
void retrain ()
const LoadChangeEstimatorgetLoadChangeEstimator () const throw ()
const DeviceSpecification getDeviceSpecification () const throw ()

Private Attributes

std::string name_
std::tr1::shared_ptr
< StatisticalMethod_Internal
ptr_statistical_method_
std::tr1::shared_ptr
< RecomputationHeuristic_Internal
ptr_recomputation_heristic_
AlgorithmStatistics statistics_
Operationoperation_
uint64_t logical_timestamp_of_last_execution_
bool is_in_retraining_phase_
unsigned int retraining_length_
LoadChangeEstimator load_change_estimator_
DeviceSpecification comp_dev_

Detailed Description

An algorithm gets assigned three things. First is a statistical method, which dictates an approximation function and takes care of recomputing the approximation function. Second is a recomputation heuristic, which decides, when to recompute an algorithm. Third is a statistic, which stores past observed execution tiems ofthe algorithm together with an abstraction of the input data set in a measurement pair list. This list is implemented by the class stemod::core::AlgorithmStatistics. The algorithm has to update it's statistics every time, a new observation (an instance of class stemod::core::MeasurementPair) is added. Hence, the Algorithm class provides the basis for the decision component, which is done by an optimization_criterion, which is implemented by drived classes of stemod::core::OptimizationCriterion.

Note that the statistical method and the recomputation statistic can be exchanged at run-time, because the Algortihm uses the pointer to implementation technique (or pimpl-idiom).

Author:
Sebastian BreƟ
Version:
0.1
Date:
2012

Definition at line 49 of file algorithm.hpp.


Constructor & Destructor Documentation

hype::core::Algorithm::Algorithm ( const std::string &  name_of_algorithm,
const std::string &  name_of_statistical_method,
const std::string &  name_of_recomputation_strategy,
Operation operation,
DeviceSpecification  comp_dev 
)
Parameters:
name_of_algorithmname of the algorithm, it has to be unique!
name_of_statistical_methodthe name of a supported statistical method
name_of_recomputation_strategyname of the recomputation strategy

Definition at line 12 of file algorithm.cpp.

References ptr_recomputation_heristic_, and ptr_statistical_method_.


Member Function Documentation

Definition at line 163 of file algorithm.cpp.

References comp_dev_.

Referenced by hype::core::SchedulingDecision::getDeviceSpecification().

Here is the caller graph for this function:

Definition at line 121 of file algorithm.cpp.

References ptr_statistical_method_.

Definition at line 159 of file algorithm.cpp.

References load_change_estimator_.

uint64_t hype::core::Algorithm::getTimeOfLastExecution ( ) const throw ()

Definition at line 138 of file algorithm.cpp.

References logical_timestamp_of_last_execution_.

Returns:

Definition at line 60 of file algorithm.cpp.

References is_in_retraining_phase_.

bool hype::core::Algorithm::inTrainingPhase ( ) const throw ()
Returns:

Definition at line 56 of file algorithm.cpp.

References ptr_statistical_method_.

Referenced by addMeasurementPair().

Here is the caller graph for this function:

bool hype::core::Algorithm::setRecomputationHeuristic ( std::tr1::shared_ptr< RecomputationHeuristic_Internal ptr_recomp_heuristic)

Definition at line 64 of file algorithm.cpp.

References ptr_recomputation_heristic_.

bool hype::core::Algorithm::setStatisticalMethod ( std::tr1::shared_ptr< StatisticalMethod_Internal ptr_statistical_method)

Definition at line 44 of file algorithm.cpp.

References ptr_statistical_method_.

void hype::core::Algorithm::setTimeOfLastExecution ( uint64_t  new_timestamp) throw ()

Definition at line 142 of file algorithm.cpp.


Member Data Documentation

Definition at line 110 of file algorithm.hpp.

Referenced by getTimeOfLastExecution().

std::string hype::core::Algorithm::name_ [private]

Definition at line 105 of file algorithm.hpp.

Referenced by addMeasurementPair(), getName(), retrain(), and ~Algorithm().

Definition at line 109 of file algorithm.hpp.

Referenced by ~Algorithm().

Definition at line 112 of file algorithm.hpp.

Referenced by addMeasurementPair(), and retrain().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines