Changeset: 0b0d432ebddd for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0b0d432ebddd
Added Files:
sql/backends/monet5/50_cquery.mal
sql/backends/monet5/Tests/cquery00.malC
sql/backends/monet5/Tests/cquery05.sql
sql/backends/monet5/Tests/cquery10.sql
sql/backends/monet5/sql_cquery.c
sql/backends/monet5/sql_cquery.h
Removed Files:
sql/backends/monet5/Tests/cquery00.sql
sql/backends/monet5/timetrails/petrinet.c
sql/backends/monet5/timetrails/petrinet.h
sql/backends/monet5/timetrails/petrinet.mal
Modified Files:
monetdb5/optimizer/opt_cquery.c
monetdb5/optimizer/opt_cquery.h
monetdb5/optimizer/opt_prelude.c
monetdb5/optimizer/opt_prelude.h
monetdb5/optimizer/optimizer.mal
sql/backends/monet5/Makefile.ag
sql/backends/monet5/Tests/All
sql/backends/monet5/Tests/cqstream00.sql
sql/backends/monet5/Tests/cqstream01.sql
sql/backends/monet5/Tests/cqstream02.sql
sql/backends/monet5/Tests/cqstream03.sql
sql/backends/monet5/Tests/cqstream08.sql
sql/backends/monet5/sql_optimizer.c
sql/scripts/50_cquery.sql
sql/test/BugTracker-2011/Tests/like_or.Bug-2924.stable.out
sql/test/BugTracker-2012/Tests/table_functions_fail_after_restart-0.Bug-3063.stable.out
sql/test/BugTracker-2012/Tests/table_functions_fail_after_restart-1.Bug-3063.stable.out
sql/test/Dependencies/Tests/Dependencies.stable.out
sql/test/Dependencies/Tests/Dependencies.stable.out.int128
sql/test/Tests/setoptimizer.stable.out
sql/test/Tests/systemfunctions.stable.out
sql/test/Tests/systemfunctions.stable.out.int128
sql/test/bugs/Tests/groupby_having_charlength-bug-sf-943566.stable.out
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/leaks/Tests/check1.stable.out
sql/test/leaks/Tests/check1.stable.out.int128
Branch: timetrails
Log Message:
Synchronize
Compile and mtest run done
diffs (truncated from 4035 to 300 lines):
diff --git a/monetdb5/optimizer/opt_cquery.c b/monetdb5/optimizer/opt_cquery.c
--- a/monetdb5/optimizer/opt_cquery.c
+++ b/monetdb5/optimizer/opt_cquery.c
@@ -66,7 +66,7 @@ OPTcqueryImplementation(Client cntxt, Ma
if( i == mb->stop)
return MAL_SUCCEED;
-#ifdef DEBUG_OPT_IOT
+#ifdef DEBUG_OPT_CQUERY
mnstr_printf(cntxt->fdout, "#cquery optimizer start\n");
printFunction(cntxt->fdout, mb, stk, LIST_MAL_DEBUG);
#endif
@@ -78,7 +78,7 @@ OPTcqueryImplementation(Client cntxt, Ma
for (i = 1; i < limit && btop <MAXBSKT; i++){
p = old[i];
if( getModuleId(p)== basketRef && (getFunctionId(p)==
registerRef || getFunctionId(p)== bindRef ) ){
-#ifdef DEBUG_OPT_IOT
+#ifdef DEBUG_OPT_CQUERY
mnstr_printf(cntxt->fdout, "#cquery stream table
%s.%s\n", getModuleId(p), getFunctionId(p));
#endif
schemas[btop]= getVarConstant(mb, getArg(p,2)).val.sval;
@@ -91,7 +91,7 @@ OPTcqueryImplementation(Client cntxt, Ma
btop++;
}
if( getModuleId(p)== basketRef && getFunctionId(p) == appendRef
){
-#ifdef DEBUG_OPT_IOT
+#ifdef DEBUG_OPT_CQUERY
mnstr_printf(cntxt->fdout, "#cquery stream table
%s.%s\n", getModuleId(p), getFunctionId(p));
#endif
schemas[btop]= getVarConstant(mb, getArg(p,2)).val.sval;
@@ -105,7 +105,7 @@ OPTcqueryImplementation(Client cntxt, Ma
btop++;
}
if( getModuleId(p)== basketRef && getFunctionId(p) == updateRef
){
-#ifdef DEBUG_OPT_IOT
+#ifdef DEBUG_OPT_CQUERY
mnstr_printf(cntxt->fdout, "#cquery stream table
%s.%s\n", getModuleId(p), getFunctionId(p));
#endif
schemas[btop]= getVarConstant(mb, getArg(p,2)).val.sval;
@@ -119,7 +119,7 @@ OPTcqueryImplementation(Client cntxt, Ma
btop++;
}
if( getModuleId(p)== cqueryRef && getFunctionId(p) ==
basketRef){
-#ifdef DEBUG_OPT_IOT
+#ifdef DEBUG_OPT_CQUERY
mnstr_printf(cntxt->fdout, "#cquery stream table
%s.%s\n", getModuleId(p), getFunctionId(p));
#endif
schemas[btop]= getVarConstant(mb, getArg(p,1)).val.sval;
@@ -141,7 +141,7 @@ OPTcqueryImplementation(Client cntxt, Ma
if( btop == MAXBSKT || btop == 0)
return MAL_SUCCEED;
-#ifdef DEBUG_OPT_IOT
+#ifdef DEBUG_OPT_CQUERY
mnstr_printf(cntxt->fdout, "#cquery optimizer started with %d streams,
mvc %d\n", btop,lastmvc);
printFunction(cntxt->fdout, mb, stk, LIST_MAL_DEBUG);
#endif
@@ -199,7 +199,7 @@ OPTcqueryImplementation(Client cntxt, Ma
// register all baskets used after the mvc had been
determined
if (getModuleId(p) == sqlRef && getFunctionId(p) ==
tidRef ){
getStreamTableInfo(getVarConstant(mb,getArg(p,2)).val.sval,
getVarConstant(mb,getArg(p,3)).val.sval );
-#ifdef DEBUG_OPT_IOT
+#ifdef DEBUG_OPT_CQUERY
mnstr_printf(cntxt->fdout, "#cquery optimizer
found stream %d\n",fnd);
#endif
if( fnd){
@@ -310,7 +310,7 @@ OPTcqueryImplementation(Client cntxt, Ma
snprintf(buf,256,"%-20s actions=%2d time=" LLFMT " usec","cquery", btop,
GDKusec() - usec);
newComment(mb,buf);
-#ifdef DEBUG_OPT_IOT
+#ifdef DEBUG_OPT_CQUERY
mnstr_printf(cntxt->fdout, "#cquery optimizer final\n");
printFunction(cntxt->fdout, mb, stk, LIST_MAL_DEBUG);
#endif
diff --git a/monetdb5/optimizer/opt_cquery.h b/monetdb5/optimizer/opt_cquery.h
--- a/monetdb5/optimizer/opt_cquery.h
+++ b/monetdb5/optimizer/opt_cquery.h
@@ -17,8 +17,8 @@
* All Rights Reserved.
*/
-#ifndef _OPT_TIMETRAILS_
-#define _OPT_TIMETRAILS_
+#ifndef _OPT_CQUERY_
+#define _OPT_CQUERY_
#include "opt_prelude.h"
#include "opt_support.h"
#include "opt_pipes.h"
diff --git a/monetdb5/optimizer/opt_prelude.c b/monetdb5/optimizer/opt_prelude.c
--- a/monetdb5/optimizer/opt_prelude.c
+++ b/monetdb5/optimizer/opt_prelude.c
@@ -146,6 +146,7 @@ str ifthenelseRef;
str inplaceRef;
str intRef;
str ioRef;
+str inputRef;
str iteratorRef;
str jitRef;
str jsonRef;
@@ -199,6 +200,7 @@ str nextRef;
str oltpRef;
str oidRef;
str openRef;
+str outputRef;
str optimizerRef;
str parametersRef;
str packRef;
@@ -432,6 +434,7 @@ void optimizerInit(void)
inplaceRef = putName("inplace");
intRef = putName("int");
ioRef = putName("io");
+ inputRef = putName("input");
iteratorRef = putName("iterator");
projectionpathRef = putName("projectionpath");
joinRef = putName("join");
@@ -485,6 +488,7 @@ void optimizerInit(void)
oidRef = putName("oid");
optimizerRef = putName("optimizer");
openRef = putName("open");
+ outputRef = putName("output");
parametersRef = putName("parameters");
packRef = putName("pack");
pack2Ref = putName("pack2");
diff --git a/monetdb5/optimizer/opt_prelude.h b/monetdb5/optimizer/opt_prelude.h
--- a/monetdb5/optimizer/opt_prelude.h
+++ b/monetdb5/optimizer/opt_prelude.h
@@ -144,6 +144,7 @@ mal_export str ifthenelseRef;
mal_export str inplaceRef;
mal_export str intRef;
mal_export str ioRef;
+mal_export str inputRef;
mal_export str iteratorRef;
mal_export str projectionpathRef;
mal_export str jitRef;
@@ -193,6 +194,7 @@ mal_export str oidRef;
mal_export str oltpRef;
mal_export str openRef;
mal_export str optimizerRef;
+mal_export str outputRef;
mal_export str parametersRef;
mal_export str packRef;
mal_export str pack2Ref;
diff --git a/monetdb5/optimizer/optimizer.mal b/monetdb5/optimizer/optimizer.mal
--- a/monetdb5/optimizer/optimizer.mal
+++ b/monetdb5/optimizer/optimizer.mal
@@ -44,12 +44,12 @@ pattern optimizer.volcano(mod:str, fcn:s
address OPTwrapper
comment "Simulate volcano style execution";
-#opt_iot
-pattern optimizer.iot():str
+#opt_cquery
+pattern optimizer.cquery():str
address OPTwrapper;
-pattern optimizer.iot(mod:str, fcn:str):str
+pattern optimizer.cquery(mod:str, fcn:str):str
address OPTwrapper
-comment "Simulate iot style execution";
+comment "Simulate cquery style execution";
#opt_constants
pattern optimizer.constants():str
diff --git a/sql/backends/monet5/timetrails/petrinet.mal
b/sql/backends/monet5/50_cquery.mal
rename from sql/backends/monet5/timetrails/petrinet.mal
rename to sql/backends/monet5/50_cquery.mal
--- a/sql/backends/monet5/timetrails/petrinet.mal
+++ b/sql/backends/monet5/50_cquery.mal
@@ -15,59 +15,72 @@
# Copyright August 2008-2016 MonetDB B.V.
# All Rights Reserved.
-module petrinet;
+module cquery;
-pattern register(mod:str, fcn:str, calls:int)
-address PNregister;
pattern register(mod:str, fcn:str)
-address PNregister
-comment "Add a continous MAL query to the Petri net. It will analyse
-the MAL block to determine the input/output dependencies.";
+address CQregister
+comment "Add a continuous MAL plan to the Petri-net scheduler. It will analyse
+the MAL block to determine the input/output dependencies and firing
conditions.";
pattern resume(mod:str, fcn:str)
-address PNresume
-comment "Activate a continuous query";
-
+address CQresume
+comment "Activate a specific continuous query";
pattern resume()
-address PNresume
+address CQresume
comment "Activate all continuous queries";
pattern pause(mod:str, fcn:str)
-address PNpause
+address CQpause
comment "Deactivate a continuous query";
-
pattern pause()
-address PNpause
+address CQpause
comment "Deactivate all continuous queries";
-pattern step(cnt:int)
-address PNstep
+pattern deregister(mod:str, fcn:str)
+address CQrelease
+comment "Remove a continuous query";
+pattern deregister()
+address CQrelease
+comment "Remove all continuous queries";
+
+pattern wait(cnt:int)
+address CQwait
+comment "Sleep for some time";
+
+pattern cycles(mod:str, fcn:str,cnt:int)
+address CQcycles
+comment "Limit number of petrinet steps";
+pattern cycles(cnt:int)
+address CQcycles
comment "Limit number of petrinet steps";
-pattern timetrails.deregister()
-address PNderegister
-comment "Remove all query from the Petri-net controller";
-
-pattern timetrails.deregister(mod:str,fcn:str)
-address PNderegister
-comment "Remove a query from the Petri-net controller";
+# scheduler heart beat for each CQ
+pattern heartbeat(mod:str, fcn:str,cnt:int)
+address CQheartbeat
+comment "Awake the query after cnt milliseconds";
+pattern heartbeat(cnt:int)
+address CQheartbeat
+comment "Awake all queries after cnt milliseconds";
-pattern timetrails.period(t:int)
-address PNperiod
-comment "Control the scheduler cycle time in ms.";
+# continuous query window size for stream
+pattern tumble(sch:str, tbl:str, elm:int)
+address CQtumble
+comment "Number of tuples to shift forward";
-command timetrails.queries() (mod:bat[:str],fcn:bat[:str],
status:bat[:str],lastrun:bat[:timestamp],runs:bat[:int],
time:bat[:lng],error:bat[:str])
-address PNtable
-comment "Inspect the timetrails queries";
+# stream window constraints
+pattern window(sch:str,tbl:str,maximal:int)
+address CQwindow
+comment "Set the input window size constraints";
-command timetrails.inputplaces() (sch:bat[:str],
tbl:bat[:str],mod:bat[:str],fcn:bat[:str])
-address PNinputplaces
-comment "Inspect the destination of the places";
+# continuous query status analysis
+pattern log() (tick:bat[:timestamp],mod:bat[:str],fcn:bat[:str],
status:bat[:str], time:bat[:lng],error:bat[:str])
+address CQlog
+comment "The log of all CQ executions";
-command timetrails.outputplaces() (sch:bat[:str],
tbl:bat[:str],mod:bat[:str],fcn:bat[:str])
-address PNoutputplaces
-comment "Inspect the output places";
+pattern show(sch:str,fcn:str)
+address CQshow
+comment "Debug a single continuous query";
command dump()
-address PNdump
-comment "Show the status of the Petri net";
+address CQdump
+comment "Show the status of the query scheduler";
diff --git a/sql/backends/monet5/Makefile.ag b/sql/backends/monet5/Makefile.ag
--- a/sql/backends/monet5/Makefile.ag
+++ b/sql/backends/monet5/Makefile.ag
@@ -45,6 +45,7 @@ lib__sql = {
sql_round.c sql_round_impl.h sql_bat2time.c \
sql_fround.c sql_fround_impl.h \
sql_orderidx.c sql_orderidx.h \
+ sql_cquery.c sql_cquery.h \
sql_rank.c sql_rank.h
LIBS = ../../server/libsqlserver \
../../storage/libstore \
@@ -78,7 +79,7 @@ headers_mal_hge = {
headers_autoload = {
HEADERS = mal
DIR = libdir/monetdb5/autoload
- SOURCES = 40_sql.mal
+ SOURCES = 40_sql.mal 50_cquery.mal
}
headers_autoload_hge = {
diff --git a/sql/backends/monet5/Tests/All b/sql/backends/monet5/Tests/All
--- a/sql/backends/monet5/Tests/All
+++ b/sql/backends/monet5/Tests/All
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list