AllianceDB  0.0.1
AllianceDB is an open-source suite, including benchmarks and libs for evaluating and improving stream operation algorithms on modern hardwares.
AbstractLazyJP.h
Go to the documentation of this file.
1 
3 //
4 // Created by tony on 11/03/22.
5 //
6 
7 #ifndef _JOINPROCESSOR_ABSTRACTLAZYJP_H_
8 #define _JOINPROCESSOR_ABSTRACTLAZYJP_H_
9 #include <JoinProcessor/AbstractJP.h>
10 #include <JoinAlgo/JoinAlgoTable.h>
11 #include <JoinAlgo/NPJ.h>
12 
13 namespace INTELLI {
14 class AbstractLazyJP;
32 typedef enum {
36  LWJ_IDLE = 0,
45 } lwj_status_t;
46 
52 typedef std::shared_ptr<AbstractLazyJP> AbstractLazyJPPtr;
53 #define newAbstractLazyJP() make_shared<AbstractLazyJP>()
54 class AbstractLazyJP : public AbstractJP {
55  protected:
72  lwj_status_t statusS = LWJ_IDLE;
73  lwj_status_t statusR = LWJ_IDLE;
74  // size_t slide = 0;
75  //size_t windowLen = 0;
76 
77  size_t period = 0;
78  size_t tsOverlap = 0;
79  size_t tsEnd = 0;
80  size_t tsBegin = 0;
81  /*bool sWindowReady = false;
82  bool rWindowReady = false;
83  bool isLastJp = false;*/
84  bool checkTupleS(TuplePtr ts);
85  bool checkTupleR(TuplePtr tr);
86  virtual void inlineMain();
87  // bool belongs2Me(size_t timeDivSys);
88  bool largerThanMe(size_t timeDivSys);
89  bool smallerThanMe(size_t timeDivSys);
94  void moveStoBuffer();
98  void moveRtoBuffer();
99  public:
100  AbstractLazyJP() {}
101  ~ AbstractLazyJP() {}
108  virtual void init(size_t sLen, size_t rLen, size_t _sysId) {
109  AbstractJP::init(sLen, rLen, _sysId);
110 
115  }
122  void setLazyWindow(size_t sli, size_t wlen, size_t per) {
123  // slide = sli;
124  windowLen = wlen;
125  setGlobalWindow(wlen, sli);
126  period = per;
127  tsBegin = sysId * slideLenGlobal;
128  tsEnd = tsBegin + windowLenGlobal;
129  tsOverlap = tsEnd - slideLenGlobal;
130  }
131 
132 };
133 
134 }
139 #endif //ALIANCEDB_INCLUDE_JOINPROCESSOR_ABSTRACTLAZYJP_H_
The basic class of join processor.
Definition: AbstractJP.h:38
virtual void init(size_t sLen, size_t rLen, size_t _sysId)
init the join processor with buffer/queue length and id
Definition: AbstractJP.h:119
void setGlobalWindow(size_t wlen, size_t sli)
set the window parameters of global window
Definition: AbstractJP.h:153
The basic class of lazy join processor.
Definition: AbstractLazyJP.h:54
C20Buffer< TuplePtr > windowS
non-overlapping area of window S
Definition: AbstractLazyJP.h:59
C20Buffer< TuplePtr > windowROverLap
Overlapping area of window R, with 'previous' window.
Definition: AbstractLazyJP.h:71
virtual void init(size_t sLen, size_t rLen, size_t _sysId)
init the join processor with buffer/queue length and id
Definition: AbstractLazyJP.h:108
C20Buffer< TuplePtr > windowSOverLap
Overlapping area of window S, with 'previous' window.
Definition: AbstractLazyJP.h:67
void moveStoBuffer()
move the S from the input queue to the window buffer
virtual void inlineMain()
The 'main' function of AbstractP.
void moveRtoBuffer()
move the R from the input queue to the window buffer
void setLazyWindow(size_t sli, size_t wlen, size_t per)
set the parameters of lazy window
Definition: AbstractLazyJP.h:122
C20Buffer< TuplePtr > windowR
non-overlapping area of window R
Definition: AbstractLazyJP.h:63
std::shared_ptr< class Tuple > TuplePtr
The class to describe a shared pointer to Tuple.
Definition: Types.h:150
lwj_status_t
The status of lazy join processor.
Definition: AbstractLazyJP.h:32
Definition: DatasetTool.h:10
@ LWJ_COLLECTING
Definition: AbstractLazyJP.h:40
@ LWJ_IDLE
Definition: AbstractLazyJP.h:36
@ LWJ_PROCESSING
Definition: AbstractLazyJP.h:44