Changeset: 4d467b791d98 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4d467b791d98
Modified Files:
sql/backends/monet5/datacell/Tests/dctemper00.sql
sql/backends/monet5/datacell/Tests/scenario01.sql
sql/backends/monet5/datacell/Tests/scenario02.sql
sql/backends/monet5/datacell/Tests/scenario03.sql
sql/backends/monet5/datacell/Tests/scenario04.sql
sql/backends/monet5/datacell/Tests/scenario05.sql
sql/backends/monet5/datacell/Tests/scenario06.sql
sql/backends/monet5/datacell/opt_datacell.mx
sql/backends/monet5/datacell/petrinet.mx
Branch: default
Log Message:
Make the scenarios port independent
diffs (243 lines):
diff --git a/sql/backends/monet5/datacell/Tests/dctemper00.sql
b/sql/backends/monet5/datacell/Tests/dctemper00.sql
new file mode 100644
--- /dev/null
+++ b/sql/backends/monet5/datacell/Tests/dctemper00.sql
@@ -0,0 +1,45 @@
+-- Scenario to exercise the datacell implementation
+-- using our temperature sensors.
+-- they should sent their events to a particular port.
+-- a warning is issued if the temperature in any of the
+-- rooms fluctuates more then a predefined thresshold within a few minutes/
+
+create schema datacell;
+set optimizer='datacell_pipe';
+
+create table datacell.temperature(
+ location string,
+ tag time with time zone,
+ tmp decimal(3,1)
+);
+
+create table datacell.warnings (msg string, ts time with time zone, location
string);
+create table datacell.templog( ts timestamp with time zone, cnt integer);
+
+call datacell.receptor('datacell.temperature','localhost',50550);
+
+call datacell.emitter('datacell.warnings','localhost',50650);
+
+create procedure datacell.guardian()
+begin
+ declare flg boolean;
+ set flg = datacell.window('datacell.temperature',interval '3' second,
interval '1' second);
+ insert into datacell.warnings
+ select 'WARNING', now(), location from datacell.temperature group by
location having avg(tmp) >3;
+ insert into datacell.templog values (now(), (select count(*) from
datacell.temperature));
+end;
+call datacell.query('datacell.guardian');
+
+call datacell.resume();
+call datacell.dump();
+
+-- externally, use the dctemp program
+-- externally, use netcat to listen to warnings
+
+
+-- wrapup
+call datacell.postlude();
+drop table datacell.temperature;
+drop table datacell.tempout;
+drop table datacell.templog;
+
diff --git a/sql/backends/monet5/datacell/Tests/scenario01.sql
b/sql/backends/monet5/datacell/Tests/scenario01.sql
--- a/sql/backends/monet5/datacell/Tests/scenario01.sql
+++ b/sql/backends/monet5/datacell/Tests/scenario01.sql
@@ -18,7 +18,7 @@
call datacell.basket('datacell.bsktout');
-- initialize receptor
-call datacell.receptor('datacell.bsktin','localhost',50500);
+call datacell.receptor('datacell.bsktin','localhost',50501);
call datacell.mode('datacell.bsktin','passive');
call datacell.protocol('datacell.bsktin','udp');
call datacell.resume('datacell.bsktin');
@@ -27,7 +27,7 @@
--sensor --host=localhost --port=50500 --events=100 --columns=3 --delay=1
-- initialize emitter
-call datacell.emitter('datacell.bsktout','localhost',50600);
+call datacell.emitter('datacell.bsktout','localhost',50601);
call datacell.mode('datacell.bsktout','active');
call datacell.protocol('datacell.bsktout','udp');
call datacell.resume('datacell.bsktout');
diff --git a/sql/backends/monet5/datacell/Tests/scenario02.sql
b/sql/backends/monet5/datacell/Tests/scenario02.sql
--- a/sql/backends/monet5/datacell/Tests/scenario02.sql
+++ b/sql/backends/monet5/datacell/Tests/scenario02.sql
@@ -12,9 +12,9 @@
);
create table datacell.potout( tag timestamp, cnt integer);
-call datacell.receptor('datacell.potin','localhost',50500);
+call datacell.receptor('datacell.potin','localhost',50502);
-call datacell.emitter('datacell.potout','localhost',50600);
+call datacell.emitter('datacell.potout','localhost',50602);
call datacell.query('datacell.putter', 'insert into datacell.potout select
now(), count(*) from datacell.potin;');
@@ -22,7 +22,7 @@
call datacell.dump();
-- externally, activate the sensor
---sensor --host=localhost --port=50500 --events=100 --columns=3 --delay=1
+--sensor --host=localhost --port=50502 --events=100 --columns=3 --delay=1
-- externally, activate the actuator server to listen
-- actuator
diff --git a/sql/backends/monet5/datacell/Tests/scenario03.sql
b/sql/backends/monet5/datacell/Tests/scenario03.sql
--- a/sql/backends/monet5/datacell/Tests/scenario03.sql
+++ b/sql/backends/monet5/datacell/Tests/scenario03.sql
@@ -14,9 +14,9 @@
);
create table datacell.bakout( tag timestamp, cnt integer);
-call datacell.receptor('datacell.bakin','localhost',50500);
+call datacell.receptor('datacell.bakin','localhost',50503);
-call datacell.emitter('datacell.bakout','localhost',50600);
+call datacell.emitter('datacell.bakout','localhost',50603);
call datacell.query('datacell.schep', 'insert into datacell.bakout select
now(), count(*) from datacell.bakin where
datacell.threshold(\'datacell.bakin\',15);');
@@ -24,7 +24,7 @@
call datacell.dump();
-- externally, activate the sensor
---sensor --host=localhost --port=50500 --events=100 --columns=3 --delay=1
+--sensor --host=localhost --port=50503 --events=100 --columns=3 --delay=1
-- externally, activate the actuator server to listen
-- actuator
diff --git a/sql/backends/monet5/datacell/Tests/scenario04.sql
b/sql/backends/monet5/datacell/Tests/scenario04.sql
--- a/sql/backends/monet5/datacell/Tests/scenario04.sql
+++ b/sql/backends/monet5/datacell/Tests/scenario04.sql
@@ -13,9 +13,9 @@
);
create table datacell.winout( tag timestamp, mi integer, ma integer, su
bigint);
-call datacell.receptor('datacell.winin','localhost',50500);
+call datacell.receptor('datacell.winin','localhost',50504);
-call datacell.emitter('datacell.winout','localhost',50600);
+call datacell.emitter('datacell.winout','localhost',50604);
call datacell.query('datacell.mavg', 'insert into datacell.winout select
now(), min(payload),
max(payload), sum(payload) from datacell.winin where
datacell.window(\'datacell.winin\',10,1);');
@@ -24,7 +24,7 @@
call datacell.dump();
-- externally, activate the sensor
---sensor --host=localhost --port=50500 --events=100 --columns=3 --delay=1
+--sensor --host=localhost --port=504444--events=100 --columns=3 --delay=1
-- externally, activate the actuator server to listen
-- actuator
diff --git a/sql/backends/monet5/datacell/Tests/scenario05.sql
b/sql/backends/monet5/datacell/Tests/scenario05.sql
--- a/sql/backends/monet5/datacell/Tests/scenario05.sql
+++ b/sql/backends/monet5/datacell/Tests/scenario05.sql
@@ -13,9 +13,9 @@
);
create table datacell.beatout( tag timestamp, mi integer, ma integer, su
bigint);
-call datacell.receptor('datacell.beatin','localhost',50500);
+call datacell.receptor('datacell.beatin','localhost',50505);
-call datacell.emitter('datacell.beatout','localhost',50600);
+call datacell.emitter('datacell.beatout','localhost',50605);
call datacell.query('datacell.mavgbeat', 'insert into datacell.beatout select
now(), min(payload),
max(payload), sum(payload) from datacell.beatin where
datacell.beat(\'datacell.beatin\',2000) and
datacell.window(\'datacell.beatin\',10,1);');
@@ -27,7 +27,7 @@
select * from datacell.queries();
-- externally, activate the sensor
---sensor --host=localhost --port=50500 --events=100 --columns=3 --delay=1
+--sensor --host=localhost --port=50505 --events=100 --columns=3 --delay=1
-- externally, activate the actuator server to listen
-- actuator
diff --git a/sql/backends/monet5/datacell/Tests/scenario06.sql
b/sql/backends/monet5/datacell/Tests/scenario06.sql
--- a/sql/backends/monet5/datacell/Tests/scenario06.sql
+++ b/sql/backends/monet5/datacell/Tests/scenario06.sql
@@ -14,9 +14,9 @@
create table datacell.barrelout (like datacell.barrelin);
create table datacell.barrellog( ts timestamp, cnt integer);
-call datacell.receptor('datacell.barrelin','localhost',50500);
+call datacell.receptor('datacell.barrelin','localhost',50506);
-call datacell.emitter('datacell.barrelout','localhost',50600);
+call datacell.emitter('datacell.barrelout','localhost',50606);
create procedure datacell.splitter()
begin
@@ -29,7 +29,7 @@
call datacell.dump();
-- externally, activate the sensor
---sensor --host=localhost --port=50500 --events=100 --columns=3 --delay=1
+--sensor --host=localhost --port=50506 --events=100 --columns=3 --delay=1
-- externally, activate the actuator server to listen
-- actuator
diff --git a/sql/backends/monet5/datacell/opt_datacell.mx
b/sql/backends/monet5/datacell/opt_datacell.mx
--- a/sql/backends/monet5/datacell/opt_datacell.mx
+++ b/sql/backends/monet5/datacell/opt_datacell.mx
@@ -244,7 +244,6 @@
(void)stk;
(void)pci;
- printFunction(cntxt->fdout, mb, 0, LIST_MAL_STMT | LIST_MAPI);
if (actions)
{
addPipeDefinition("datacell_pipe",
diff --git a/sql/backends/monet5/datacell/petrinet.mx
b/sql/backends/monet5/datacell/petrinet.mx
--- a/sql/backends/monet5/datacell/petrinet.mx
+++ b/sql/backends/monet5/datacell/petrinet.mx
@@ -232,9 +232,9 @@
pnet[pnettop].status = PNwaiting;
pnet[pnettop].cycles = 0;
/* all the rest is zero */
- pnettop++;
(void)ret;
+ pnettop++;
return PNanalysis(cntxt,s->def);
}
@@ -402,7 +402,7 @@
str
PNanalysis(Client cntxt, MalBlkPtr mb)
{
- int i, j, k, flg, ret;
+ int i, j, k, ret;
InstrPtr p, sig = getInstrPtr(mb,0);
str tbl;
char buf[BUFSIZ], *nme= buf;
@@ -413,8 +413,7 @@
for( i = 0; i < mb->stop; i++){
p= getInstrPtr(mb,i);
if ( getModuleId(p) == basketRef && getFunctionId(p) == grabRef
){
- tbl = getVarConstant(mb,getArg(p,p->argc-2)).val.sval;
- flg = getVarConstant(mb,getArg(p,p->argc-1)).val.ival;
+ tbl = getVarConstant(mb,getArg(p,p->argc-1)).val.sval;
for (j = 0; j < pnettop; j++)
for ( k = 0; k < pnet[j].srctop; k++)
@@ -426,7 +425,6 @@
p= getInstrPtr(mb,i);
if ( getModuleId(p) == basketRef && getFunctionId(p) ==
grabRef ){
tbl = getVarConstant(mb,getArg(p,p->argc-1)).val.sval;
- mnstr_printf(cntxt->fdout,"#input basket %s \n", tbl);
PNsource(&ret, &nme , &tbl);
}
if ( getModuleId(p) == basketRef && getFunctionId(p) ==
putName("pass",4) ){
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list