OoOJoin  0.0.1
The next generation of out-of-order join operator
ZipfDataLoader.h
Go to the documentation of this file.
1 
4 #ifndef _INCLUDE_TESTBENCH_ZIPFDATALOADER_H_
5 #define _INCLUDE_TESTBENCH_ZIPFDATALOADER_H_
6 #include <Utils/ConfigMap.hpp>
7 #include <Common/Tuples.h>
8 #include <assert.h>
9 #include <Utils/IntelliLog.h>
11 #include <vector>
12 #include <Utils/MicroDataSet.hpp>
13 using namespace INTELLI;
14 namespace OoOJoin {
15 
53  protected:
54  tsType windowLenMs, timeStepUs, watermarkTimeMs, maxArrivalSkewMs, eventRateKTps;
55  uint64_t zipfDataLoader_zipfKey, zipfDataLoader_zipfValue, zipfDataLoader_zipfEvent, zipfDataLoader_zipfSkew;
56  vector<keyType> keyS, keyR;
57  vector<valueType> valueS, valueR;
58  vector<tsType> eventS, eventR;
59  vector<tsType> arrivalS, arrivalR;
60  size_t testSize, keyRange, valueRange;
61  double zipfDataLoader_zipfKeyFactor, zipfDataLoader_zipfValueFactor, zipfDataLoader_zipfEventFactor,
62  zipfDataLoader_zipfSkewFactor;
63  MicroDataSet md;
64  vector<tsType> genArrivalTime(vector<tsType> eventTime, vector<tsType> arrivalSkew) {
65  vector<tsType> ru = vector<tsType>(eventTime.size());
66  size_t len = (eventTime.size() > arrivalSkew.size()) ? arrivalSkew.size() : eventTime.size();
67  for (size_t i = 0; i < len; i++) {
68  ru[i] = eventTime[i] + arrivalSkew[i];
69  }
70  return ru;
71  }
72  vector<OoOJoin::TrackTuplePtr> genTuples(vector<keyType> keyS,
73  vector<valueType> valueS,
74  vector<tsType> eventS,
75  vector<tsType> arrivalS) {
76  size_t len = keyS.size();
77  vector<OoOJoin::TrackTuplePtr> ru = vector<OoOJoin::TrackTuplePtr>(len);
78  for (size_t i = 0; i < len; i++) {
79  ru[i] = newTrackTuple(keyS[i], valueS[i], eventS[i], arrivalS[i]);
80  }
81  return ru;
82  }
86  void genKey();
90  void genValue();
95  void genEvent();
99  void genArrival();
103  void genFinal();
104  public:
105  ConfigMapPtr cfgGlobal;
106  vector<TrackTuplePtr> sTuple, rTuple;
107  ZipfDataLoader() {}
108  ~ZipfDataLoader() {}
114  virtual bool setConfig(ConfigMapPtr cfg);
120  virtual bool setModConfig(ConfigMapPtr cfg) {
121  return AbstractDataLoader::setModConfig(cfg);
122  }
127  virtual vector<TrackTuplePtr> getTupleVectorS();
132  virtual vector<TrackTuplePtr> getTupleVectorR();
133 };
134 
141 typedef std::shared_ptr<class ZipfDataLoader> ZipfDataLoaderPtr;
147 #define newZipfDataLoader std::make_shared<OoOJoin::ZipfDataLoader>
154 }
155 #endif //INTELLISTREAM_INCLUDE_TESTBENCH_ZipfDataLoader_H_
#define newTrackTuple
(Macro) To creat a new TrackTuple under shared pointer.
Definition: Tuples.h:176
The all-in-one class for the Micro dataset.
Definition: MicroDataSet.hpp:45
The abstract class of dataloader.
Definition: AbstractDataLoader.h:39
The dataloader which allows zipf distribution of key, value, event time and arrival skewness.
Definition: ZipfDataLoader.h:52
std::shared_ptr< class ZipfDataLoader > ZipfDataLoaderPtr
The class to describe a shared pointer to ZipfDataLoader.
Definition: ZipfDataLoader.h:141
virtual bool setModConfig(ConfigMapPtr cfg)
Set the modification config map related to this loader.
Definition: ZipfDataLoader.h:120
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