AllianceDB  0.0.1
AllianceDB is an open-source suite, including benchmarks and libs for evaluating and improving stream operation algorithms on modern hardwares.
AbstractJoinAlgo.h
Go to the documentation of this file.
1 
2 //
3 // Created by tony on 11/03/22.
4 //
5 
6 #ifndef _JOINALGO_ABSTRACTJOINALGO_H_
7 #define _JOINALGO_ABSTRACTJOINALGO_H_
8 #include <Common/Types.h>
9 #include <string>
10 #include <memory>
11 namespace INTELLI {
29  protected:
30  string nameTag;
31  public:
33  setAlgoName("NULL");
34  }
35  ~AbstractJoinAlgo() {}
36 
45  virtual size_t join(TuplePtrQueue ts, TuplePtrQueue tr, int threads = 1) {
46  assert(tr);
47  assert(ts);
48  assert(threads);
49  return 0;
50  }
61  virtual size_t join(TuplePtr *ts, TuplePtr *tr, size_t tsLen, size_t trLen, int threads = 1) {
62  assert(tr != ts);
63  assert(trLen >= 0);
64  assert(tsLen >= 0);
65  assert(threads);
66  return 0;
67  }
77  virtual size_t join(TuplePtr *ts, TuplePtr tr, size_t tsLen, int threads = 1) {
78  assert(ts);
79  assert(tr);
80  assert(tsLen >= 0);
81  assert(threads);
82  return 0;
83  }
91  virtual size_t join(TuplePtrQueue ts, TuplePtr tr, int threads = 1) {
92  assert(tr);
93  assert(ts);
94  assert(threads);
95  return 0;
96  }
101  void setAlgoName(string name) {
102  nameTag = name;
103  }
108  string getAlgoName() {
109  return nameTag;
110  }
111 };
112 typedef std::shared_ptr<AbstractJoinAlgo> AbstractJoinAlgoPtr;
113 #define newAbstractJoinAlgo() make_shared<AbstractJoinAlgo>()
118 }
119 
120 #endif //ALIANCEDB_INCLUDE_JOINALGO_ABSTRACTJOINALGO_H_
The abstraction to describe a join algorithm, providing virtual function of join.
Definition: AbstractJoinAlgo.h:28
virtual size_t join(TuplePtr *ts, TuplePtr *tr, size_t tsLen, size_t trLen, int threads=1)
The function to execute join, batch of both, legacy way.
Definition: AbstractJoinAlgo.h:61
void setAlgoName(string name)
set the name of algorithm
Definition: AbstractJoinAlgo.h:101
string getAlgoName()
get the name of algorithm
Definition: AbstractJoinAlgo.h:108
virtual size_t join(TuplePtrQueue ts, TuplePtr tr, int threads=1)
The function to execute join, batch of one, tuple of another.
Definition: AbstractJoinAlgo.h:91
virtual size_t join(TuplePtrQueue ts, TuplePtrQueue tr, int threads=1)
The function to execute join, batch of both.
Definition: AbstractJoinAlgo.h:45
virtual size_t join(TuplePtr *ts, TuplePtr tr, size_t tsLen, int threads=1)
The function to execute join, batch of one, tuple of another.
Definition: AbstractJoinAlgo.h:77
std::shared_ptr< class Tuple > TuplePtr
The class to describe a shared pointer to Tuple.
Definition: Types.h:150
std::shared_ptr< INTELLI::SPSCQueue< INTELLI::TuplePtr > > TuplePtrQueue
To describe a queue of TuplePtr under SPSCQueue.
Definition: Types.h:228
Definition: DatasetTool.h:10