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 <PageScanner.h>
Public Member Functions | |
PageScanner (pdb::PDBCommunicatorPtr communicator, SharedMemPtr shm, pdb::PDBLoggerPtr logger, int numThreads, int recvBufSize, NodeID nodeId) | |
~PageScanner () | |
vector < PageCircularBufferIteratorPtr > | getSetIterators (NodeID nodeId, DatabaseID dbId, UserTypeID typeId, SetID setId) |
bool | acceptPagePinned (pdb::PDBCommunicatorPtr myCommunicator, string &errMsg, bool &morePagesToLoad, NodeID &dataNodeId, DatabaseID &dataDbId, UserTypeID &dataTypeId, SetID &dataSetId, PageID &dataPageId, size_t &pageSize, size_t &offset) |
bool | sendPagePinnedAck (pdb::PDBCommunicatorPtr myCommunicator, bool wasError, string info, string &errMsg) |
bool | recvPagesLoop (pdb::Handle< pdb::StoragePagePinned > pinnedPage, pdb::PDBCommunicatorPtr myCommunicator) |
void | closeBuffer () |
void | openBuffer () |
Private Attributes | |
pdb::PDBCommunicatorPtr | communicator |
pdb::PDBLoggerPtr | logger |
PageCircularBufferPtr | buffer |
unsigned int | numThreads |
SharedMemPtr | shm |
NodeID | nodeId |
This class implements the page scanning procedure at backend server. User first needs to call getSetIterators() to obtain a set of iterators given the specified set information and number of threads. User then needs to call recvPagesLoop() to receive pages from frontend, and add pages to the concurrent blocking buffer, that is an instance of PageCircularBuffer class. At the end of recvPagesLoop(), it will receive a special message from frontend, telling the scanner that all messages have been received and the recvPagesLoop() can return.
Definition at line 53 of file PageScanner.h.
PageScanner::PageScanner | ( | pdb::PDBCommunicatorPtr | communicator, |
SharedMemPtr | shm, | ||
pdb::PDBLoggerPtr | logger, | ||
int | numThreads, | ||
int | recvBufSize, | ||
NodeID | nodeId | ||
) |
Definition at line 38 of file PageScanner.cc.
PageScanner::~PageScanner | ( | ) |
Definition at line 52 of file PageScanner.cc.
bool PageScanner::acceptPagePinned | ( | pdb::PDBCommunicatorPtr | myCommunicator, |
string & | errMsg, | ||
bool & | morePagesToLoad, | ||
NodeID & | dataNodeId, | ||
DatabaseID & | dataDbId, | ||
UserTypeID & | dataTypeId, | ||
SetID & | dataSetId, | ||
PageID & | dataPageId, | ||
size_t & | pageSize, | ||
size_t & | offset | ||
) |
To receive PagePinned objects from frontend.
Definition at line 57 of file PageScanner.cc.
void PageScanner::closeBuffer | ( | ) |
Close the buffer
Definition at line 212 of file PageScanner.cc.
vector< PageCircularBufferIteratorPtr > PageScanner::getSetIterators | ( | NodeID | nodeId, |
DatabaseID | dbId, | ||
UserTypeID | typeId, | ||
SetID | setId | ||
) |
Obtain a set of iterators given the specified set information and number of threads. Each iterator work as a consumer, retrieving a page from the concurrent blocking buffer, each time when next() is invoked.
Definition at line 113 of file PageScanner.cc.
void PageScanner::openBuffer | ( | ) |
Open the buffer
Definition at line 218 of file PageScanner.cc.
bool PageScanner::recvPagesLoop | ( | pdb::Handle< pdb::StoragePagePinned > | pinnedPage, |
pdb::PDBCommunicatorPtr | myCommunicator | ||
) |
Receive pages from frontend, and add them to the concurrent blocking buffer, that is an instance of PageCircularBuffer class. At the end of recvPagesLoop(), it will receive a special message from frontend, telling the scanner that all messages have been received and the recvPagesLoop() can return.
You can start multiple loops by assigning multiple different PDBCommunicators respectively.
Definition at line 144 of file PageScanner.cc.
bool PageScanner::sendPagePinnedAck | ( | pdb::PDBCommunicatorPtr | myCommunicator, |
bool | wasError, | ||
string | info, | ||
string & | errMsg | ||
) |
To send PagePinnedAck objects to frontend to acknowledge the receipt of PagePinned objects.
Definition at line 98 of file PageScanner.cc.
|
private |
Definition at line 122 of file PageScanner.h.
|
private |
Definition at line 120 of file PageScanner.h.
|
private |
Definition at line 121 of file PageScanner.h.
|
private |
Definition at line 125 of file PageScanner.h.
|
private |
Definition at line 123 of file PageScanner.h.
|
private |
Definition at line 124 of file PageScanner.h.