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

#include <GenericLambdaObject.h>

+ Inheritance diagram for pdb::GenericLambdaObject:
+ Collaboration diagram for pdb::GenericLambdaObject:

Public Member Functions

virtual ~GenericLambdaObject ()=default
 
void setInputIndex (int i, unsigned int index)
 
virtual unsigned int getInputIndex (int i)
 
virtual unsigned int getNumInputs ()=0
 
virtual ComputeExecutorPtr getExecutor (TupleSpec &inputSchema, TupleSpec &attsToOperateOn, TupleSpec &attsToIncludeInOutput)=0
 
virtual ComputeExecutorPtr getExecutor (TupleSpec &inputSchema, TupleSpec &attsToOperateOn, TupleSpec &attsToIncludeInOutput, ComputeInfoPtr)
 
virtual ComputeExecutorPtr getLeftHasher (TupleSpec &inputSchema, TupleSpec &attsToOperateOn, TupleSpec &attsToIncludeInOutput)
 
virtual ComputeExecutorPtr getLeftHasher (TupleSpec &inputSchema, TupleSpec &attsToOperateOn, TupleSpec &attsToIncludeInOutput, ComputeInfoPtr)
 
virtual ComputeExecutorPtr getRightHasher (TupleSpec &inputSchema, TupleSpec &attsToOperateOn, TupleSpec &attsToIncludeInOutput)
 
virtual ComputeExecutorPtr getRightHasher (TupleSpec &inputSchema, TupleSpec &attsToOperateOn, TupleSpec &attsToIncludeInOutput, ComputeInfoPtr)
 
virtual std::string getTypeOfLambda ()=0
 
virtual int getNumChildren ()=0
 
virtual GenericLambdaObjectPtr getChild (int which)=0
 
std::string getTCAPString (const std::string &inputTupleSetName, const std::vector< std::string > &inputColumnNames, const std::vector< std::string > &inputColumnsToApply, const std::string &outputTupleSetName, const std::vector< std::string > &outputColumns, const std::string &outputColumnName, const std::string &tcapOperation, const std::string &computationNameAndLabel, const std::string &lambdaNameAndLabel, const std::map< std::string, std::string > &info)
 
virtual std::string toTCAPStringForCartesianJoin (int lambdaLabel, std::string computationName, int computationLabel, std::string &outputTupleSetName, std::vector< std::string > &outputColumns, std::string &outputColumnName, std::string &myLambdaName, MultiInputsBase *multiInputsComp)
 
virtual std::string toTCAPString (std::vector< std::string > &inputTupleSetNames, std::vector< std::string > &inputColumnNames, std::vector< std::string > &inputColumnsToApply, std::vector< std::string > &childrenLambdaNames, int lambdaLabel, std::string computationName, int computationLabel, std::string &outputTupleSetName, std::vector< std::string > &outputColumns, std::string &outputColumnName, std::string &myLambdaName, MultiInputsBase *multiInputsComp=nullptr, bool amIPartOfJoinPredicate=false, bool amILeftChildOfEqualLambda=false, bool amIRightChildOfEqualLambda=false, std::string parentLambdaName="", bool isSelfJoin=false)
 
virtual std::map< std::string,
std::string > 
getInfo ()=0
 
virtual std::string getOutputType ()=0
 

Private Attributes

std::vector< unsigned int > inputIndexes
 

Detailed Description

This is the base class from which all pdb :: Lambdas derive

Definition at line 54 of file GenericLambdaObject.h.

Constructor & Destructor Documentation

virtual pdb::GenericLambdaObject::~GenericLambdaObject ( )
virtualdefault

Member Function Documentation

virtual ComputeExecutorPtr pdb::GenericLambdaObject::getExecutor ( TupleSpec inputSchema,
TupleSpec attsToOperateOn,
TupleSpec attsToIncludeInOutput 
)
pure virtual

Used this gets an executor that appends the result of running this lambda to the end of each tuple

Parameters
inputSchema- // TODO missing description
attsToOperateOn- // TODO missing description
attsToIncludeInOutput- // TODO missing description
Returns
- // TODO missing description

Implemented in pdb::EqualsLambda< LeftType, RightType >, pdb::DereferenceLambda< OutType >, pdb::MethodCallLambda< Out, ClassType >, pdb::AttAccessLambda< Out, ClassType >, pdb::CPlusPlusLambda< F, ReturnType, ParamOne, ParamTwo, ParamThree, ParamFour, ParamFive >, pdb::AndLambda< LeftType, RightType >, and pdb::SelfLambda< ClassType >.

+ Here is the caller graph for this function:

virtual ComputeExecutorPtr pdb::GenericLambdaObject::getExecutor ( TupleSpec inputSchema,
TupleSpec attsToOperateOn,
TupleSpec attsToIncludeInOutput,
ComputeInfoPtr   
)
inlinevirtual

This gets an executor that appends the result of running this lambda to the end of each tuple; also accepts a parameter in the default case the parameter is ignored and the "regular" version of the executor is created

Parameters
inputSchema- // TODO missing description
attsToOperateOn- // TODO missing description
attsToIncludeInOutput- // TODO missing description
Returns
- // TODO missing description

Definition at line 123 of file GenericLambdaObject.h.

+ Here is the call graph for this function:

virtual std::map<std::string, std::string> pdb::GenericLambdaObject::getInfo ( )
pure virtual
virtual unsigned int pdb::GenericLambdaObject::getInputIndex ( int  i)
inlinevirtual

Used to get the index of this lambda's input in the corresponding computation

Parameters
i- the index of the input
Returns
- the index of the input in the corresponding computation

Reimplemented in pdb::DereferenceLambda< OutType >.

Definition at line 90 of file GenericLambdaObject.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual ComputeExecutorPtr pdb::GenericLambdaObject::getLeftHasher ( TupleSpec inputSchema,
TupleSpec attsToOperateOn,
TupleSpec attsToIncludeInOutput 
)
inlinevirtual

This gets an executor that appends a hash value to the end of each tuple; implemented, for example, by ==

Parameters
inputSchema
attsToOperateOn
attsToIncludeInOutput
Returns
- // TODO missing description

Reimplemented in pdb::EqualsLambda< LeftType, RightType >.

Definition at line 137 of file GenericLambdaObject.h.

+ Here is the caller graph for this function:

virtual ComputeExecutorPtr pdb::GenericLambdaObject::getLeftHasher ( TupleSpec inputSchema,
TupleSpec attsToOperateOn,
TupleSpec attsToIncludeInOutput,
ComputeInfoPtr   
)
inlinevirtual

Version of the above that accepts ComputeInfo

Parameters
inputSchema- // TODO add proper description of this parameter
attsToOperateOn- // TODO add proper description of this parameter
attsToIncludeInOutput- // TODO add proper description of this parameter
Returns
- // TODO add proper description of this return value

Definition at line 151 of file GenericLambdaObject.h.

+ Here is the call graph for this function:

virtual int pdb::GenericLambdaObject::getNumChildren ( )
pure virtual

one big technical problem is that when tuples are added to a hash table to be recovered at a later time, we we break a pipeline. The difficulty with this is that when we want to probe a hash table to find a set of hash values, we can't use the input TupleSet as a way to create the columns to store the result of the probe. The hash table needs to be able to create (from scratch) the columns that store the output. This is a problem, because the hash table has no information about the types of the objects that it contains. The way around this is that we have a function attached to each GenericLambdaObject that allows us to ask the GenericLambdaObject to try to add a column to a tuple set, of a specific type, where the type name is specified as a string. When the hash table needs to create an output TupleSet, it can ask all of the GenericLambdaObjects associated with a query to create the necessary columns, as a way to build up the output TupleSet. This method is how the hash table can ask for this. It takes tree args: the type of the column that the hash table wants the tuple set to build, the tuple set to add the column to, and the position where the column will be added. If the GenericLambdaObject cannot build the column (it has no knowledge of that type) a false is returned. Otherwise, a true is returned. virtual bool addColumnToTupleSet (std :: string &typeToMatch, TupleSetPtr addToMe, int posToAddTo) = 0; returns the number of children of this Lambda type

Returns
- // TODO missing description

Implemented in pdb::EqualsLambda< LeftType, RightType >, pdb::DereferenceLambda< OutType >, pdb::MethodCallLambda< Out, ClassType >, pdb::AttAccessLambda< Out, ClassType >, pdb::CPlusPlusLambda< F, ReturnType, ParamOne, ParamTwo, ParamThree, ParamFour, ParamFive >, pdb::AndLambda< LeftType, RightType >, and pdb::SelfLambda< ClassType >.

virtual unsigned int pdb::GenericLambdaObject::getNumInputs ( )
pure virtual
virtual std::string pdb::GenericLambdaObject::getOutputType ( )
pure virtual
virtual ComputeExecutorPtr pdb::GenericLambdaObject::getRightHasher ( TupleSpec inputSchema,
TupleSpec attsToOperateOn,
TupleSpec attsToIncludeInOutput 
)
inlinevirtual

This gets an executor that appends a hash value to the end of each tuple; implemented, for example, by ==

Parameters
inputSchema- // TODO add proper description of this parameter
attsToOperateOn- // TODO add proper description of this parameter
attsToIncludeInOutput- // TODO add proper description of this parameter
Returns
- // TODO add proper description of this return value

Reimplemented in pdb::EqualsLambda< LeftType, RightType >.

Definition at line 165 of file GenericLambdaObject.h.

+ Here is the caller graph for this function:

virtual ComputeExecutorPtr pdb::GenericLambdaObject::getRightHasher ( TupleSpec inputSchema,
TupleSpec attsToOperateOn,
TupleSpec attsToIncludeInOutput,
ComputeInfoPtr   
)
inlinevirtual

version of the above that accepts ComputeInfo

Parameters
inputSchema- // TODO missing description
attsToOperateOn- // TODO missing description
attsToIncludeInOutput- // TODO missing description
Returns
- // TODO missing description

Definition at line 179 of file GenericLambdaObject.h.

+ Here is the call graph for this function:

std::string pdb::GenericLambdaObject::getTCAPString ( const std::string &  inputTupleSetName,
const std::vector< std::string > &  inputColumnNames,
const std::vector< std::string > &  inputColumnsToApply,
const std::string &  outputTupleSetName,
const std::vector< std::string > &  outputColumns,
const std::string &  outputColumnName,
const std::string &  tcapOperation,
const std::string &  computationNameAndLabel,
const std::string &  lambdaNameAndLabel,
const std::map< std::string, std::string > &  info 
)
inline

takes inputTupleSetName, inputColumnNames, inputColumnsToApply, outputTupleSetName, outputColumnName, outputColumns, TCAP operation name as inputs, and outputs a TCAP string with one TCAP operation.

Parameters
inputTupleSetName- // TODO add proper descriptions of the parameter
inputColumnNames- // TODO add proper descriptions of the parameter
inputColumnsToApply- // TODO add proper descriptions of the parameter
outputTupleSetName- // TODO add proper descriptions of the parameters
outputColumns- // TODO add proper descriptions of the parameters
outputColumnName- // TODO add proper descriptions of the parameters
tcapOperation- // TODO add proper descriptions of the parameters
computationNameAndLabel- // TODO add proper descriptions of the parameters
lambdaNameAndLabel- // TODO add proper descriptions of the parameters
Returns
the generated tcap string - // TODO add proper descriptions of the parameters

Definition at line 240 of file GenericLambdaObject.h.

+ Here is the caller graph for this function:

virtual std::string pdb::GenericLambdaObject::getTypeOfLambda ( )
pure virtual
void pdb::GenericLambdaObject::setInputIndex ( int  i,
unsigned int  index 
)
inline

Used to set the index of this lambda's input in the corresponding computation

Parameters
i- the index of the input
index- the index of the input in the corresponding computation

Definition at line 72 of file GenericLambdaObject.h.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

virtual std::string pdb::GenericLambdaObject::toTCAPString ( std::vector< std::string > &  inputTupleSetNames,
std::vector< std::string > &  inputColumnNames,
std::vector< std::string > &  inputColumnsToApply,
std::vector< std::string > &  childrenLambdaNames,
int  lambdaLabel,
std::string  computationName,
int  computationLabel,
std::string &  outputTupleSetName,
std::vector< std::string > &  outputColumns,
std::string &  outputColumnName,
std::string &  myLambdaName,
MultiInputsBase multiInputsComp = nullptr,
bool  amIPartOfJoinPredicate = false,
bool  amILeftChildOfEqualLambda = false,
bool  amIRightChildOfEqualLambda = false,
std::string  parentLambdaName = "",
bool  isSelfJoin = false 
)
inlinevirtual

This gets TCAP string corresponding to this Lambda JiaNote: below is just a default implementation for Lambdas to "Apply" you can override this implementation in your subclasses

// TODO this method has been glued and tied together multiple times and should be completely rewritten and refactored

Parameters
inputTupleSetNames- // TODO add proper descriptions of the parameter
inputColumnNames- // TODO add proper descriptions of the parameter
inputColumnsToApply- // TODO add proper descriptions of the parameter
childrenLambdaNames- // TODO add proper descriptions of the parameter
lambdaLabel- // TODO add proper descriptions of the parameter
computationName- // TODO add proper descriptions of the parameter
computationLabel- // TODO add proper descriptions of the parameter
outputTupleSetName- // TODO add proper descriptions of the parameter
outputColumns- // TODO add proper descriptions of the parameter
outputColumnName- // TODO add proper descriptions of the parameter
myLambdaName- // TODO add proper descriptions of the parameter
multiInputsComp- // TODO add proper descriptions of the parameter
amIPartOfJoinPredicate- // TODO add proper descriptions of the parameter
amILeftChildOfEqualLambda- // TODO add proper descriptions of the parameter
amIRightChildOfEqualLambda- // TODO add proper descriptions of the parameter
parentLambdaName- // TODO add proper descriptions of the parameter
isSelfJoin- // TODO add proper descriptions of the parameter
Returns
- // TODO add proper descriptions of the return value

Reimplemented in pdb::AndLambda< LeftType, RightType >, pdb::EqualsLambda< LeftType, RightType >, pdb::MethodCallLambda< Out, ClassType >, pdb::AttAccessLambda< Out, ClassType >, and pdb::DereferenceLambda< OutType >.

Definition at line 339 of file GenericLambdaObject.h.

+ Here is the call graph for this function:

virtual std::string pdb::GenericLambdaObject::toTCAPStringForCartesianJoin ( int  lambdaLabel,
std::string  computationName,
int  computationLabel,
std::string &  outputTupleSetName,
std::vector< std::string > &  outputColumns,
std::string &  outputColumnName,
std::string &  myLambdaName,
MultiInputsBase multiInputsComp 
)
inlinevirtual

// TODO missing description

Parameters
lambdaLabel- // TODO missing description
computationName- // TODO missing description
computationLabel- // TODO missing description
outputTupleSetName- // TODO missing description
outputColumns- // TODO missing description
outputColumnName- // TODO missing description
myLambdaName- // TODO missing description
multiInputsComp- // TODO missing description
Returns
- // TODO missing description

Reimplemented in pdb::CPlusPlusLambda< F, ReturnType, ParamOne, ParamTwo, ParamThree, ParamFour, ParamFive >.

Definition at line 301 of file GenericLambdaObject.h.

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<unsigned int> pdb::GenericLambdaObject::inputIndexes
private

input index in a multi-input computation

Definition at line 61 of file GenericLambdaObject.h.


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