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

#include <AdvancedPhysicalAbstractPipe.h>

+ Inheritance diagram for pdb::AdvancedPhysicalAbstractPipe:
+ Collaboration diagram for pdb::AdvancedPhysicalAbstractPipe:

Public Member Functions

 AdvancedPhysicalAbstractPipe (string &jobId, const Handle< ComputePlan > &computePlan, LogicalPlanPtr &logicalPlan, ConfigurationPtr &conf, vector< AtomicComputationPtr > &pipeComputations, size_t id)
 
PhysicalOptimizerResultPtr analyze (const StatisticsPtr &stats, int nextStageID) override
 
virtual PhysicalOptimizerResultPtr pipelineMe (int nextStageID, std::vector< AdvancedPhysicalPipelineNodePtr > pipeline, const StatisticsPtr &stats)
 
virtual PhysicalOptimizerResultPtr chainMe (int nextStageID, const StatisticsPtr &stats, PhysicalOptimizerResultPtr previous)
 
virtual bool isChainable ()
 
virtual bool isPipelinable (AdvancedPhysicalPipelineNodePtr node)
 
virtual bool isExecuted ()
 
virtual
AdvancedPhysicalPipelineTypeID 
getType ()=0
 
virtual
AdvancedPhysicalAbstractAlgorithmPtr 
selectOutputAlgorithm ()=0
 
virtual std::vector
< AdvancedPhysicalAbstractAlgorithmPtr
getPossibleAlgorithms (const StatisticsPtr &stats)=0
 
virtual
AdvancedPhysicalAbstractAlgorithmPtr 
propose (std::vector< AdvancedPhysicalAbstractAlgorithmPtr > algorithms)
 
const bool isJoining ()
 
const bool isAggregating ()
 
std::unordered_map
< std::string, std::string > 
getProbingHashSets ()
 
const
AdvancedPhysicalAbstractAlgorithmPtr
getSelectedAlgorithm () const
 
double getCost (const StatisticsPtr &stats) override
 
bool isSource ()
 
bool hasConsumers () override
 
bool isConsuming (Handle< SetIdentifier > &set) override
 
string getNodeIdentifier () override
 
AdvancedPhysicalPipelineNodePtr getAdvancedPhysicalNodeHandle ()
 
AtomicComputationPtr getPipelineComputationAt (size_t idx)
 
const vector
< AtomicComputationPtr > & 
getPipeComputations () const
 
const Handle< SetIdentifier > & getSourceSetIdentifier () const
 
void setSourceSetIdentifier (const Handle< SetIdentifier > &sourceSetIdentifier)
 
- Public Member Functions inherited from pdb::AbstractPhysicalNode
 AbstractPhysicalNode (string &jobId, const Handle< ComputePlan > &computePlan, LogicalPlanPtr &logicalPlan, ConfigurationPtr &conf)
 
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 Attributes

AdvancedPhysicalAbstractAlgorithmPtr selectedAlgorithm
 
vector< AtomicComputationPtrpipeComputations
 
size_t id
 
Handle< SetIdentifiersourceSetIdentifier
 
- Protected Attributes inherited from pdb::AbstractPhysicalNode
std::string jobId
 
Handle< ComputePlancomputePlan
 
LogicalPlanPtr logicalPlan
 
ConfigurationPtr conf
 
std::list
< AbstractPhysicalNodePtr
consumers
 
std::list
< AbstractPhysicalNodeWeakPtr
producers
 
AbstractPhysicalNodeWeakPtr handle
 

Additional Inherited Members

- Protected Member Functions inherited from pdb::AbstractPhysicalNode
Handle< SetIdentifiergetSetIdentifierFromComputation (Handle< Computation > computation)
 

Detailed Description

The base node of the advanced physical planning algorithm The whole planning starts with the analyze method

See Also
analyze

Definition at line 51 of file AdvancedPhysicalAbstractPipe.h.

Constructor & Destructor Documentation

pdb::AdvancedPhysicalAbstractPipe::AdvancedPhysicalAbstractPipe ( string &  jobId,
const Handle< ComputePlan > &  computePlan,
LogicalPlanPtr logicalPlan,
ConfigurationPtr conf,
vector< AtomicComputationPtr > &  pipeComputations,
size_t  id 
)

Definition at line 25 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the call graph for this function:

Member Function Documentation

PhysicalOptimizerResultPtr pdb::AdvancedPhysicalAbstractPipe::analyze ( const StatisticsPtr stats,
int  nextStageID 
)
overridevirtual
Parameters
stats
nextStageID
Returns
  1. check if this this thing is pipelinable to the consumer
  2. is this a final operator
  3. ok this is not pipelinable we get all the algorithms we can use and propose them to the next operators
  4. should we chain
  5. ok no chaining we simply generate the stages from the algorithm

Implements pdb::AbstractPhysicalNode.

Definition at line 52 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PhysicalOptimizerResultPtr pdb::AdvancedPhysicalAbstractPipe::chainMe ( int  nextStageID,
const StatisticsPtr stats,
PhysicalOptimizerResultPtr  previous 
)
virtual

Chain the previous pipe to this operator

Parameters
previous- the result of the previous pipe
Returns
the result of the chaining

Definition at line 161 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

AdvancedPhysicalPipelineNodePtr pdb::AdvancedPhysicalAbstractPipe::getAdvancedPhysicalNodeHandle ( )

Return the handle to this object

Returns
the handle

Definition at line 238 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double pdb::AdvancedPhysicalAbstractPipe::getCost ( const StatisticsPtr stats)
overridevirtual

Return the cost of the pipeline based on the source operator cost the : formula cost = number_of_bytes / 1000000

Parameters
stats- the statistics a about the sets
Returns
the cost - the cost

Implements pdb::AbstractPhysicalNode.

Definition at line 214 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

string pdb::AdvancedPhysicalAbstractPipe::getNodeIdentifier ( )
overridevirtual

Returns the identifier of this node. In the format of "node_{id}"

Returns
the identifier

Implements pdb::AbstractPhysicalNode.

Definition at line 252 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the caller graph for this function:

const vector< AtomicComputationPtr > & pdb::AdvancedPhysicalAbstractPipe::getPipeComputations ( ) const

Returns the atomic computations in this pipeline

Returns
the list of atomic computations that make up this pipeline

Definition at line 265 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the caller graph for this function:

AtomicComputationPtr pdb::AdvancedPhysicalAbstractPipe::getPipelineComputationAt ( size_t  idx)

Get i-th atomic computation in this pipeline

Parameters
indexreturn the requested atomic computation

Definition at line 262 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the caller graph for this function:

virtual std::vector<AdvancedPhysicalAbstractAlgorithmPtr> pdb::AdvancedPhysicalAbstractPipe::getPossibleAlgorithms ( const StatisticsPtr stats)
pure virtual

Returns all the possible algorithms that can be used to execute the pipeline

Returns
a vector of possible algorithms

Implemented in pdb::AdvancedPhysicalJoinSidePipe, pdb::AdvancedPhysicalStraightPipe, and pdb::AdvancedPhysicalAggregationPipe.

+ Here is the caller graph for this function:

std::unordered_map< std::string, std::string > pdb::AdvancedPhysicalAbstractPipe::getProbingHashSets ( )

Returns a list of all the hash sets this pipe will probe (in the current implementation only one) This method assumes that all the children of this pipeline are JoinSidePipelines

Returns
the list of all the hash sets

Definition at line 345 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the call graph for this function:

const AdvancedPhysicalAbstractAlgorithmPtr & pdb::AdvancedPhysicalAbstractPipe::getSelectedAlgorithm ( ) const

Returns the the algorithm the we executed. If we did not executed any algorithm we return a null_ptr

Returns
the algorithm if we have executed the pipeline, null_ptr otherwise

Definition at line 234 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the caller graph for this function:

const Handle< SetIdentifier > & pdb::AdvancedPhysicalAbstractPipe::getSourceSetIdentifier ( ) const
Returns

Definition at line 269 of file AdvancedPhysicalAbstractPipe.cc.

virtual AdvancedPhysicalPipelineTypeID pdb::AdvancedPhysicalAbstractPipe::getType ( )
pure virtual

Returns the type of this pipeline

Returns
the type

Implemented in pdb::AdvancedPhysicalJoinSidePipe, pdb::AdvancedPhysicalStraightPipe, and pdb::AdvancedPhysicalAggregationPipe.

+ Here is the caller graph for this function:

bool pdb::AdvancedPhysicalAbstractPipe::hasConsumers ( )
overridevirtual

Does this pipeline have consumers

Returns
true if it does false otherwise

Implements pdb::AbstractPhysicalNode.

Definition at line 243 of file AdvancedPhysicalAbstractPipe.cc.

const bool pdb::AdvancedPhysicalAbstractPipe::isAggregating ( )

Returns true if this pipe is aggregating the results

Returns
true if it does false otherwise

Definition at line 199 of file AdvancedPhysicalAbstractPipe.cc.

bool pdb::AdvancedPhysicalAbstractPipe::isChainable ( )
virtual

Is this algorithm able to chain to another algorithm. Chaining two algorithms means that we are executing their stages one after another

Returns
returns true if it can

Definition at line 185 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the caller graph for this function:

bool pdb::AdvancedPhysicalAbstractPipe::isConsuming ( Handle< SetIdentifier > &  set)
overridevirtual

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

Implements pdb::AbstractPhysicalNode.

Definition at line 248 of file AdvancedPhysicalAbstractPipe.cc.

bool pdb::AdvancedPhysicalAbstractPipe::isExecuted ( )
virtual

If this operator is executed returns true false otherwise.

Returns
true if it is false otherwise

Definition at line 191 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the caller graph for this function:

const bool pdb::AdvancedPhysicalAbstractPipe::isJoining ( )

Returns true if this pipeline is joining two sets

Returns
true if it does false otherwise

Definition at line 195 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the caller graph for this function:

bool pdb::AdvancedPhysicalAbstractPipe::isPipelinable ( AdvancedPhysicalPipelineNodePtr  node)
virtual

Returns true if this is pipelinable

Parameters
node
Returns

Definition at line 87 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool pdb::AdvancedPhysicalAbstractPipe::isSource ( )

Returns true if this node is a source (starts with a ScanSet)

Returns
true if does false otherwise

Definition at line 256 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the caller graph for this function:

PhysicalOptimizerResultPtr pdb::AdvancedPhysicalAbstractPipe::pipelineMe ( int  nextStageID,
std::vector< AdvancedPhysicalPipelineNodePtr pipeline,
const StatisticsPtr stats 
)
virtual

Pipelines the provided pipeline to this pipeline

Parameters
pipeline- the pipeline we are providing
Returns
the result of the pipelining
  1. can I pipeline more if so do it
  2. is this a final operator we can not pipeline lets select the output algorithm and run this thing
  3. ok this is not pipelinable we get all the algorithms we can use and propose them to the next operators
  4. should we chain
  5. ok no chaining we simply generate the stages from the algorithm

Definition at line 125 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

AdvancedPhysicalAbstractAlgorithmPtr pdb::AdvancedPhysicalAbstractPipe::propose ( std::vector< AdvancedPhysicalAbstractAlgorithmPtr algorithms)
virtual

Out of all algorithms given to him this node picks one a proposes it

Parameters
algorithms- the algorithms that are available
Returns
the picked algorithm

Definition at line 273 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual AdvancedPhysicalAbstractAlgorithmPtr pdb::AdvancedPhysicalAbstractPipe::selectOutputAlgorithm ( )
pure virtual

Selects the output algorithm for the output of this pipeline

Returns
the output algorithm for this pipeline

Implemented in pdb::AdvancedPhysicalJoinSidePipe, pdb::AdvancedPhysicalStraightPipe, and pdb::AdvancedPhysicalAggregationPipe.

+ Here is the caller graph for this function:

void pdb::AdvancedPhysicalAbstractPipe::setSourceSetIdentifier ( const Handle< SetIdentifier > &  sourceSetIdentifier)
Parameters
sourceSetIdentifier

Definition at line 341 of file AdvancedPhysicalAbstractPipe.cc.

+ Here is the caller graph for this function:

Member Data Documentation

size_t pdb::AdvancedPhysicalAbstractPipe::id
protected

The identifier of this node

Definition at line 232 of file AdvancedPhysicalAbstractPipe.h.

vector<AtomicComputationPtr> pdb::AdvancedPhysicalAbstractPipe::pipeComputations
protected

Contains all the atomic computations that make-up this pipe

Definition at line 227 of file AdvancedPhysicalAbstractPipe.h.

AdvancedPhysicalAbstractAlgorithmPtr pdb::AdvancedPhysicalAbstractPipe::selectedAlgorithm
protected

The algorithm we selected to execute this computation This is not null if it is executed false otherwise

Definition at line 222 of file AdvancedPhysicalAbstractPipe.h.

Handle<SetIdentifier> pdb::AdvancedPhysicalAbstractPipe::sourceSetIdentifier
protected

Source set associated with this node.

Definition at line 237 of file AdvancedPhysicalAbstractPipe.h.


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