A platform for high-performance distributed tool and library development written in C++. It can be deployed in two different cluster modes: standalone or distributed. API for v0.5.0, released on June 13, 2018.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DefaultDatabase Class Reference

#include <DefaultDatabase.h>

+ Collaboration diagram for DefaultDatabase:

Public Member Functions

 DefaultDatabase (NodeID nodeId, DatabaseID dbId, string dbName, ConfigurationPtr conf, pdb::PDBLoggerPtr logger, SharedMemPtr shm, string metaDBPath, vector< string > *dataDBPaths, PageCachePtr cache, PageCircularBufferPtr flushBuffer)
 
 ~DefaultDatabase ()
 
bool initializeFromDBDir (boost::filesystem::path dbDir)
 
bool initializeFromMetaDBDir (boost::filesystem::path metaDBDir)
 
bool addType (TypePtr type)
 
bool addType (string name, UserTypeID id)
 
TypePtr getType (UserTypeID typeId)
 
bool removeType (UserTypeID typeID)
 
DatabaseID getDatabaseID ()
 
string getDatabaseName ()
 
void flush ()
 
map< UserTypeID, TypePtr > * getTypes ()
 

Protected Member Functions

void addTypeBySequenceFiles (string name, UserTypeID id, boost::filesystem::path typeDir)
 
void addTypeByPartitionedFiles (string name, UserTypeID id, boost::filesystem::path metaTypeDir)
 
void clearType (UserTypeID typeId, string typeName)
 
string encodeTypePath (string dbPath, UserTypeID typeId, string typeName)
 

Private Attributes

ConfigurationPtr conf
 
map< UserTypeID, TypePtr > * types
 
string dbName
 
DatabaseID dbId
 
NodeID nodeId
 
pdb::PDBLoggerPtr logger
 
pthread_mutex_t typeOpLock
 
string metaDBPath
 
vector< string > * dataDBPaths
 
SharedMemPtr shm
 
PageCachePtr cache
 
PageCircularBufferPtr flushBuffer
 

Detailed Description

This class implements a DefaultDatabase object, that consists of a set of UserType objects.

Definition at line 43 of file DefaultDatabase.h.

Constructor & Destructor Documentation

DefaultDatabase::DefaultDatabase ( NodeID  nodeId,
DatabaseID  dbId,
string  dbName,
ConfigurationPtr  conf,
pdb::PDBLoggerPtr  logger,
SharedMemPtr  shm,
string  metaDBPath,
vector< string > *  dataDBPaths,
PageCachePtr  cache,
PageCircularBufferPtr  flushBuffer 
)

Create a database instance.

Definition at line 30 of file DefaultDatabase.cc.

DefaultDatabase::~DefaultDatabase ( )

Definition at line 62 of file DefaultDatabase.cc.

Member Function Documentation

bool DefaultDatabase::addType ( TypePtr  type)

Add a type instance to the database.

Definition at line 106 of file DefaultDatabase.cc.

bool DefaultDatabase::addType ( string  name,
UserTypeID  id 
)

Create and initialize a type instance to the database.

Definition at line 78 of file DefaultDatabase.cc.

void DefaultDatabase::addTypeByPartitionedFiles ( string  name,
UserTypeID  id,
boost::filesystem::path  metaTypeDir 
)
protected

Load a type instance to the database from PartitionedFile instances.

Definition at line 214 of file DefaultDatabase.cc.

void DefaultDatabase::addTypeBySequenceFiles ( string  name,
UserTypeID  id,
boost::filesystem::path  typeDir 
)
protected

Load a type instance to the database from SequenceFile instances.

Definition at line 295 of file DefaultDatabase.cc.

void DefaultDatabase::clearType ( UserTypeID  typeId,
string  typeName 
)
protected

Clear a type, deleting all files and directories associated with the type.

Definition at line 136 of file DefaultDatabase.cc.

string DefaultDatabase::encodeTypePath ( string  dbPath,
UserTypeID  typeId,
string  typeName 
)
protected

Encode type path for creating type directory.

Definition at line 71 of file DefaultDatabase.cc.

void DefaultDatabase::flush ( )

Flush data from input buffers to disk files.

Definition at line 158 of file DefaultDatabase.cc.

DatabaseID DefaultDatabase::getDatabaseID ( )

Return the DatabaseID of the database.

Definition at line 161 of file DefaultDatabase.cc.

string DefaultDatabase::getDatabaseName ( )

Return the name of the database.

Definition at line 166 of file DefaultDatabase.cc.

TypePtr DefaultDatabase::getType ( UserTypeID  typeId)

Get a type from the database.

Definition at line 147 of file DefaultDatabase.cc.

map< UserTypeID, TypePtr > * DefaultDatabase::getTypes ( )

Get all types

Definition at line 326 of file DefaultDatabase.cc.

bool DefaultDatabase::initializeFromDBDir ( boost::filesystem::path  dbDir)

Initialize database instance (e.g. types and sets) by scanning directories and files. This function can only be applied to SequenceFile instances.

Initialize database instance (e.g. types and sets) by scanning meta directories and files. This function can only be applied to SequenceFile instances.

Definition at line 253 of file DefaultDatabase.cc.

bool DefaultDatabase::initializeFromMetaDBDir ( boost::filesystem::path  metaDBDir)

Initialize database instance (e.g. types and sets) by scanning meta directories and files. This function can only be applied to PartitionedFile instances.

Definition at line 176 of file DefaultDatabase.cc.

bool DefaultDatabase::removeType ( UserTypeID  typeID)

Remove a type from the database, and delete all the disk files associated with the type

Definition at line 119 of file DefaultDatabase.cc.

Member Data Documentation

PageCachePtr DefaultDatabase::cache
private

Definition at line 149 of file DefaultDatabase.h.

ConfigurationPtr DefaultDatabase::conf
private

Definition at line 139 of file DefaultDatabase.h.

vector<string>* DefaultDatabase::dataDBPaths
private

Definition at line 147 of file DefaultDatabase.h.

DatabaseID DefaultDatabase::dbId
private

Definition at line 142 of file DefaultDatabase.h.

string DefaultDatabase::dbName
private

Definition at line 141 of file DefaultDatabase.h.

PageCircularBufferPtr DefaultDatabase::flushBuffer
private

Definition at line 150 of file DefaultDatabase.h.

pdb::PDBLoggerPtr DefaultDatabase::logger
private

Definition at line 144 of file DefaultDatabase.h.

string DefaultDatabase::metaDBPath
private

Definition at line 146 of file DefaultDatabase.h.

NodeID DefaultDatabase::nodeId
private

Definition at line 143 of file DefaultDatabase.h.

SharedMemPtr DefaultDatabase::shm
private

Definition at line 148 of file DefaultDatabase.h.

pthread_mutex_t DefaultDatabase::typeOpLock
private

Definition at line 145 of file DefaultDatabase.h.

map<UserTypeID, TypePtr>* DefaultDatabase::types
private

Definition at line 140 of file DefaultDatabase.h.


The documentation for this class was generated from the following files: