Hybrid Query Processing Engine for Coprocessing in Database Systems
HyPE
periodic_recomputation.cpp
Go to the documentation of this file.
00001 
00002 #include <config/configuration.hpp>
00003 
00004 #include <core/algorithm.hpp>
00005 
00006 #include <plugins/recomputation_heuristics/periodic_recomputation.hpp>
00007 
00008 namespace hype{
00009    namespace core{
00010 
00011    PeriodicRecomputation::PeriodicRecomputation() : RecomputationHeuristic_Internal("Periodic Recomputation"), counter_(0) {
00012       RecomputationHeuristicFactorySingleton::Instance().Register("Periodic Recomputation",&PeriodicRecomputation::create);
00013    }
00014 
00015    bool PeriodicRecomputation::internal_recompute(Algorithm& algorithm){
00016 
00017       //std::cout << algorithm.getName() << std::endl;
00018       //algorithm.
00019       assert(algorithm.getName()!="");
00020       //static unsigned int counter=0;
00021       counter_++;
00022       if(counter_>=Runtime_Configuration::instance().getRecomputationPeriod()){ //Configuration::period_for_periodic_recomputation){
00023          counter_=0;
00024          return true;
00025       }
00026       return false;
00027    }
00028 
00029    }; //end namespace core
00030 }; //end namespace hype
00031 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines