int main(int argc, char* argv[]) { char addr[128]; //sprintf(addr, "fort2.csail.mit.edu | %d", PORT); sprintf(addr, "localhost | %d", PORT); WSQ_Init(""); WSQ_SetQueryName("proc1query"); WSQ_Pause(); printf("PAUSING WSQ engine, run compiled query manually...\n"); WSQ_BeginTransaction(1001); WSQ_BeginSubgraph(101); // Random tuples, 100Hz //WSQ_AddOp(2, "RandomSource", "","2", "1000 |foobar.schema"); // WSQ_AddOp(1, "ASCIIFileSource", "", "2", "100 |foobar.schema|longer.dat"); // WSQ_AddOp(1, "ASCIIFileSource", "", "2", "10000 |foobar.schema|taq_500mb.log"); WSQ_AddOp(1, "ASCIIFileSource", "", "2", "10000 |foobar.schema|taq_500lines.dat"); // WSQ_AddOp(4, "Printer", "2", "", "From file source:");Thank WSQ_AddOp(3, "ConnectRemoteOut", "2", "", addr); WSQ_EndSubgraph(); WSQ_EndTransaction(); // sleep(1000); sleep(1); printf("Done Sleeping. Shutting down WSQ Engine...\n"); WSQ_Shutdown(); return 0; }
int main(int argc, char* argv[]) { printf("Proc2 starting.\n"); char strargs[2048]; //sprintf(strargs, "128.30.79.5 | %d | string SYM, float TIME, float PRICE, int VOLUME", PORT); //sprintf(strargs, "localhost | %d | \"string SYM, float TIME, float PRICE, int VOLUME\"", PORT); // This is the schema for RandomSource: // sprintf(strargs, "localhost | %d | string SYM, float TIME, float PRICE, int VOLUME", PORT); // This is the schema for ASCIIFileSource: sprintf(strargs, "localhost | %d | bigint TIMESTAMP, string SYMBOL, bigint EXCHTIMESTAMP, bigint RECEIVEDTIME, double BID, double BIDSIZE, double ASK, double ASKSIZE ", PORT); WSQ_Init(""); WSQ_SetQueryName("proc2query"); WSQ_Pause(); printf("PAUSING WSQ engine, run compiled query manually...\n"); WSQ_BeginTransaction(1001); WSQ_BeginSubgraph(101); WSQ_AddOp(20, "ConnectRemoteIn", "", "20", strargs); WSQ_AddOp(21, "Printer", "20", "", "NETSTRM: "); WSQ_EndSubgraph(); int pid = WSQ_EndTransaction(); #if 0 if(pid == 0) { // run directly with pause version // run the executable directly printf("pid is 000000000000\n"); char cmd[128] = "WSQ_OPTLVL=3 WSQ_MAXSPEED=1 ./proc2query.exe"; system(cmd); } #endif //sleep(1000); //sleep(1); //printf("Done Sleeping. Shutting down WSQ Engine...\n"); WSQ_Shutdown(); return 0; }
int main(int argc, char* argv[]) { char addr[128]; //sprintf(addr, "fort2.csail.mit.edu | %d", PORT); sprintf(addr, "localhost | %d", PORT); WSQ_Init(""); WSQ_SetQueryName("proc1query"); WSQ_Pause(); printf("PAUSING WSQ engine, run compiled query manually...\n"); WSQ_BeginTransaction(1001); WSQ_BeginSubgraph(101); // Random tuples, 100Hz //WSQ_AddOp(2, "RandomSource", "","2", "1000 |foobar.schema"); // WSQ_AddOp(1, "ASCIIFileSource", "", "2", "100 |foobar.schema|longer.dat"); //WSQ_AddOp(1, "ASCIIFileSource", "", "2", "10000 |foobar.schema|taq_500mb.log"); WSQ_AddOp(1, "ASCIIFileSource", "", "2", "-1 |foobar.schema|TAQ.1000000"); // WSQ_AddOp(1, "ASCIIFileSource", "", "2", "10000 |foobar.schema|../taq_500mb.log"); // WSQ_AddOp(1, "ASCIIFileSource", "", "2", "10000 |foobar.schema|taq_500lines.dat"); // WSQ_AddOp(4, "Printer", "2", "", "From file source:");Thank WSQ_AddOp(3, "ConnectRemoteOut", "2", "", addr); WSQ_EndSubgraph(); int pid = WSQ_EndTransaction(); if(pid ==0) { //pause version // run the executable directly printf("pid is 000000000000\n"); char cmd[128] = "WSQ_OPTLVL=3 WSQ_MAXSPEED=1 ./proc1query.exe"; system(cmd); } // sleep(1000); //sleep(1); //printf("Done Sleeping. Shutting down WSQ Engine...\n"); WSQ_Shutdown(); return 0; }
int main(int argc, char* argv[]) { // WSQ_Init("1_TAQ_reader.out"); WSQ_Init(""); WSQ_SetQueryName("generated_query_1"); WSQ_Pause(); printf("PAUSED WSQ engine, run compiled query manually...\n"); WSQ_BeginTransaction(1001); WSQ_BeginSubgraph(101); // Drive it by a max-rate timer (negative frequency convention): WSQ_AddOp(1, "ASCIIFileSource", "", "100", "-1 || TAQ.1000000"); WSQ_AddOp(2, "UDF", "100", "200", "output_timer.ws | output_timer | 1.0 "); WSQ_AddOp(3, "Printer", "200", "", " Should never see this.. "); WSQ_EndSubgraph(); int pid = WSQ_EndTransaction(); // printf("Spawned pid %d, waiting on child process.\n"); // WSQ_Shutdown(); return 0; }
int main(int argc, char* argv[]) { char strargs[128]; // This is the schema for ASCIIFileSource: sprintf(strargs, "localhost | %d | bigint TIMESTAMP, string SYMBOL, bigint EXCHTIMESTAMP, bigint RECEIVEDTIME, double BID, double BIDSIZE, double ASK, double ASKSIZE ", PORT); WSQ_Init(""); WSQ_SetQueryName("generated_query_2B"); WSQ_Pause(); printf("PAUSING WSQ engine, run compiled query manually...\n"); WSQ_BeginTransaction(1001); WSQ_BeginSubgraph(101); WSQ_AddOp(20, "ConnectRemoteIn", "", "100", strargs); // Sample the throughput every second (1.0 hz): WSQ_AddOp(2, "UDF", "100", "200", "output_timer.ws | output_timer | 1.0 "); // LIMITATION: Need to have a printer to make sure the output gets compiled properly. WSQ_AddOp(3, "Printer", "200", "", " Should never see this.. "); WSQ_EndSubgraph(); WSQ_EndTransaction(); // WSQ_Shutdown(); return 0; }