2 #ifndef _WINDOWSLIDER_ABSTRACTWS_H_
3 #define _WINDOWSLIDER_ABSTRACTWS_H_
7 #include <Utils/SPSCQueue.hpp>
45 INTELLI::join_type_t myType = INTELLI::CNT_BASED;
46 size_t countS, countR;
50 std::vector<size_t> partitionWeight;
51 std::vector<size_t> partitionSizeFinal;
54 bool runTimeScheduling =
false;
55 bool timeBased =
false;
56 bool isRunning =
false;
57 struct timeval timeSys;
70 return ((ts - windowLen) / slideLen) + 1;
94 runTimeScheduling = r;
101 return runTimeScheduling;
129 partitionWeight = std::vector<size_t>(threads);
130 for (
size_t i = 0; i < threads; i++) {
131 partitionWeight[i] = 1;
141 gettimeofday(&timeSys, NULL);
153 return UtilityFunctions::timeLastUs(timeSys) / TIME_STEP;
170 TuplePtrQueueInS->push(ts);
180 TuplePtrQueueInR->push(tr);
218 struct timeval getSysTime() {
An abstraction of window slider, also inherited by both eager and lazy.
Definition: AbstractWS.h:41
AbstractWS(size_t sLen, size_t rLen)
to init the slider with specific length of queue
virtual void waitAckFromJoinProcessors()
to wait the response of join processors
Definition: AbstractWS.h:201
void reset()
reset everything needed
Definition: AbstractWS.h:137
bool isTimeBased()
to read the window type
Definition: AbstractWS.h:85
void setParallelSMP(size_t threads)
to set the parallel level under SMP model
Definition: AbstractWS.h:128
bool isRunTimeScheduling()
to read the scheduling type
Definition: AbstractWS.h:100
size_t getTimeStamp()
to get the time stamp
Definition: AbstractWS.h:151
virtual void feedTupleR(TuplePtr tr)
to feed a tuple R
Definition: AbstractWS.h:178
void setRunTimeScheduling(bool r)
to configure the scheduling place
Definition: AbstractWS.h:93
string getName()
get the name of the slider
Definition: AbstractWS.h:232
virtual void feedTupleS(TuplePtr ts)
to feed a tuple s
Definition: AbstractWS.h:168
size_t oldestWindowBelong(size_t ts)
To get the possible oldest a time stamp belongs to.
Definition: AbstractWS.h:66
virtual void initJoinProcessors()
to init the initJoinProcessors
Definition: AbstractWS.h:189
virtual size_t getJoinResult()
to get the result of join
Definition: AbstractWS.h:211
size_t getSlideLen()
get the length of slide
Definition: AbstractWS.h:121
void setWindowLen(size_t wl)
to set the length of window
Definition: AbstractWS.h:107
void setTimeBased(bool ts)
to configure the window type
Definition: AbstractWS.h:78
virtual void terminateJoinProcessors()
to terminate the join processors
Definition: AbstractWS.h:195
void setSysTime(struct timeval tv)
Set the time structure value ,the timeSys member.
Definition: AbstractWS.h:225
void setSlideLen(size_t sli)
set the length of slide
Definition: AbstractWS.h:114
std::shared_ptr< class Tuple > TuplePtr
The class to describe a shared pointer to Tuple.
Definition: Types.h:150
std::shared_ptr< INTELLI::SPSCQueue< INTELLI::TuplePtr > > TuplePtrQueue
To describe a queue of TuplePtr under SPSCQueue.
Definition: Types.h:228
Definition: DatasetTool.h:10