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

#include <DataProxy.h>

+ Collaboration diagram for DataProxy:

Public Member Functions

 DataProxy (NodeID nodeId, pdb::PDBCommunicatorPtr communicator, SharedMemPtr shm, pdb::PDBLoggerPtr logger)
 
 ~DataProxy ()
 
bool addTempSet (string setName, SetID &setId, bool needMem=true, int numTries=0)
 
bool removeTempSet (SetID setId, bool needMem=true, int numTries=0)
 
bool addTempPage (SetID setId, PDBPagePtr &page, bool needMem=true, int numTries=0)
 
bool addUserPage (DatabaseID dbId, UserTypeID typeId, SetID setId, PDBPagePtr &page, bool needMem=true, int numTries=0)
 
bool pinTempPage (SetID setId, PageID pageId, PDBPagePtr &page, bool needMem=true, int numTries=0)
 
bool unpinTempPage (SetID setId, PDBPagePtr page, bool needMem=true, int numTries=0)
 
bool pinUserPage (NodeID nodeId, DatabaseID dbId, UserTypeID typeId, SetID setId, PageID pageId, PDBPagePtr &page, bool needMem=true, int numTries=0)
 
bool pinBytes (DatabaseID dbId, UserTypeID typeId, SetID setId, size_t sizeOfBytes, void *bytes, bool needMem=true, int numTries=0)
 
bool unpinUserPage (NodeID nodeId, DatabaseID dbId, UserTypeID typeId, SetID setId, PDBPagePtr page, bool needMem=true, int numTries=0)
 
PageScannerPtr getScanner (int numThreads)
 

Private Attributes

pdb::PDBCommunicatorPtr communicator
 
SharedMemPtr shm
 
pdb::PDBLoggerPtr logger
 
NodeID nodeId
 

Detailed Description

Definition at line 41 of file DataProxy.h.

Constructor & Destructor Documentation

DataProxy::DataProxy ( NodeID  nodeId,
pdb::PDBCommunicatorPtr  communicator,
SharedMemPtr  shm,
pdb::PDBLoggerPtr  logger 
)

Definition at line 45 of file DataProxy.cc.

DataProxy::~DataProxy ( )

Definition at line 56 of file DataProxy.cc.

Member Function Documentation

bool DataProxy::addTempPage ( SetID  setId,
PDBPagePtr page,
bool  needMem = true,
int  numTries = 0 
)

Add a page to the temporary set specified by the given SetID. The storage system will allocate PageID to the page. If successful, return true, otherwise (like setId doesn't exists), return false. Immediately, the page will be pinned at storage, and is ready for read/write in memory.

Definition at line 222 of file DataProxy.cc.

+ Here is the call graph for this function:

bool DataProxy::addTempSet ( string  setName,
SetID setId,
bool  needMem = true,
int  numTries = 0 
)

Add a temporary set to store intermediate data with setName specified. The storage system will allocate SetID to the temporary set. If successful, return true, otherwise (like setName exists), return false.

Definition at line 58 of file DataProxy.cc.

bool DataProxy::addUserPage ( DatabaseID  dbId,
UserTypeID  typeId,
SetID  setId,
PDBPagePtr page,
bool  needMem = true,
int  numTries = 0 
)

Add a page to the set specified by the given DbId, TypeId, and SetID. The storage system will allocate PageID to the page. If successful, return true, otherwise (like setId doesn't exists), return false. Immediately, the page will be pinned at storage, and is ready for read/write in memory.

Definition at line 226 of file DataProxy.cc.

+ Here is the caller graph for this function:

PageScannerPtr DataProxy::getScanner ( int  numThreads)

Create a PageScanner instance given the specified thread number. Return a smart pointer pointing at the created PageScanner instance.

Definition at line 665 of file DataProxy.cc.

bool DataProxy::pinBytes ( DatabaseID  dbId,
UserTypeID  typeId,
SetID  setId,
size_t  sizeOfBytes,
void *  bytes,
bool  needMem = true,
int  numTries = 0 
)

Copy bytes to a page in localset, it returns true if successful.

Definition at line 336 of file DataProxy.cc.

bool DataProxy::pinTempPage ( SetID  setId,
PageID  pageId,
PDBPagePtr page,
bool  needMem = true,
int  numTries = 0 
)

Pin a page in the temporary set specified by the given SetID and PageID to the storage, so that it can get ready for read/write in memory. If successful, return true, otherwise (like setId or pageId does not exist), return false.

Definition at line 434 of file DataProxy.cc.

+ Here is the call graph for this function:

bool DataProxy::pinUserPage ( NodeID  nodeId,
DatabaseID  dbId,
UserTypeID  typeId,
SetID  setId,
PageID  pageId,
PDBPagePtr page,
bool  needMem = true,
int  numTries = 0 
)

Pin a page in the user set specified by the given DatabaseID, UserTypeID, SetID and PageID to the storage, so that it can get ready for read/write in memory. If successful, return true, otherwise (like dbId, typeId, setId or pageId does not exist), return false.

Definition at line 439 of file DataProxy.cc.

+ Here is the caller graph for this function:

bool DataProxy::removeTempSet ( SetID  setId,
bool  needMem = true,
int  numTries = 0 
)

Remove a temp set with the specified SetID. If successful, return true, otherwise (like setId doesn't exists), return false.

Definition at line 144 of file DataProxy.cc.

bool DataProxy::unpinTempPage ( SetID  setId,
PDBPagePtr  page,
bool  needMem = true,
int  numTries = 0 
)

UnPin a page in the temporary set specified by the given SetID and PageID from memory, so that it can be flushed to disk if it is in input buffer, or can be evicted if it is in cache. If successful, return true, otherwise (like setId or pageId does not exist), return false.

Definition at line 554 of file DataProxy.cc.

+ Here is the call graph for this function:

bool DataProxy::unpinUserPage ( NodeID  nodeId,
DatabaseID  dbId,
UserTypeID  typeId,
SetID  setId,
PDBPagePtr  page,
bool  needMem = true,
int  numTries = 0 
)

UnPin a page in the user set specified by the given DatabaseID, UserTypeID, SetID and PageID from memory, so that it can be flushed to disk if it is in input buffer, or can be evicted if it is in cache. If successful, return true, otherwise (like dbId, typeId, setId or pageId does not exist), return false.

Definition at line 558 of file DataProxy.cc.

+ Here is the caller graph for this function:

Member Data Documentation

pdb::PDBCommunicatorPtr DataProxy::communicator
private

Definition at line 151 of file DataProxy.h.

pdb::PDBLoggerPtr DataProxy::logger
private

Definition at line 153 of file DataProxy.h.

NodeID DataProxy::nodeId
private

Definition at line 154 of file DataProxy.h.

SharedMemPtr DataProxy::shm
private

Definition at line 152 of file DataProxy.h.


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