-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandom_sentence_test.cpp
More file actions
33 lines (29 loc) · 872 Bytes
/
random_sentence_test.cpp
File metadata and controls
33 lines (29 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "Storm.h"
#include <cstring>
using namespace std;
class RanSentSpout: public storm::Spout {
public:
void Initialize (Json::Value conf, Json::Value context){
storm::Log("*****************Initializing RanSentSpout*******");
present_count = 0;
};
void NextTuple(){
usleep(100);
array_sentence[0] = "this is great";
array_sentence[1] = "we are sending things";
array_sentence[2] = "this is matching sending";
Json::Value to_send_data;
to_send_data.append(array_sentence[present_count%3]);
storm::Tuple t(to_send_data);
present_count++;
storm::Emit(t);
}
private:
string array_sentence[3];
int present_count;
};
int main(){
storm::Log("******************* We have atleast Started**************");
RanSentSpout random_sentence;
random_sentence.Run();
}