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

#include <AggregateComp.h>

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

Public Member Functions

virtual Lambda< KeyClass > getKeyProjection (Handle< InputClass > aggMe)=0
 
virtual Lambda< ValueClass > getValueProjection (Handle< InputClass > aggMe)=0
 
- Public Member Functions inherited from pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >
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)
 

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)
 
- Protected Attributes inherited from pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >
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
 

Detailed Description

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

this aggregates items of type InputClass. To aggregate an item, the result of getKeyProjection() is used to extract a key from on input, and the result of getValueProjection () is used to extract a value from an input. Then, all values having the same key are aggregated using the += operation over values. Note that keys must have operation == as well has hash () defined. Also, note that values must have the

  • operation defined.

Once aggregation is completed, the key-value pairs are converted into OutputClass objects. An object of type OutputClass must have two methods defined: KeyClass &getKey (), as well as ValueClass &getValue (). To convert a key-value pair into an OutputClass object, the result of getKey () is set to the desired key, and the result of getValue () is set to the desired value.

Template Parameters
OutputClass
InputClass
KeyClass
ValueClass

Definition at line 58 of file AggregateComp.h.

Member Function Documentation

template<class OutputClass, class InputClass, class KeyClass, class ValueClass>
virtual Lambda<KeyClass> pdb::AggregateComp< 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

Implements pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >.

Implemented in pdb::TopKComp< InputClass, Score, ValueType >.

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

Gets the operation that extracts a value from an input object

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

Implements pdb::AggregateCompBase< OutputClass, InputClass, KeyClass, ValueClass >.

Implemented in pdb::TopKComp< InputClass, Score, ValueType >.


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