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

#include <Computation.h>

+ Inheritance diagram for pdb::Computation:
+ Collaboration diagram for pdb::Computation:

Public Member Functions

virtual void extractLambdas (std::map< std::string, GenericLambdaObjectPtr > &returnVal)
 
virtual ComputeSourcePtr getComputeSource (TupleSpec &produceMe, ComputePlan &plan)
 
virtual ComputeSinkPtr getComputeSink (TupleSpec &consumeMe, TupleSpec &projection, ComputePlan &plan)
 
virtual ComputeSinkPtr getComputeSink (TupleSpec &consumeMe, TupleSpec &whichAttsToOpOn, TupleSpec &projection, ComputePlan &plan)
 
virtual SinkMergerPtr getSinkMerger (TupleSpec &consumeMe, TupleSpec &projection, ComputePlan &plan)
 
virtual SinkMergerPtr getSinkMerger (TupleSpec &consumeMe, TupleSpec &whichAttsToOpOn, TupleSpec &projection, ComputePlan &plan)
 
virtual SinkShufflerPtr getSinkShuffler (TupleSpec &consumeMe, TupleSpec &projection, ComputePlan &plan)
 JiaNote: add below interface for shuffling multiple join map sinks for hash partitioned join. More...
 
virtual SinkShufflerPtr getSinkShuffler (TupleSpec &consumeMe, TupleSpec &whichAttsToOpOn, TupleSpec &projection, ComputePlan &plan)
 
virtual std::string getComputationType ()=0
 
virtual std::string toTCAPString (std::vector< InputTupleSetSpecifier > &inputTupleSets, int computationLabel, std::string &outputTupleSetName, std::vector< std::string > &outputColumnNames, std::string &addedOutputColumnName)=0
 
virtual std::string getIthInputType (int i)=0
 
bool hasInput ()
 
Handle< Computation > & getIthInput (int i) const
 
virtual int getNumInputs ()=0
 
virtual std::string getOutputType ()=0
 
virtual ComputationTypeID getComputationTypeID ()=0
 
int getNumConsumers ()
 
void setNumConsumers (int numConsumers)
 
bool setInput (Handle< Computation > toMe)
 
bool setInput (int whichSlot, Handle< Computation > toMe)
 
bool isTraversed ()
 
void setTraversed (bool traversed)
 
std::string getOutputTupleSetName ()
 
void setOutputTupleSetName (std::string outputTupleSetName)
 
std::string getOutputColumnToApply ()
 
void setOutputColumnToApply (std::string outputColumnToApply)
 
virtual void setOutput (std::string dbName, std::string setName)
 
virtual std::string getDatabaseName ()
 
virtual std::string getSetName ()
 
virtual bool needsMaterializeOutput ()
 
virtual void setBatchSize (int batchSize)
 
virtual bool isUsingCombiner ()
 
virtual void setUsingCombiner (bool useCombinerOrNot)
 
void setAllocatorPolicy (AllocatorPolicy myPolicy)
 
void setObjectPolicy (ObjectPolicy myPolicy)
 
AllocatorPolicy getAllocatorPolicy ()
 
ObjectPolicy getObjectPolicy ()
 
virtual void setCollectAsMap (bool collectAsMapOrNot)
 
virtual bool isCollectAsMap ()
 
virtual int getNumNodesToCollect ()
 
virtual void setNumNodesToCollect (int numNodesToCollect)
 
- Public Member Functions inherited from pdb::Object
void setVTablePtr (void *setToMe)
 
void * getVTablePtr ()
 
virtual void setUpAndCopyFrom (void *target, void *source) const
 
virtual void deleteObject (void *deleteMe)
 
virtual size_t getSize (void *ofMe)
 

Private Attributes

Handle< Vector< Handle
< Computation > > > 
inputs = nullptr
 
bool traversed = false
 
String outputTupleSetName = ""
 
String outputColumnToApply = ""
 
int numConsumers = 0
 
AllocatorPolicy myAllocatorPolicy = AllocatorPolicy::defaultAllocator
 
ObjectPolicy myObjectPolicy = ObjectPolicy::defaultObject
 

Additional Inherited Members

- Static Public Member Functions inherited from pdb::Object
static void * operator new (size_t sz, const std::nothrow_t &tag)
 
static void * operator new (size_t sz)
 
static void operator delete (void *me)
 
static void * operator new (std::size_t count, void *ptr)
 

Detailed Description

All nodes in a user-supplied computation are descended from this

Definition at line 59 of file Computation.h.

Member Function Documentation

AllocatorPolicy pdb::Computation::getAllocatorPolicy ( )
inline

Definition at line 337 of file Computation.h.

virtual ComputeSinkPtr pdb::Computation::getComputeSink ( TupleSpec consumeMe,
TupleSpec projection,
ComputePlan plan 
)
inlinevirtual

likewise, if this particular computation can be used as a compute sink in a pipeline, this method will return the compute sink object associated with the computation. It requires the TupleSpec that should be processed, as well as the projection of that TupleSpec that will be put into the sink

Reimplemented in pdb::SelectionCompBase< OutputClass, InputClass >, pdb::MultiSelectionCompBase< OutputClass, InputClass >, pdb::PartitionCompBase< KeyClass, ValueClass >, pdb::PartitionTransformationCompBase< KeyClass, ValueClass >, pdb::AbstractPartitionComp< KeyClass, ValueClass >, pdb::WriteUserSetBase< OutputClass >, pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >, and pdb::AggregateCompBase< TopKQueue< Score, ValueType >, InputClass, int, TopKQueue< Score, ValueType > >.

Definition at line 88 of file Computation.h.

+ Here is the caller graph for this function:

virtual ComputeSinkPtr pdb::Computation::getComputeSink ( TupleSpec consumeMe,
TupleSpec whichAttsToOpOn,
TupleSpec projection,
ComputePlan plan 
)
inlinevirtual

Reimplemented in pdb::JoinCompBase< Out, In1, In2, Rest >, and pdb::JoinCompBase< Out, In1, In2, Args... >.

Definition at line 94 of file Computation.h.

+ Here is the call graph for this function:

virtual ComputeSourcePtr pdb::Computation::getComputeSource ( TupleSpec produceMe,
ComputePlan plan 
)
inlinevirtual

If this particular computation can be used as a compute source in a pipeline, this method will return the compute source object associated with the computation...

In the general case, this method accepts the logical plan that this guy is a part of, as well as the actual TupleSpec that this guy is supposed to produce, and then returns a pointer to a ComputeSource object that can actually produce TupleSet objects corresponding to that particular TupleSpec

Reimplemented in pdb::JoinCompBase< Out, In1, In2, Rest >, pdb::JoinCompBase< Out, In1, In2, Args... >, pdb::MultiSelectionCompBase< OutputClass, InputClass >, pdb::SelectionCompBase< OutputClass, InputClass >, pdb::PartitionCompBase< KeyClass, ValueClass >, pdb::PartitionTransformationCompBase< KeyClass, ValueClass >, pdb::AbstractPartitionComp< KeyClass, ValueClass >, pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >, pdb::AggregateCompBase< TopKQueue< Score, ValueType >, InputClass, int, TopKQueue< Score, ValueType > >, pdb::ScanUserSetBase< OutputClass >, and pdb::ScanUserSetBase< DoubleVector >.

Definition at line 78 of file Computation.h.

Handle<Computation>& pdb::Computation::getIthInput ( int  i) const
inline

get a handle to the i^th input to this query, which is also a query

Parameters
i
Returns

Definition at line 160 of file Computation.h.

int pdb::Computation::getNumConsumers ( )
inline

get the number of consumers of this query

Returns

Definition at line 186 of file Computation.h.

virtual int pdb::Computation::getNumNodesToCollect ( )
inlinevirtual
ObjectPolicy pdb::Computation::getObjectPolicy ( )
inline

Definition at line 341 of file Computation.h.

std::string pdb::Computation::getOutputColumnToApply ( )
inline

get output column name to apply if the node has been traversed already

Returns

Definition at line 283 of file Computation.h.

std::string pdb::Computation::getOutputTupleSetName ( )
inline

get output TupleSet name if the node has been traversed already

Returns

Definition at line 263 of file Computation.h.

virtual SinkMergerPtr pdb::Computation::getSinkMerger ( TupleSpec consumeMe,
TupleSpec projection,
ComputePlan plan 
)
inlinevirtual

interface for merging multiple join map sinks for broadcast join

Definition at line 104 of file Computation.h.

+ Here is the caller graph for this function:

virtual SinkMergerPtr pdb::Computation::getSinkMerger ( TupleSpec consumeMe,
TupleSpec whichAttsToOpOn,
TupleSpec projection,
ComputePlan plan 
)
inlinevirtual

Reimplemented in pdb::JoinCompBase< Out, In1, In2, Rest >, and pdb::JoinCompBase< Out, In1, In2, Args... >.

Definition at line 111 of file Computation.h.

+ Here is the call graph for this function:

virtual SinkShufflerPtr pdb::Computation::getSinkShuffler ( TupleSpec consumeMe,
TupleSpec projection,
ComputePlan plan 
)
inlinevirtual

JiaNote: add below interface for shuffling multiple join map sinks for hash partitioned join.

Definition at line 120 of file Computation.h.

+ Here is the caller graph for this function:

virtual SinkShufflerPtr pdb::Computation::getSinkShuffler ( TupleSpec consumeMe,
TupleSpec whichAttsToOpOn,
TupleSpec projection,
ComputePlan plan 
)
inlinevirtual

Reimplemented in pdb::JoinCompBase< Out, In1, In2, Rest >, and pdb::JoinCompBase< Out, In1, In2, Args... >.

Definition at line 127 of file Computation.h.

+ Here is the call graph for this function:

bool pdb::Computation::hasInput ( )
inline

Definition at line 151 of file Computation.h.

virtual bool pdb::Computation::isCollectAsMap ( )
inlinevirtual
bool pdb::Computation::isTraversed ( )
inline

Whether the node has been traversed or not

Returns

Definition at line 245 of file Computation.h.

virtual bool pdb::Computation::isUsingCombiner ( )
inlinevirtual

Reimplemented in pdb::AbstractAggregateComp.

Definition at line 319 of file Computation.h.

void pdb::Computation::setAllocatorPolicy ( AllocatorPolicy  myPolicy)
inline

Definition at line 329 of file Computation.h.

virtual void pdb::Computation::setCollectAsMap ( bool  collectAsMapOrNot)
inlinevirtual
bool pdb::Computation::setInput ( Handle< Computation toMe)
inline

Set the first slot, by default

Parameters
toMe
Returns

Definition at line 199 of file Computation.h.

bool pdb::Computation::setInput ( int  whichSlot,
Handle< Computation toMe 
)
inline

sets the i^th input to be the output of a specific query... returns true if this is OK, false if it is not

Parameters
whichSlot
toMe
Returns

Definition at line 209 of file Computation.h.

+ Here is the call graph for this function:

void pdb::Computation::setNumConsumers ( int  numConsumers)
inline

Definition at line 190 of file Computation.h.

virtual void pdb::Computation::setNumNodesToCollect ( int  numNodesToCollect)
inlinevirtual

to set number of nodes to collect aggregation results

Parameters
numNodesToCollect

Reimplemented in pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >, and pdb::AggregateCompBase< TopKQueue< Score, ValueType >, InputClass, int, TopKQueue< Score, ValueType > >.

Definition at line 371 of file Computation.h.

void pdb::Computation::setObjectPolicy ( ObjectPolicy  myPolicy)
inline

Definition at line 333 of file Computation.h.

virtual void pdb::Computation::setOutput ( std::string  dbName,
std::string  setName 
)
inlinevirtual
void pdb::Computation::setOutputColumnToApply ( std::string  outputColumnToApply)
inline

Set output column name to apply. This method should be invoked by the TCAP string generation method

Definition at line 294 of file Computation.h.

+ Here is the caller graph for this function:

void pdb::Computation::setOutputTupleSetName ( std::string  outputTupleSetName)
inline

set output TupleSet name. This method should be invoked by the TCAP string generation method

Parameters
outputTupleSetName

Definition at line 275 of file Computation.h.

+ Here is the caller graph for this function:

void pdb::Computation::setTraversed ( bool  traversed)
inline

set the node to have been traversed

Parameters
traversed

Definition at line 254 of file Computation.h.

+ Here is the caller graph for this function:

virtual void pdb::Computation::setUsingCombiner ( bool  useCombinerOrNot)
inlinevirtual

Reimplemented in pdb::AbstractAggregateComp.

Definition at line 324 of file Computation.h.

Member Data Documentation

Handle<Vector<Handle<Computation> > > pdb::Computation::inputs = nullptr
private

Definition at line 375 of file Computation.h.

AllocatorPolicy pdb::Computation::myAllocatorPolicy = AllocatorPolicy::defaultAllocator
private

Definition at line 385 of file Computation.h.

ObjectPolicy pdb::Computation::myObjectPolicy = ObjectPolicy::defaultObject
private

Definition at line 387 of file Computation.h.

int pdb::Computation::numConsumers = 0
private

Definition at line 383 of file Computation.h.

String pdb::Computation::outputColumnToApply = ""
private

Definition at line 381 of file Computation.h.

String pdb::Computation::outputTupleSetName = ""
private

Definition at line 379 of file Computation.h.

bool pdb::Computation::traversed = false
private

Definition at line 377 of file Computation.h.


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