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::AbstractPhysicalNode Class Referenceabstract

#include <AbstractPhysicalNode.h>

+ Inheritance diagram for pdb::AbstractPhysicalNode:
+ Collaboration diagram for pdb::AbstractPhysicalNode:

Public Member Functions

 AbstractPhysicalNode (string &jobId, const Handle< ComputePlan > &computePlan, LogicalPlanPtr &logicalPlan, ConfigurationPtr &conf)
 
virtual PhysicalOptimizerResultPtr analyze (const StatisticsPtr &stats, int nextStageID)=0
 
virtual double getCost (const StatisticsPtr &stats)=0
 
virtual bool hasConsumers ()=0
 
virtual bool isConsuming (Handle< SetIdentifier > &set)=0
 
virtual std::string getNodeIdentifier ()=0
 
AbstractPhysicalNodePtr getHandle ()
 
virtual void removeConsumer (const AbstractPhysicalNodePtr &consumer)
 
virtual void addConsumer (const pdb::AbstractPhysicalNodePtr &consumer)
 
AbstractPhysicalNodePtr getConsumer (int idx)
 
size_t getNumConsumers ()
 
AbstractPhysicalNodePtr getProducer (int idx)
 
size_t getNumProducers ()
 
template<typename T >
std::shared_ptr< T > to ()
 

Protected Member Functions

Handle< SetIdentifiergetSetIdentifierFromComputation (Handle< Computation > computation)
 

Protected Attributes

std::string jobId
 
Handle< ComputePlancomputePlan
 
LogicalPlanPtr logicalPlan
 
ConfigurationPtr conf
 
std::list
< AbstractPhysicalNodePtr
consumers
 
std::list
< AbstractPhysicalNodeWeakPtr
producers
 
AbstractPhysicalNodeWeakPtr handle
 

Detailed Description

All PhysicalNodes inherit from this class. Instances of this abstract class are used to analyze the TCAP graph and generate a physical plan out of it.

Definition at line 75 of file AbstractPhysicalNode.h.

Constructor & Destructor Documentation

pdb::AbstractPhysicalNode::AbstractPhysicalNode ( string &  jobId,
const Handle< ComputePlan > &  computePlan,
LogicalPlanPtr logicalPlan,
ConfigurationPtr conf 
)

Definition at line 26 of file AbstractPhysicalNode.cc.

Member Function Documentation

virtual void pdb::AbstractPhysicalNode::addConsumer ( const pdb::AbstractPhysicalNodePtr consumer)
inlinevirtual

Adds a consumer to the node

Parameters
consumerthe consumer

Reimplemented in pdb::SimplePhysicalNode.

Definition at line 135 of file AbstractPhysicalNode.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual PhysicalOptimizerResultPtr pdb::AbstractPhysicalNode::analyze ( const StatisticsPtr stats,
int  nextStageID 
)
pure virtual

Performs the actual analysis of the TCAP and returns a partial physical plan in the case it succeeds

Returns
the PhysicalOptimizerResult is the result of the analysis

Implemented in pdb::AdvancedPhysicalAbstractPipe, and pdb::SimplePhysicalNode.

pdb::AbstractPhysicalNodePtr pdb::AbstractPhysicalNode::getConsumer ( int  idx)

Returns the idx-th consumer of this node

Parameters
idx- the index
Returns
returns the consumer

Definition at line 103 of file AbstractPhysicalNode.cc.

virtual double pdb::AbstractPhysicalNode::getCost ( const StatisticsPtr stats)
pure virtual

Given the source set for this node and the statistics this method returns a cost based on a heuristic

Parameters
source- the set identifier of the source
stats- the statistics about the sets
Returns
the cost value

Implemented in pdb::AdvancedPhysicalAbstractPipe, and pdb::SimplePhysicalNode.

AbstractPhysicalNodePtr pdb::AbstractPhysicalNode::getHandle ( )

Returns a shared pointer handle to this node

Returns
the shared pointer handle

Definition at line 93 of file AbstractPhysicalNode.cc.

+ Here is the caller graph for this function:

virtual std::string pdb::AbstractPhysicalNode::getNodeIdentifier ( )
pure virtual

Returns a string that uniquely identifies this node

Returns
the string

Implemented in pdb::AdvancedPhysicalAbstractPipe, and pdb::SimplePhysicalNode.

size_t pdb::AbstractPhysicalNode::getNumConsumers ( )

Returns the number of consumers this pipe has

Returns
the number

Definition at line 113 of file AbstractPhysicalNode.cc.

size_t pdb::AbstractPhysicalNode::getNumProducers ( )

Returns the number of producers this pipe has

Returns
the number

Definition at line 127 of file AbstractPhysicalNode.cc.

pdb::AbstractPhysicalNodePtr pdb::AbstractPhysicalNode::getProducer ( int  idx)

Returns the idx-th producer of this node

Parameters
idx- the index
Returns
returns the producer

Definition at line 117 of file AbstractPhysicalNode.cc.

Handle< SetIdentifier > pdb::AbstractPhysicalNode::getSetIdentifierFromComputation ( Handle< Computation computation)
protected

Extracts a set identifier from a computation

Parameters
computationthe computation
Returns
the set we extracted

Definition at line 35 of file AbstractPhysicalNode.cc.

+ Here is the caller graph for this function:

virtual bool pdb::AbstractPhysicalNode::hasConsumers ( )
pure virtual

Returns true if this node still has consumers

Returns
true if it has, false otherwise

Implemented in pdb::AdvancedPhysicalAbstractPipe, and pdb::SimplePhysicalNode.

virtual bool pdb::AbstractPhysicalNode::isConsuming ( Handle< SetIdentifier > &  set)
pure virtual

Returns true if the set provided is consumed by some later stage in the planning

Parameters
set- the set identifier of the set we want to check
Returns
true if it does false otherwise

Implemented in pdb::AdvancedPhysicalAbstractPipe, and pdb::SimplePhysicalNode.

virtual void pdb::AbstractPhysicalNode::removeConsumer ( const AbstractPhysicalNodePtr consumer)
inlinevirtual

Removes a consumer of this node

Parameters
consumerthe consumer we want to remove

Definition at line 126 of file AbstractPhysicalNode.h.

+ Here is the call graph for this function:

template<typename T >
std::shared_ptr<T> pdb::AbstractPhysicalNode::to ( )
inline

This method is used to cast the handle to cast the abstract node to different kinds of node based on the template parameter T

Template Parameters
T- the tipe we want to cast the handle into
Returns
a shared pointer handle of the provided type

Definition at line 174 of file AbstractPhysicalNode.h.

+ Here is the call graph for this function:

Member Data Documentation

Handle<ComputePlan> pdb::AbstractPhysicalNode::computePlan
protected

The ComputePlan generated from input computations and the input TCAP string

Definition at line 189 of file AbstractPhysicalNode.h.

ConfigurationPtr pdb::AbstractPhysicalNode::conf
protected

A configuration object for this server node

Definition at line 199 of file AbstractPhysicalNode.h.

std::list<AbstractPhysicalNodePtr> pdb::AbstractPhysicalNode::consumers
protected

A list of consumers of this node

Definition at line 204 of file AbstractPhysicalNode.h.

AbstractPhysicalNodeWeakPtr pdb::AbstractPhysicalNode::handle
protected

A shared pointer to an instance of this node

Definition at line 214 of file AbstractPhysicalNode.h.

std::string pdb::AbstractPhysicalNode::jobId
protected

The jobId for this query (can be any string that is can be a database name)

Definition at line 184 of file AbstractPhysicalNode.h.

LogicalPlanPtr pdb::AbstractPhysicalNode::logicalPlan
protected

Logical plan generated from the compute plan

Definition at line 194 of file AbstractPhysicalNode.h.

std::list<AbstractPhysicalNodeWeakPtr> pdb::AbstractPhysicalNode::producers
protected

A list of producers of this node

Definition at line 209 of file AbstractPhysicalNode.h.


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