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
pdb::RoundRobinPolicy Class Reference

#include <RoundRobinPolicy.h>

+ Inheritance diagram for pdb::RoundRobinPolicy:
+ Collaboration diagram for pdb::RoundRobinPolicy:

Public Member Functions

 RoundRobinPolicy ()
 
 ~RoundRobinPolicy ()
 
void updateStorageNodes (Handle< Vector< Handle< NodeDispatcherData >>> storageNodes)
 
std::shared_ptr
< std::unordered_map< NodeID,
Handle< Vector< Handle< Object > > > > > 
partition (Handle< Vector< Handle< Object >>> toPartition)
 
- Public Member Functions inherited from pdb::PartitionPolicy
std::vector< NodePartitionDataPtrcreateNodePartitionData (Handle< Vector< Handle< NodeDispatcherData >>> storageNodes)
 

Public Attributes

int numNodes = 0
 
pthread_mutex_t idMutex
 
- Public Attributes inherited from pdb::PartitionPolicy
std::vector< NodePartitionDataPtrstorageNodes
 

Static Public Attributes

static unsigned int curNodeId = 0
 

Private Member Functions

std::vector< NodePartitionDataPtrcreateNodePartitionData (Handle< Vector< Handle< NodeDispatcherData >>> storageNodes)
 
NodePartitionDataPtr updateExistingNode (NodePartitionDataPtr newNodeData, NodePartitionDataPtr oldNodeData)
 
NodePartitionDataPtr updateNewNode (NodePartitionDataPtr newNode)
 
NodePartitionDataPtr handleDeadNode (NodePartitionDataPtr deadNode)
 

Additional Inherited Members

- Public Types inherited from pdb::PartitionPolicy
enum  Policy { RANDOM, ROUNDROBIN, FAIR, DEFAULT }
 

Detailed Description

RoundRobinPolicy simply selects the next node from its Storage Nodes List to send the entire Vector of data to. We send the entire Vector to a single node instead of partitioning it on an Object granularity to save time.

Definition at line 38 of file RoundRobinPolicy.h.

Constructor & Destructor Documentation

pdb::RoundRobinPolicy::RoundRobinPolicy ( )

Definition at line 26 of file RoundRobinPolicy.cc.

pdb::RoundRobinPolicy::~RoundRobinPolicy ( )

Definition at line 31 of file RoundRobinPolicy.cc.

Member Function Documentation

std::vector< NodePartitionDataPtr > pdb::RoundRobinPolicy::createNodePartitionData ( Handle< Vector< Handle< NodeDispatcherData >>>  storageNodes)
private

Definition at line 64 of file RoundRobinPolicy.cc.

+ Here is the caller graph for this function:

NodePartitionDataPtr pdb::RoundRobinPolicy::handleDeadNode ( NodePartitionDataPtr  deadNode)
privatevirtual

Implements pdb::PartitionPolicy.

Definition at line 91 of file RoundRobinPolicy.cc.

+ Here is the caller graph for this function:

std::shared_ptr< std::unordered_map< NodeID, Handle< Vector< Handle< Object > > > > > pdb::RoundRobinPolicy::partition ( Handle< Vector< Handle< Object >>>  toPartition)
virtual

Partitions a Vector of PDB data into a number of smaller Vectors all mapped to a respective Storage Node

Parameters
toPartitiona vector of PDB::Objects to be stored
Returns
a mapping from node ids to the PDB::Objects that should be stored there

Implements pdb::PartitionPolicy.

Definition at line 97 of file RoundRobinPolicy.cc.

NodePartitionDataPtr pdb::RoundRobinPolicy::updateExistingNode ( NodePartitionDataPtr  newNodeData,
NodePartitionDataPtr  oldNodeData 
)
privatevirtual

Implements pdb::PartitionPolicy.

Definition at line 80 of file RoundRobinPolicy.cc.

+ Here is the caller graph for this function:

NodePartitionDataPtr pdb::RoundRobinPolicy::updateNewNode ( NodePartitionDataPtr  newNode)
privatevirtual

Implements pdb::PartitionPolicy.

Definition at line 86 of file RoundRobinPolicy.cc.

+ Here is the caller graph for this function:

void pdb::RoundRobinPolicy::updateStorageNodes ( Handle< Vector< Handle< NodeDispatcherData >>>  storageNodes)
virtual

Updates PartitionPolicy with a collection of all the available storage nodes in the cluster

Parameters
storageNodesa vector of the live storage nodes

Implements pdb::PartitionPolicy.

Definition at line 35 of file RoundRobinPolicy.cc.

+ Here is the call graph for this function:

Member Data Documentation

unsigned int pdb::RoundRobinPolicy::curNodeId = 0
static

Definition at line 42 of file RoundRobinPolicy.h.

pthread_mutex_t pdb::RoundRobinPolicy::idMutex

Definition at line 44 of file RoundRobinPolicy.h.

int pdb::RoundRobinPolicy::numNodes = 0

Definition at line 43 of file RoundRobinPolicy.h.


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