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::TopKComp< InputClass, Score, ValueType > Class Template Reference

#include <TopKComp.h>

+ Inheritance diagram for pdb::TopKComp< InputClass, Score, ValueType >:
+ Collaboration diagram for pdb::TopKComp< InputClass, Score, ValueType >:

Public Member Functions

Lambda< int > getKeyProjection (Handle< InputClass > aggMe) final
 
Lambda< TopKQueue< Score,
ValueType > > 
getValueProjection (Handle< InputClass > aggMe) override
 
- Public Member Functions inherited from pdb::AggregateCompBase< TopKQueue< Score, ValueType >, InputClass, int, TopKQueue< Score, ValueType > >
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< TopKQueue
< Score, ValueType > > > & 
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< TopKQueue< Score, ValueType >, InputClass, int, TopKQueue< Score, ValueType > >
Handle< ScanUserSet< TopKQueue
< Score, ValueType > > > 
outputSetScanner
 
bool collectAsMapOrNot
 
int numNodesToCollect
 
- 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 InputClass, class Score, class ValueType>
class pdb::TopKComp< InputClass, Score, ValueType >

implements a top-K computation. The result of the computation is an object of type TopKQueue<Score, ValueType>; this queue stores the items with the top-K largest Score values. The top-K computation takes as input a set of InputClass objects... to customize this class to perform a specific top-K computation, the user needs to override the getValueProjection () method so that it returns a TopKQueue object, initialized with: the value of k (the number of items to return), the Score object extracted from aggMe, and the ValueType object extracted from aggMe.

Template Parameters
InputClass
Score
ValueType

Definition at line 40 of file TopKComp.h.

Member Function Documentation

template<class InputClass , class Score , class ValueType >
Lambda<int> pdb::TopKComp< InputClass, Score, ValueType >::getKeyProjection ( Handle< InputClass >  aggMe)
inlinefinalvirtual
Parameters
aggMe
Returns

Implements pdb::AggregateComp< TopKQueue< Score, ValueType >, InputClass, int, TopKQueue< Score, ValueType > >.

Definition at line 49 of file TopKComp.h.

+ Here is the call graph for this function:

template<class InputClass , class Score , class ValueType >
Lambda<TopKQueue<Score, ValueType> > pdb::TopKComp< InputClass, Score, ValueType >::getValueProjection ( Handle< InputClass >  aggMe)
inlineoverridevirtual

this method should be over-ridden in almost any implementation of a top-K query

Parameters
aggMe
Returns

Implements pdb::AggregateComp< TopKQueue< Score, ValueType >, InputClass, int, TopKQueue< Score, ValueType > >.

Definition at line 58 of file TopKComp.h.

+ Here is the call graph for this function:


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