OoOJoin  0.0.1
The next generation of out-of-order join operator
TestBench.h
Go to the documentation of this file.
1 
2 //
3 // Created by tony on 23/11/22.
4 //
5 
6 #ifndef INTELLISTREAM_INCLUDE_TESTBENCH_TESTBENCH_H_
7 #define INTELLISTREAM_INCLUDE_TESTBENCH_TESTBENCH_H_
8 #include <Common/Window.h>
10 #include <Utils/IntelliLog.h>
11 #include <string>
12 #include <fstream>
13 #include <iostream>
14 #include <sstream>
16 using namespace INTELLI;
17 #define TB_INFO INTELLI_INFO
18 #define TB_ERROR INTELLI_ERROR
19 #define TB_WARNNING INTELLI_WARNING
20 namespace OoOJoin {
21 
34 class TestBench {
35  protected:
36  void inOrderSort(std::vector<TrackTuplePtr> &arr);
37  void OoOSort(std::vector<TrackTuplePtr> &arr);
38  void inlineTest(void);
39  void forceInOrder(std::vector<TrackTuplePtr> &arr);
40  tsType timeStep = 1;
41 
42  public:
43  std::vector<TrackTuplePtr> rTuple;
44  std::vector<TrackTuplePtr> sTuple;
45  AbstractOperatorPtr testOp = nullptr;
46  ConfigMapPtr opConfig;
47  size_t AQPResult = 0;
48  TestBench() {}
49  ~TestBench() {}
50 
56  void setDataLoader(std::string tag, ConfigMapPtr globalCfg);
61  size_t sizeOfS() {
62  return sTuple.size();
63  }
68  size_t sizeOfR() {
69  return rTuple.size();
70  }
76  void setDataSet(std::vector<TrackTuplePtr> _r, std::vector<TrackTuplePtr> _s);
83  bool setOperator(AbstractOperatorPtr op, ConfigMapPtr cfg);
89  size_t inOrderTest(bool additionalSort);
95  size_t OoOTest(bool additionalSort);
100  void logRTuples(bool skipZero = false);
107  bool saveRTuplesToFile(string fname, bool skipZero = false);
114  bool saveSTuplesToFile(string fname, bool skipZero = false);
119  double getAvgLatency();
124  double getThroughput();
130  double getLatencyPercentage(double fraction);
136  ConfigMapPtr getTimeBreakDown();
137 };
141 }
142 #endif //INTELLISTREAM_INCLUDE_TESTBENCH_TESTBENCH_H_
The test bench class to feed data.
Definition: TestBench.h:34
size_t sizeOfR()
get the size of loaded r tuple
Definition: TestBench.h:68
size_t sizeOfS()
get the size of loaded s tuple
Definition: TestBench.h:61
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< ConfigMap > ConfigMapPtr
The class to describe a shared pointer to ConfigMap.
Definition: ConfigMap.hpp:356
Definition: OperatorTable.cpp:7