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.
|
#include <DefaultDatabase.h>
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 |
This class implements a DefaultDatabase object, that consists of a set of UserType objects.
Definition at line 43 of file DefaultDatabase.h.
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.
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.
|
protected |
Load a type instance to the database from PartitionedFile instances.
Definition at line 214 of file DefaultDatabase.cc.
|
protected |
Load a type instance to the database from SequenceFile instances.
Definition at line 295 of file DefaultDatabase.cc.
|
protected |
Clear a type, deleting all files and directories associated with the type.
Definition at line 136 of file DefaultDatabase.cc.
|
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.
|
private |
Definition at line 149 of file DefaultDatabase.h.
|
private |
Definition at line 139 of file DefaultDatabase.h.
|
private |
Definition at line 147 of file DefaultDatabase.h.
|
private |
Definition at line 142 of file DefaultDatabase.h.
|
private |
Definition at line 141 of file DefaultDatabase.h.
|
private |
Definition at line 150 of file DefaultDatabase.h.
|
private |
Definition at line 144 of file DefaultDatabase.h.
|
private |
Definition at line 146 of file DefaultDatabase.h.
|
private |
Definition at line 143 of file DefaultDatabase.h.
|
private |
Definition at line 148 of file DefaultDatabase.h.
|
private |
Definition at line 145 of file DefaultDatabase.h.
|
private |
Definition at line 140 of file DefaultDatabase.h.