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
UserType Class Reference

#include <UserType.h>

+ Collaboration diagram for UserType:

Public Member Functions

 UserType (NodeID nodeId, DatabaseID dbId, UserTypeID id, string name, ConfigurationPtr conf, pdb::PDBLoggerPtr logger, SharedMemPtr shm, string metaTypePath, vector< string > *dataTypePaths, PageCachePtr cache, PageCircularBufferPtr flushBuffer)
 
 ~UserType ()
 
void flush ()
 
int addSet (string setName, SetID setId, size_t pageSize=DEFAULT_PAGE_SIZE)
 
int removeSet (SetID setId)
 
SetPtr getSet (SetID setId)
 
bool initializeFromTypeDir (path typeDir)
 
bool initializeFromMetaTypeDir (path metaTypeDir)
 
UserTypeID getId () const
 
string getName () const
 
void setId (UserTypeID id)
 
void setName (string name)
 
unsigned int getNumSets ()
 
map< SetID, SetPtr > * getSets ()
 

Protected Member Functions

string encodePath (string typePath, SetID setId, string setName)
 

Private Attributes

string name
 
UserTypeID id
 
NodeID nodeId
 
DatabaseID dbId
 
int numSets
 
map< SetID, SetPtr > * sets
 
ConfigurationPtr conf
 
pdb::PDBLoggerPtr logger
 
SharedMemPtr shm
 
string metaPath
 
vector< string > * dataPaths
 
PageCachePtr cache
 
PageCircularBufferPtr flushBuffer
 
pthread_mutex_t setLock
 

Detailed Description

This class defines a UserType structure used to store all the data of the same UserTypeID. A UserType instance contains one or more Sets. Each Set has an input buffer, and associated with a PDBFile instance. When data comes in, it goes to input buffer first, then flushed to the PDBFile instance.

Definition at line 52 of file UserType.h.

Constructor & Destructor Documentation

UserType::UserType ( NodeID  nodeId,
DatabaseID  dbId,
UserTypeID  id,
string  name,
ConfigurationPtr  conf,
pdb::PDBLoggerPtr  logger,
SharedMemPtr  shm,
string  metaTypePath,
vector< string > *  dataTypePaths,
PageCachePtr  cache,
PageCircularBufferPtr  flushBuffer 
)

Create a UserType instance.

Definition at line 24 of file UserType.cc.

UserType::~UserType ( )

Release the in-memory structure that is belonging to a UserType instance. It will not remove the persistent data on disk that is belonging to the UserType.

Definition at line 64 of file UserType.cc.

Member Function Documentation

int UserType::addSet ( string  setName,
SetID  setId,
size_t  pageSize = DEFAULT_PAGE_SIZE 
)

Definition at line 92 of file UserType.cc.

+ Here is the call graph for this function:

string UserType::encodePath ( string  typePath,
SetID  setId,
string  setName 
)
protected

Compute the path to store the UserType data for persistence.

Definition at line 84 of file UserType.cc.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void UserType::flush ( )

Flush UserType data from memory to a PDBFile instance for persistence.

Definition at line 79 of file UserType.cc.

UserTypeID UserType::getId ( ) const
inline

Definition at line 101 of file UserType.h.

string UserType::getName ( ) const
inline

Definition at line 106 of file UserType.h.

unsigned int UserType::getNumSets ( )
inline

Definition at line 121 of file UserType.h.

SetPtr UserType::getSet ( SetID  setId)

Definition at line 150 of file UserType.cc.

map<SetID, SetPtr>* UserType::getSets ( )
inline

Definition at line 125 of file UserType.h.

bool UserType::initializeFromMetaTypeDir ( path  metaTypeDir)

Definition at line 163 of file UserType.cc.

bool UserType::initializeFromTypeDir ( path  typeDir)

Definition at line 232 of file UserType.cc.

int UserType::removeSet ( SetID  setId)

Definition at line 131 of file UserType.cc.

void UserType::setId ( UserTypeID  id)
inline

Definition at line 111 of file UserType.h.

+ Here is the caller graph for this function:

void UserType::setName ( string  name)
inline

Definition at line 116 of file UserType.h.

+ Here is the caller graph for this function:

Member Data Documentation

PageCachePtr UserType::cache
private

Definition at line 148 of file UserType.h.

ConfigurationPtr UserType::conf
private

Definition at line 143 of file UserType.h.

vector<string>* UserType::dataPaths
private

Definition at line 147 of file UserType.h.

DatabaseID UserType::dbId
private

Definition at line 140 of file UserType.h.

PageCircularBufferPtr UserType::flushBuffer
private

Definition at line 149 of file UserType.h.

UserTypeID UserType::id
private

Definition at line 138 of file UserType.h.

pdb::PDBLoggerPtr UserType::logger
private

Definition at line 144 of file UserType.h.

string UserType::metaPath
private

Definition at line 146 of file UserType.h.

string UserType::name
private

Definition at line 137 of file UserType.h.

NodeID UserType::nodeId
private

Definition at line 139 of file UserType.h.

int UserType::numSets
private

Definition at line 141 of file UserType.h.

pthread_mutex_t UserType::setLock
private

Definition at line 150 of file UserType.h.

map<SetID, SetPtr>* UserType::sets
private

Definition at line 142 of file UserType.h.

SharedMemPtr UserType::shm
private

Definition at line 145 of file UserType.h.


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