OoOJoin  0.0.1
The next generation of out-of-order join operator
MeanAQPIAWJOperator.h
Go to the documentation of this file.
1 
2 //
3 // Created by tony on 03/12/22.
4 //
5 
6 #ifndef INTELLISTREAM_INCLUDE_OPERATOR_MEANAQPMeanAQPIAWJOPERATOR_H_
7 #define INTELLISTREAM_INCLUDE_OPERATOR_MEANAQPMeanAQPIAWJOPERATOR_H_
9 #include <Common/Window.h>
10 #include <atomic>
11 #include <WaterMarker/LatenessWM.h>
12 #include <Common/StateOfKey.h>
13 namespace OoOJoin {
14 
34  protected:
35  Window myWindow;
36  size_t intermediateResult = 0;
37  size_t confirmedResult = 0;
38  uint64_t windowBound = 0;
39  // double alphaArrivalRate=0.125;
40  double alphaArrivalSkew = 0.125;
41  double betaArrivalSkew = 0.25;
42 // tsType lastTimeS = 0, lastTimeR = 0;
43  double aqpScale = 0.1;
44  void conductComputation();
45  atomic_bool lockedByWaterMark = false;
46  AbstractWaterMarkerPtr wmGen = nullptr;
47  StateOfKeyHashTablePtr stateOfKeyTableR, stateOfKeyTableS;
48  tsType lastTimeOfR = 0;
62  public:
63  size_t arrivedTupleCnt = 0;
64  double arrivalSkew = 0, sigmaArrivalSkew = 0;
65  TrackTuplePtr lastEventTuple = nullptr, lastArrivalTuple = nullptr;
66  // tsType lastSeenTime=0;
67  MeanStateOfKey() {}
68  ~MeanStateOfKey() {}
69  };
70  typedef std::shared_ptr<MeanStateOfKey> MeanStateOfKeyPtr;
71 #define newMeanStateOfKey std::make_shared<MeanStateOfKey>
72  void updateStateOfKey(MeanStateOfKeyPtr sk, TrackTuplePtr tp);
73  // void updateStateOfKeyR(MeanStateOfKeyPtr sk,TrackTuplePtr tp);
74  void lazyComputeOfAQP();
75  double predictUnarrivedTuples(MeanStateOfKeyPtr px);
76  public:
85  virtual bool setConfig(ConfigMapPtr cfg);
92  virtual bool feedTupleS(TrackTuplePtr ts);
93 
100  virtual bool feedTupleR(TrackTuplePtr tr);
101 
106  virtual bool start();
107 
112  virtual bool stop();
113 
118  virtual size_t getResult();
119 
124  virtual size_t getAQPResult();
135  virtual ConfigMapPtr getTimeBreakDown();
136 };
142 typedef std::shared_ptr<class MeanAQPIAWJOperator> MeanAQPIAWJOperatorPtr;
148 #define newMeanAQPIAWJOperator std::make_shared<OoOJoin::MeanAQPIAWJOperator>
149 }
150 #endif //INTELLISTREAM_INCLUDE_OPERATOR_MEANAQPMeanAQPIAWJOPERATOR_H_
The abstraction to describe a join operator, providing virtual function of using the operation.
Definition: AbstractOperator.h:35
The statistics and prediction state of a key.
Definition: StateOfKey.h:28
Definition: MeanAQPIAWJOperator.h:61
The intra window join (MeanAQPIAWJ) operator under the simplest AQP strategy, only considers a single...
Definition: MeanAQPIAWJOperator.h:33
virtual bool feedTupleR(TrackTuplePtr tr)
feed a tuple R into the Operator
Definition: MeanAQPIAWJOperator.cpp:126
virtual size_t getAQPResult()
get the joined sum result under AQP
Definition: MeanAQPIAWJOperator.cpp:202
tsType timeBreakDown_prediction
for time breakdown of prediction
Definition: MeanAQPIAWJOperator.h:56
virtual ConfigMapPtr getTimeBreakDown()
get the break down information of processing time
Definition: MeanAQPIAWJOperator.cpp:206
tsType timeBreakDown_index
for time breakdown of searching index
Definition: MeanAQPIAWJOperator.h:52
virtual bool setConfig(ConfigMapPtr cfg)
Set the config map related to this operator.
Definition: MeanAQPIAWJOperator.cpp:4
tsType timeBreakDown_join
for time breakdown of join
Definition: MeanAQPIAWJOperator.h:60
virtual bool stop()
stop this operator
Definition: MeanAQPIAWJOperator.cpp:76
virtual size_t getResult()
get the joined sum result
Definition: MeanAQPIAWJOperator.cpp:157
virtual bool start()
start this operator
Definition: MeanAQPIAWJOperator.cpp:18
virtual bool feedTupleS(TrackTuplePtr ts)
feed a tuple s into the Operator
Definition: MeanAQPIAWJOperator.cpp:95
The class to describe a simplest window.
Definition: Window.h:22
std::shared_ptr< class MeanAQPIAWJOperator > MeanAQPIAWJOperatorPtr
The class to describe a shared pointer to MeanAQPIAWJOperator.
Definition: MeanAQPIAWJOperator.h:142
std::shared_ptr< StateOfKeyHashTable > StateOfKeyHashTablePtr
The shared pointer to a StateOfKeyHashTable.
Definition: StateOfKey.h:218
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
std::shared_ptr< class AbstractWaterMarker > AbstractWaterMarkerPtr
The class to describe a shared pointer to AbstractWaterMarker.
Definition: AbstractWaterMarker.h:111