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::RandomPolicy Class Reference

#include <RandomPolicy.h>

+ Inheritance diagram for pdb::RandomPolicy:
+ Collaboration diagram for pdb::RandomPolicy:

Public Member Functions

 RandomPolicy ()
 
 ~RandomPolicy ()
 
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)
 

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)
 

Private Attributes

const int SEED = time(NULL)
 

Additional Inherited Members

- Public Types inherited from pdb::PartitionPolicy
enum  Policy { RANDOM, ROUNDROBIN, FAIR, DEFAULT }
 
- Public Attributes inherited from pdb::PartitionPolicy
std::vector< NodePartitionDataPtrstorageNodes
 

Detailed Description

RandomPolicy simply selects a random 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 40 of file RandomPolicy.h.

Constructor & Destructor Documentation

pdb::RandomPolicy::RandomPolicy ( )

Definition at line 26 of file RandomPolicy.cc.

pdb::RandomPolicy::~RandomPolicy ( )

Definition at line 31 of file RandomPolicy.cc.

Member Function Documentation

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

Definition at line 61 of file RandomPolicy.cc.

+ Here is the caller graph for this function:

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

Implements pdb::PartitionPolicy.

Definition at line 88 of file RandomPolicy.cc.

+ Here is the caller graph for this function:

std::shared_ptr< std::unordered_map< NodeID, Handle< Vector< Handle< Object > > > > > pdb::RandomPolicy::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 93 of file RandomPolicy.cc.

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

Implements pdb::PartitionPolicy.

Definition at line 77 of file RandomPolicy.cc.

+ Here is the caller graph for this function:

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

Implements pdb::PartitionPolicy.

Definition at line 83 of file RandomPolicy.cc.

+ Here is the caller graph for this function:

void pdb::RandomPolicy::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 33 of file RandomPolicy.cc.

+ Here is the call graph for this function:

Member Data Documentation

const int pdb::RandomPolicy::SEED = time(NULL)
private

Definition at line 53 of file RandomPolicy.h.


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