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::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass > Class Template Referenceabstract

#include <AggregateCompBase.h>

+ Inheritance diagram for pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >:
+ Collaboration diagram for pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >:

Public Member Functions

virtual Lambda< KeyClass > getKeyProjection (Handle< InputClass > aggMe)=0
 
virtual Lambda< ValueClass > getValueProjection (Handle< InputClass > aggMe)=0
 
void setOutput (std::string dbName, std::string setName) override
 
void setHashTablePointer (void *hashTablePointer)
 
void extractLambdas (std::map< std::string, GenericLambdaObjectPtr > &returnVal) override
 
ComputeSinkPtr getComputeSink (TupleSpec &consumeMe, TupleSpec &projection, ComputePlan &plan) override
 
ComputeSourcePtr getComputeSource (TupleSpec &outputScheme, ComputePlan &plan) override
 
SimpleSingleTableQueryProcessorPtr getCombinerProcessor (std::vector< HashPartitionID > partitions) override
 
SimpleSingleTableQueryProcessorPtr getAggregationProcessor (HashPartitionID id) override
 
SimpleSingleTableQueryProcessorPtr getAggOutProcessor () override
 
void setIterator (PageCircularBufferIteratorPtr iterator) override
 
void setProxy (DataProxyPtr proxy) override
 
void setDatabaseName (std::string dbName) override
 
void setSetName (std::string setName) override
 
std::string getDatabaseName () override
 
std::string getSetName () override
 
std::string getComputationType () override
 
ComputationTypeID getComputationTypeID () override
 
std::string getOutputType () override
 
int getNumInputs () override
 
std::string getIthInputType (int i) override
 
void setCollectAsMap (bool collectAsMapOrNot) override
 
bool isCollectAsMap () override
 
int getNumNodesToCollect () override
 
void setNumNodesToCollect (int numNodesToCollect) override
 
std::string toTCAPString (std::vector< InputTupleSetSpecifier > &inputTupleSets, int computationLabel, std::string &outputTupleSetName, std::vector< std::string > &outputColumnNames, std::string &addedOutputColumnName) override
 
std::string toTCAPString (std::string inputTupleSetName, std::vector< std::string > &inputColumnNames, std::vector< std::string > &inputColumnsToApply, std::vector< std::string > &childrenLambdaNames, int computationLabel, std::string &outputTupleSetName, std::vector< std::string > &outputColumnNames, std::string &addedOutputColumnName, std::string &myLambdaName)
 
Handle< ScanUserSet
< OutputClass > > & 
getOutputSetScanner ()
 
- Public Member Functions inherited from pdb::AbstractAggregateComp
 AbstractAggregateComp ()=default
 
void setNumPartitions (int numPartitions)
 
int getNumPartitions ()
 
void setNumNodes (int numNodes)
 
int getNumNodes ()
 
void setBatchSize (int batchSize) override
 
int getBatchSize ()
 
bool needsMaterializeOutput () override
 
void setHashTable (void *hashTableLocation)
 
bool isUsingCombiner () override
 
void setUsingCombiner (bool useCombinerOrNot) override
 
- Public Member Functions inherited from pdb::Computation
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)
 
bool hasInput ()
 
Handle< Computation > & getIthInput (int i) const
 
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)
 
void setAllocatorPolicy (AllocatorPolicy myPolicy)
 
void setObjectPolicy (ObjectPolicy myPolicy)
 
AllocatorPolicy getAllocatorPolicy ()
 
ObjectPolicy getObjectPolicy ()
 
- 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)
 

Protected Attributes

Handle< ScanUserSet
< OutputClass > > 
outputSetScanner = nullptr
 
bool collectAsMapOrNot = false
 
int numNodesToCollect = 1
 
- Protected Attributes inherited from pdb::AbstractAggregateComp
int numPartitions = -1
 
int numNodes = -1
 
int batchSize = -1
 
void * whereHashTableSitsForThePartition = nullptr
 
bool materializeAggOut = false
 
bool useCombinerOrNot = true
 

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

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
class pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >

Definition at line 16 of file AggregateCompBase.h.

Member Function Documentation

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
void pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::extractLambdas ( std::map< std::string, GenericLambdaObjectPtr > &  returnVal)
inlineoverridevirtual

Extract the key projection and value projection lambdas

Parameters
returnVal- the extracted lambdas

Reimplemented from pdb::Computation.

Definition at line 59 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
SimpleSingleTableQueryProcessorPtr pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getAggOutProcessor ( )
inlineoverridevirtual

Used to return processor for writing aggregation results to a user set the agg out processor is used in the aggregation consuming phase for materializing aggregation results to user set the input is the output of aggregation processor the output is written to a user set

Implements pdb::AbstractAggregateComp.

Definition at line 154 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
SimpleSingleTableQueryProcessorPtr pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getAggregationProcessor ( HashPartitionID  id)
inlineoverridevirtual

Used to return processor for aggregating on shuffle data the aggregation processor is used in the aggregation consuming phase the input is shuffle data the output are intermediate pages of arbitrary size allocated on heap

Parameters
id
Returns

Implements pdb::AbstractAggregateComp.

Definition at line 143 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
SimpleSingleTableQueryProcessorPtr pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getCombinerProcessor ( std::vector< HashPartitionID partitions)
inlineoverridevirtual

Used to return processor for combining data written to shuffle sink the combiner processor is used in the end of aggregation producing phase the input is data written to shuffle sink the output is data for shuffling

Parameters
partitions
Returns

Implements pdb::AbstractAggregateComp.

Definition at line 130 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
std::string pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getComputationType ( )
inlineoverridevirtual

this is an aggregation comp

Returns

Implements pdb::Computation.

Definition at line 210 of file AggregateCompBase.h.

+ Here is the caller graph for this function:

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
ComputationTypeID pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getComputationTypeID ( )
inlineoverridevirtual

Used to return the type if of this computation

Returns

Reimplemented from pdb::AbstractAggregateComp.

Definition at line 218 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
ComputeSinkPtr pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getComputeSink ( TupleSpec consumeMe,
TupleSpec projection,
ComputePlan plan 
)
inlineoverridevirtual

Sink for aggregation producing phase output, shuffle data will be combined from the sink

Parameters
consumeMe-
projection-
plan-
Returns

Reimplemented from pdb::Computation.

Definition at line 75 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
ComputeSourcePtr pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getComputeSource ( TupleSpec outputScheme,
ComputePlan plan 
)
inlineoverridevirtual

source for consumer to read aggregation results, aggregation results are written to user set

Parameters
outputScheme
plan
Returns

Reimplemented from pdb::Computation.

Definition at line 101 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
std::string pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getDatabaseName ( )
inlineoverridevirtual

Used to return the database name

Returns

Reimplemented from pdb::Computation.

Definition at line 194 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
std::string pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getIthInputType ( int  i)
inlineoverridevirtual

Used to get the name of the i^th input type...

Parameters
i- return the i-th input type
Returns
the type

Implements pdb::Computation.

Definition at line 243 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
virtual Lambda<KeyClass> pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getKeyProjection ( Handle< InputClass >  aggMe)
pure virtual

Gets the operation the extracts a key from an input object

Parameters
aggMe- the object we want to the the operation from
Returns
the projection lambda

Implemented in pdb::AggregateComp< OutputClass, InputClass, KeyClass, ValueClass >, pdb::AggregateComp< TopKQueue< Score, ValueType >, InputClass, int, TopKQueue< Score, ValueType > >, and pdb::TopKComp< InputClass, Score, ValueType >.

+ Here is the caller graph for this function:

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
int pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getNumInputs ( )
inlineoverridevirtual

Used to get the number of inputs to this query type

Returns

Implements pdb::Computation.

Definition at line 234 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
int pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getNumNodesToCollect ( )
inlineoverridevirtual

to get number of nodes to collect aggregation results

Returns

Reimplemented from pdb::Computation.

Definition at line 267 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
Handle<ScanUserSet<OutputClass> >& pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getOutputSetScanner ( )
inline

Definition at line 422 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
std::string pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getOutputType ( )
inlineoverridevirtual

Used to get output type

Returns

Implements pdb::Computation.

Definition at line 226 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
std::string pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getSetName ( )
inlineoverridevirtual

Used to return the set name

Returns

Reimplemented from pdb::Computation.

Definition at line 202 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
virtual Lambda<ValueClass> pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::getValueProjection ( Handle< InputClass >  aggMe)
pure virtual

Gets the operation the extracts a value from an input object

Parameters
aggMe- the object we want to the the operation from
Returns
the projection lambda

Implemented in pdb::AggregateComp< OutputClass, InputClass, KeyClass, ValueClass >, pdb::AggregateComp< TopKQueue< Score, ValueType >, InputClass, int, TopKQueue< Score, ValueType > >, and pdb::TopKComp< InputClass, Score, ValueType >.

+ Here is the caller graph for this function:

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
bool pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::isCollectAsMap ( )
inlineoverridevirtual

Is the aggregation collected on the first 0 to numNodesToCollect

Returns
true if it should, false otherwise

Reimplemented from pdb::Computation.

Definition at line 263 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
void pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::setCollectAsMap ( bool  collectAsMapOrNot)
inlineoverridevirtual

Should the aggregation result be collected on the first 0 to numNodesToCollect

Parameters
collectAsMapOrNot- true if it should false otherwise

Reimplemented from pdb::Computation.

Definition at line 255 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
void pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::setDatabaseName ( std::string  dbName)
inlineoverridevirtual

Used to set the database name

Parameters
dbName

Implements pdb::AbstractAggregateComp.

Definition at line 178 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
void pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::setHashTablePointer ( void *  hashTablePointer)
inline

Set hash table pointer

Parameters
hashTablePointer- a pointer to the hash table for this aggregation

Definition at line 51 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
void pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::setIterator ( PageCircularBufferIteratorPtr  iterator)
inlineoverridevirtual

Used to set iterator for scanning the materialized aggregation output that is stored in a user set

Parameters
iterator

Implements pdb::AbstractAggregateComp.

Definition at line 162 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
void pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::setNumNodesToCollect ( int  numNodesToCollect)
inlineoverridevirtual

to set number of nodes to collect aggregation results

Parameters
numNodesToCollect

Reimplemented from pdb::Computation.

Definition at line 271 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
void pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::setOutput ( std::string  dbName,
std::string  setName 
)
inlineoverridevirtual

Materialize aggregation output, use ScanUserSet to obtain consumer's ComputeSource

Parameters
dbName- the name of the database we are materializing to
setName- the name of the set we are materializing to

Reimplemented from pdb::Computation.

Definition at line 38 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
void pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::setProxy ( DataProxyPtr  proxy)
inlineoverridevirtual

Used to set data proxy for scanning the materialized aggregation output that is stored in a user set

Parameters
proxy

Implements pdb::AbstractAggregateComp.

Definition at line 170 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
void pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::setSetName ( std::string  setName)
inlineoverridevirtual

Used to set the set name

Parameters
setName

Implements pdb::AbstractAggregateComp.

Definition at line 186 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
std::string pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::toTCAPString ( std::vector< InputTupleSetSpecifier > &  inputTupleSets,
int  computationLabel,
std::string &  outputTupleSetName,
std::vector< std::string > &  outputColumnNames,
std::string &  addedOutputColumnName 
)
inlineoverridevirtual

Below function implements the interface for parsing computation into a TCAP string

Parameters
inputTupleSets
computationLabel
outputTupleSetName
outputColumnNames
addedOutputColumnName
Returns

Implements pdb::Computation.

Definition at line 284 of file AggregateCompBase.h.

+ Here is the caller graph for this function:

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
std::string pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::toTCAPString ( std::string  inputTupleSetName,
std::vector< std::string > &  inputColumnNames,
std::vector< std::string > &  inputColumnsToApply,
std::vector< std::string > &  childrenLambdaNames,
int  computationLabel,
std::string &  outputTupleSetName,
std::vector< std::string > &  outputColumnNames,
std::string &  addedOutputColumnName,
std::string &  myLambdaName 
)
inline

Used to return Aggregate tcap string

Parameters
inputTupleSetName
inputColumnNames
inputColumnsToApply
childrenLambdaNames
computationLabel
outputTupleSetName
outputColumnNames
addedOutputColumnName
myLambdaName
Returns

Definition at line 322 of file AggregateCompBase.h.

Member Data Documentation

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
bool pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::collectAsMapOrNot = false
protected

If this parameter is set the aggregation result will be collected on the first 0 to numNodesToCollect

Definition at line 436 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
int pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::numNodesToCollect = 1
protected

The number of nodes we want to collect the aggregation results on, ignored if

See Also
collectAsMap is false

Definition at line 441 of file AggregateCompBase.h.

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
Handle<ScanUserSet<OutputClass> > pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >::outputSetScanner = nullptr
protected

Output set scanner

Definition at line 431 of file AggregateCompBase.h.


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