#include <hazy_model.h>
Public Types | |
LAZY_NAIVE | |
EAGER_NAIVE | |
LAZY_HAZY | |
EAGER_HAZY | |
enum | strategy { LAZY_NAIVE, EAGER_NAIVE, LAZY_HAZY, EAGER_HAZY } |
Public Member Functions | |
bool | test_and_set_model_in_db () |
Returns true if the model is in the database. | |
void | invalidate_db_model () |
Invalidates model_is_in_db variable. | |
bool | isEager () |
Returns whether the strategy is eager or not. | |
bool | isLazy () |
Returns whether the strategy is lazy or not. | |
bool | isHazy () |
Returns whether the strategy is hazy or not. | |
bool | isNaive () |
Returns whether the strategy is naive or not. | |
hazy_model (struct model &model, strategy s) | |
hazy_model constructor | |
Static Public Member Functions | |
static bool | isEager (strategy s) |
Returns whether given strategy is eager or not. | |
static bool | isLazy (strategy s) |
Returns whether given strategy is lazy or not. | |
static bool | isHazy (strategy s) |
Returns whether given strategy is hazy or not. | |
static bool | isNaive (strategy s) |
Returns whether given strategy is naive or not. | |
Public Attributes | |
model & | _model |
enum hazy_model::strategy | _strategy |
double | low_water |
double | high_water |
bool | model_is_in_db |
This is used by the LAZY algorithms to determine if they need to reupdate/cache the model inside the database. |
It also contains some helper functions for the enum, strategy
enum hazy_model::strategy |
void hazy_model::invalidate_db_model | ( | ) | [inline] |
Invalidates model_is_in_db variable.
static bool hazy_model::isEager | ( | strategy | s | ) | [inline, static] |
Returns whether given strategy is eager or not.
[in] | s | strategy |
bool hazy_model::isEager | ( | ) | [inline] |
Returns whether the strategy is eager or not.
static bool hazy_model::isHazy | ( | strategy | s | ) | [inline, static] |
Returns whether given strategy is hazy or not.
[in] | s | strategy |
bool hazy_model::isHazy | ( | ) | [inline] |
Returns whether the strategy is hazy or not.
static bool hazy_model::isLazy | ( | strategy | s | ) | [inline, static] |
Returns whether given strategy is lazy or not.
[in] | s | strategy |
bool hazy_model::isLazy | ( | ) | [inline] |
Returns whether the strategy is lazy or not.
static bool hazy_model::isNaive | ( | strategy | s | ) | [inline, static] |
Returns whether given strategy is naive or not.
[in] | s | strategy |
bool hazy_model::isNaive | ( | ) | [inline] |
Returns whether the strategy is naive or not.
bool hazy_model::test_and_set_model_in_db | ( | ) | [inline] |
Returns true if the model is in the database.
struct model& hazy_model::_model |
double hazy_model::high_water |
double hazy_model::low_water |
This is used by the LAZY algorithms to determine if they need to reupdate/cache the model inside the database.
It is to support an optimization. The protocol is that a model is in the db, until an update arrives, then we can no longer assume that the model is inside the databse. when we execute the prepared stmt (or equivalent) of model caching we will set this value to be true.