Ondisk_Storage_Manager< T > Class Template Reference

Storage manager that interacts with either main memory entities or on-disk entities (or both for hybrid). More...

#include <ondisk_storage_manager.h>

Inheritance diagram for Ondisk_Storage_Manager< T >:

Storage_Manager< T > List of all members.

Public Member Functions

 Ondisk_Storage_Manager (Hazy_Database *db_conn, struct ondisk_storage_spec *spec)
 Constructor that takes database connector and ondisk storage spec.
void resort (struct hazy_model &m)
 Makes a resort to reorganize entities according to their epsilon values.
void incrementalUpdate (struct hazy_model &m, double &waste_time)
 Makes an incremental update on the entities by using hazy model.
virtual void insertEntity (struct hazy_model &m, key e, T f)=0
 Inserts the entity to the storage manager.
void getEntityClass (key e, sClass &c, struct hazy_model &m)
 Retrieves the class of the entity.
void getNumInClass (sClass c, int &nClass, struct hazy_model &m, double &waste_time)
 Retrieves # of elements that belong to a given class.
 ~Ondisk_Storage_Manager ()
 Destructor.

Protected Member Functions

void updateInternalTable (struct hazy_model &m)
 Updates internal table from given model and bias First, the internal table is clustered on new epsilon values based on the hazy model.
void update_disk_region (struct hazy_model &hm, double lower_bound, double upper_bound, double &waste_time)
 This function updates a disk region The hybrid calls it (via a friend method) : *** This is factored this way for optimization.
void rescan (struct hazy_model &hm)
 Helper function for naive eager that recreates the external table.
void setup (bool bRebuild, struct hazy_model &hm)
 Does initial setup If bRebuild is true, recreates all prepared statements and tables.

Protected Attributes

std::string external_table_name
 External results table name for on-disk.
std::string hazy_intermediate_table_name
 Internal results table for on-disk.
hazy_model::strategy _strategy
int unique_id_for_ps
 unique id for prepared statements in order to prevent any conflict in the same database connection, there cannot be prepared statements with exact same name

Detailed Description

template<class T>
class Ondisk_Storage_Manager< T >

Storage manager that interacts with either main memory entities or on-disk entities (or both for hybrid).


Constructor & Destructor Documentation

template<class T>
Ondisk_Storage_Manager< T >::Ondisk_Storage_Manager ( Hazy_Database db_conn,
struct ondisk_storage_spec spec 
)

Constructor that takes database connector and ondisk storage spec.

Parameters:
[in] db_conn database connection
[in] spec ondisk_storage_spec

template<class T>
Ondisk_Storage_Manager< T >::~Ondisk_Storage_Manager (  ) 

Destructor.


Member Function Documentation

template<class T>
void Ondisk_Storage_Manager< T >::getEntityClass ( key  e,
sClass c,
struct hazy_model m 
) [virtual]

Retrieves the class of the entity.

Parameters:
[in] e entitiy id
[out] c class of the entity
[in] m hazy model that we use to classify the entity

Implements Storage_Manager< T >.

template<class T>
void Ondisk_Storage_Manager< T >::getNumInClass ( sClass  c,
int &  nClass,
struct hazy_model m,
double &  waste_time 
) [virtual]

Retrieves # of elements that belong to a given class.

Parameters:
[in] c class that we ask # of elements belong it
[out] nClass # of elements in the class
[in] m hazy model that we use to classify entities
[out] waste_time waste time calculated during the method execution

Implements Storage_Manager< T >.

template<class T>
void Ondisk_Storage_Manager< T >::incrementalUpdate ( struct hazy_model m,
double &  waste_time 
) [virtual]

Makes an incremental update on the entities by using hazy model.

Parameters:
[in] m hazy model that we use to update entities classes
[out] waste_time waste time calcaulted during the method execution

Implements Storage_Manager< T >.

template<class T>
virtual void Ondisk_Storage_Manager< T >::insertEntity ( struct hazy_model m,
key  e,
f 
) [pure virtual]

Inserts the entity to the storage manager.

Parameters:
[in] m hazy model which is used when the approach is hazy, because we need to calculate eps value
[in] e id of the entity
[in] f feature vector of the entity

Implements Storage_Manager< T >.

Implemented in Ondisk_Storage_Manager_Dense, and Ondisk_Storage_Manager_Sparse.

template<class T>
void Ondisk_Storage_Manager< T >::rescan ( struct hazy_model hm  )  [protected]

Helper function for naive eager that recreates the external table.

Parameters:
[in] hm hazy model

template<class T>
void Ondisk_Storage_Manager< T >::resort ( struct hazy_model m  )  [virtual]

Makes a resort to reorganize entities according to their epsilon values.

Parameters:
[in] m hazy model that we use to re-calculate epsllon values

Implements Storage_Manager< T >.

template<class T>
void Ondisk_Storage_Manager< T >::setup ( bool  bRebuild,
struct hazy_model hm 
) [protected]

Does initial setup If bRebuild is true, recreates all prepared statements and tables.

Then, fills internal and external tables by using hazy model

Parameters:
[in] bRebuild If this is true, then all tables and prepared statements are created
[in] hm hazy model

template<class T>
void Ondisk_Storage_Manager< T >::update_disk_region ( struct hazy_model hm,
double  lower_bound,
double  upper_bound,
double &  waste_time 
) [protected]

This function updates a disk region The hybrid calls it (via a friend method) : *** This is factored this way for optimization.

The input is a model and X = [lower_bound, upper_bound] NB: The region is inclusive. for each tuple t s.t. t.eps in X, we reclassify them with the model.

Parameters:
[in] hm hazy model
[in] lower_bound low water
[in] upper_bound high water
[out] waste_time 

template<class T>
void Ondisk_Storage_Manager< T >::updateInternalTable ( struct hazy_model m  )  [protected]

Updates internal table from given model and bias First, the internal table is clustered on new epsilon values based on the hazy model.

Then necessary indexes are created

Parameters:
[in] m hazy_model


Member Data Documentation

template<class T>
hazy_model::strategy Ondisk_Storage_Manager< T >::_strategy [protected]

template<class T>
std::string Ondisk_Storage_Manager< T >::external_table_name [protected]

External results table name for on-disk.

template<class T>
std::string Ondisk_Storage_Manager< T >::hazy_intermediate_table_name [protected]

Internal results table for on-disk.

template<class T>
int Ondisk_Storage_Manager< T >::unique_id_for_ps [protected]

unique id for prepared statements in order to prevent any conflict in the same database connection, there cannot be prepared statements with exact same name


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 10:46:16 2010 for Hazy_System by  doxygen 1.4.7