Hybrid_Storage_Manager< T > Class Template Reference

Hybrid_Storage_Manager extends Storage_Manager and is used for hybrid architecture. More...

#include <hybrid_storage_manager.h>

Inheritance diagram for Hybrid_Storage_Manager< T >:

Storage_Manager< T > List of all members.

Public Member Functions

 Hybrid_Storage_Manager (Hazy_Database *db_conn, ondisk_storage_spec *spec, Ondisk_Storage_Manager< T > *disk, int nBuffer, bool bUseEps)
 Constructor that initializes Hybrid_Storage_Manager.
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.
void insertEntity (struct hazy_model &m, key e, T f)
 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.

Private Types

typedef std::vector< struct
_full_entity_entry
_tbuffer
typedef std::vector< struct
_full_entity_entry >::iterator 
_tbuffer_it
typedef std::map< key, int > _tentitymap
typedef std::map< key, double > _tepsmap
typedef std::map< key, double
>::iterator 
_tepsmap_iterator
typedef std::ostringstream prepared_stmt
 type definition for string

Private Member Functions

bool isLazy ()
 Returns whether approach is lazy or not.
bool isEager ()
 Returns whether approach is eager or not.
void calculateSpaceUsedByEpsMap (double &spaceUsed)
 Calculates space used by the eps map.
void calculateSpaceUsedByBuffer (double &spaceUsed)
 Calculates space used by the buffer.
void calculateSpaceUsedByEntityMap (double &spaceUsed)
 Calculates space used by entity map.
void calculateSpaceUsed (double &spaceUsed)
 Calculates total space used in memory by eps map, entity map and the buffer.

Static Private Member Functions

static int parse_eps_map (PGresult *res, int index, key &k, double &eps)

Private Attributes

Ondisk_Storage_Manager< T > * _disk
 Ondisk_Storage_Manager is used.
Hazy_Database_conn
 Database connection.
_tbuffer _buffer
_tentitymap _entity_map
bool _epsused
_tepsmap _epsmap
int _buffer_size
 buffer size
double eps_high
 low & high eps
double eps_low
_tbuffer_it low_water_it
 low & high water iterators
_tbuffer_it high_water_it
bool _lazy
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
prepared_stmt query_buffer_fill
 prepared statements
prepared_stmt query_eps_exec
bool _force_monotone
 This is required for the theory to hold.
int log_se_eps_hit
 Logging variables Single Entity Counters.
int log_se_eps_miss
int log_se_buffer_hit
int log_se_buffer_miss
int log_iu_buffer_hit
int log_iu_buffer_miss

Classes

struct  _full_entity_entry
 full_entity_entry contains class of the example, feature vector and eps More...

Detailed Description

template<class T>
class Hybrid_Storage_Manager< T >

Hybrid_Storage_Manager extends Storage_Manager and is used for hybrid architecture.


Member Typedef Documentation

template<class T>
typedef std::vector<struct _full_entity_entry> Hybrid_Storage_Manager< T >::_tbuffer [private]

template<class T>
typedef std::vector<struct _full_entity_entry>::iterator Hybrid_Storage_Manager< T >::_tbuffer_it [private]

template<class T>
typedef std::map<key, int> Hybrid_Storage_Manager< T >::_tentitymap [private]

template<class T>
typedef std::map<key, double> Hybrid_Storage_Manager< T >::_tepsmap [private]

template<class T>
typedef std::map<key,double>::iterator Hybrid_Storage_Manager< T >::_tepsmap_iterator [private]

template<class T>
typedef std::ostringstream Hybrid_Storage_Manager< T >::prepared_stmt [private]

type definition for string


Constructor & Destructor Documentation

template<class T>
Hybrid_Storage_Manager< T >::Hybrid_Storage_Manager ( Hazy_Database db_conn,
ondisk_storage_spec spec,
Ondisk_Storage_Manager< T > *  disk,
int  nBuffer,
bool  bUseEps 
)

Constructor that initializes Hybrid_Storage_Manager.

Parameters:
[in] db_conn databae connection
[in] spec ondisk_storage_spec
[in] disk Ondisk_Storage_Manager
[in] nBuffer buffer size
[in] bUseEps whether use eps map or not


Member Function Documentation

template<class T>
void Hybrid_Storage_Manager< T >::calculateSpaceUsed ( double &  spaceUsed  )  [private]

Calculates total space used in memory by eps map, entity map and the buffer.

Parameters:
[out] spaceUsed total space used in bytes

template<class T>
void Hybrid_Storage_Manager< T >::calculateSpaceUsedByBuffer ( double &  spaceUsed  )  [private]

Calculates space used by the buffer.

Parameters:
[out] spaceUsed space used by the buffer

template<class T>
void Hybrid_Storage_Manager< T >::calculateSpaceUsedByEntityMap ( double &  spaceUsed  )  [private]

Calculates space used by entity map.

Parameters:
[out] spaceUsed space used by entity map

template<class T>
void Hybrid_Storage_Manager< T >::calculateSpaceUsedByEpsMap ( double &  spaceUsed  )  [private]

Calculates space used by the eps map.

Parameters:
[out] spaceUsed space used by the eps map

template<class T>
void Hybrid_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 Hybrid_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 Hybrid_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>
void Hybrid_Storage_Manager< T >::insertEntity ( struct hazy_model m,
key  e,
f 
) [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 >.

template<class T>
bool Hybrid_Storage_Manager< T >::isEager (  )  [inline, private]

Returns whether approach is eager or not.

Returns:
approach is eager

template<class T>
bool Hybrid_Storage_Manager< T >::isLazy (  )  [inline, private]

Returns whether approach is lazy or not.

Returns:
approach is lazy

template<class T>
static int Hybrid_Storage_Manager< T >::parse_eps_map ( PGresult *  res,
int  index,
key k,
double &  eps 
) [inline, static, private]

template<class T>
void Hybrid_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 >.


Member Data Documentation

template<class T>
_tbuffer Hybrid_Storage_Manager< T >::_buffer [private]

template<class T>
int Hybrid_Storage_Manager< T >::_buffer_size [private]

buffer size

template<class T>
Hazy_Database* Hybrid_Storage_Manager< T >::_conn [private]

Database connection.

template<class T>
Ondisk_Storage_Manager<T>* Hybrid_Storage_Manager< T >::_disk [private]

Ondisk_Storage_Manager is used.

template<class T>
_tentitymap Hybrid_Storage_Manager< T >::_entity_map [private]

template<class T>
_tepsmap Hybrid_Storage_Manager< T >::_epsmap [private]

template<class T>
bool Hybrid_Storage_Manager< T >::_epsused [private]

template<class T>
bool Hybrid_Storage_Manager< T >::_force_monotone [private]

This is required for the theory to hold.

template<class T>
bool Hybrid_Storage_Manager< T >::_lazy [private]

template<class T>
double Hybrid_Storage_Manager< T >::eps_high [private]

low & high eps

template<class T>
double Hybrid_Storage_Manager< T >::eps_low [private]

template<class T>
_tbuffer_it Hybrid_Storage_Manager< T >::high_water_it [private]

template<class T>
int Hybrid_Storage_Manager< T >::log_iu_buffer_hit [private]

template<class T>
int Hybrid_Storage_Manager< T >::log_iu_buffer_miss [private]

template<class T>
int Hybrid_Storage_Manager< T >::log_se_buffer_hit [private]

template<class T>
int Hybrid_Storage_Manager< T >::log_se_buffer_miss [private]

template<class T>
int Hybrid_Storage_Manager< T >::log_se_eps_hit [private]

Logging variables Single Entity Counters.

template<class T>
int Hybrid_Storage_Manager< T >::log_se_eps_miss [private]

template<class T>
_tbuffer_it Hybrid_Storage_Manager< T >::low_water_it [private]

low & high water iterators

template<class T>
prepared_stmt Hybrid_Storage_Manager< T >::query_buffer_fill [private]

prepared statements

template<class T>
prepared_stmt Hybrid_Storage_Manager< T >::query_eps_exec [private]

template<class T>
int Hybrid_Storage_Manager< T >::unique_id_for_ps [private]

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