OoOJoin  0.0.1
The next generation of out-of-order join operator
AbstractOperator.h
Go to the documentation of this file.
1 
2 //
3 // Created by tony on 22/11/22.
4 //
5 
6 #ifndef ADB_INCLUDE_OPERATOR_ABSTRACTOPERATOR_H_
7 #define ADB_INCLUDE_OPERATOR_ABSTRACTOPERATOR_H_
8 #include <Common/Window.h>
9 #include <Common/Tuples.h>
11 #include <assert.h>
12 #include <Utils/ConfigMap.hpp>
13 #include <WaterMarker/WMTable.h>
14 //#include <Utils/Logger.hpp>
15 #define OP_INFO printf
16 #define OP_ERROR printf
17 #define OP_WARNNING INTELLI_WARNING
18 
19 using namespace INTELLI;
20 namespace OoOJoin {
36  protected:
37  struct timeval timeBaseStruct;
38  size_t windowLen = 0;
39  size_t slideLen = 0;
40  size_t sLen = 0, rLen = 0;
41  int threads = 0;
42  tsType timeStep = 0;
43  tsType timeBreakDown_all = 0;
48  public:
49  ConfigMapPtr config = nullptr;
50  AbstractOperator() {}
51  ~AbstractOperator() {}
52 
58  void setWindow(size_t _wl, size_t _sli) {
59  windowLen = _wl;
60  slideLen = _sli;
61  }
67  void setBufferLen(size_t _sLen, size_t _rLen) {
68  sLen = _sLen;
69  rLen = _rLen;
70  }
71 
76  void syncTimeStruct(struct timeval tv) {
77  timeBaseStruct = tv;
78  }
84  virtual bool setConfig(ConfigMapPtr cfg);
91  virtual bool feedTupleS(TrackTuplePtr ts);
92 
99  virtual bool feedTupleR(TrackTuplePtr tr);
100 
105  virtual bool start();
106 
111  virtual bool stop();
112 
117  virtual size_t getResult();
122  virtual size_t getAQPResult();
128  virtual ConfigMapPtr getTimeBreakDown();
129 };
135 typedef std::shared_ptr<class AbstractOperator> AbstractOperatorPtr;
141 #define newAbstractOperator std::make_shared<OoOJoin::AbstractOperator>
148 #define timeTrackingStart(v); tsType v;v=UtilityFunctions::timeLastUs(timeBaseStruct);
155 #define timeTrackingStartNoClaim(v); v=UtilityFunctions::timeLastUs(timeBaseStruct);
163 #define timeTrackingEnd(v) (UtilityFunctions::timeLastUs(timeBaseStruct)-v)
164 
165 }
166 #endif //INTELLISTREAM_INCLUDE_OPERATOR_ABSTRACTOPERATOR_H_
The abstraction to describe a join operator, providing virtual function of using the operation.
Definition: AbstractOperator.h:35
void syncTimeStruct(struct timeval tv)
Synchronize the time structure with outside setting.
Definition: AbstractOperator.h:76
void setBufferLen(size_t _sLen, size_t _rLen)
Set buffer length of S and R buffer.
Definition: AbstractOperator.h:67
void setFinalProcessedTime()
set the final processed time for all tuples
void setWindow(size_t _wl, size_t _sli)
Set the window parameters of the whole operator.
Definition: AbstractOperator.h:58
std::shared_ptr< class AbstractOperator > AbstractOperatorPtr
The class to describe a shared pointer to AbstractOperator.
Definition: AbstractOperator.h:135
uint64_t tsType
Definition: Tuples.h:20
std::shared_ptr< class TrackTuple > TrackTuplePtr
The class to describe a shared pointer to TrackTuple.
Definition: Tuples.h:171
std::shared_ptr< ConfigMap > ConfigMapPtr
The class to describe a shared pointer to ConfigMap.
Definition: ConfigMap.hpp:356
Definition: OperatorTable.cpp:7