Changeset: 12ccaffc7fa9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=12ccaffc7fa9
Modified Files:
monetdb5/mal/mal_scenario.c
monetdb5/optimizer/opt_pipes.c
Branch: mbedded
Log Message:
cleanup not needed calls to getAddress
diffs (191 lines):
diff --git a/monetdb5/mal/mal_scenario.c b/monetdb5/mal/mal_scenario.c
--- a/monetdb5/mal/mal_scenario.c
+++ b/monetdb5/mal/mal_scenario.c
@@ -92,7 +92,6 @@
*/
#include "monetdb_config.h"
#include "mal_scenario.h"
-#include "mal_linker.h" /* for getAddress() */
#include "mal_client.h"
#include "mal_authorize.h"
#include "mal_exception.h"
@@ -153,70 +152,10 @@ getFreeScenario(void)
return scen;
}
-/*
- * A scenario is initialized only once per session.
- * All other requests are silently ignored.
- * After initialization, all state functions should have been set.
- * Initialization includes searching for the scenario startup file in
- * the etc/MonetDB directory. This creates a dependency, because the
- * malInclude also needs a scenario. To break this cycle, the system should
- * call once the routine default scenario for each client first.
- */
-static str
-initScenario(Client c, Scenario s)
-{
- //str l = s->language;
- str msg = MAL_SUCCEED;
-
- if (s->initSystemCmd || !s->initSystem)
- return(fillScenario(c, s));
- /* prepare for conclicts */
- assert(0);
- return msg;
-/*
- MT_lock_set(&mal_contextLock);
- if (s->initSystem && s->initSystemCmd == 0) {
- s->initSystemCmd = (MALfcn) getAddress(NULL, s->initSystem);
- if (s->initSystemCmd) {
- msg = (*s->initSystemCmd) (c);
- } else {
- char buf[BUFSIZ];
- snprintf(buf,BUFSIZ,"%s.init", l);
- msg = createException(MAL, buf, "Scenario not
initialized");
- }
- }
- if (msg) {
- MT_lock_unset(&mal_contextLock);
- return msg;
- }
-
- if (s->exitSystem && s->exitSystemCmd == 0)
- s->exitSystemCmd = (MALfcn) getAddress(NULL, s->exitSystem);
- if (s->initClient && s->initClientCmd == 0)
- s->initClientCmd = (MALfcn) getAddress(NULL, s->initClient);
- if (s->exitClient && s->exitClientCmd == 0)
- s->exitClientCmd = (MALfcn) getAddress(NULL, s->exitClient);
- if (s->reader && s->readerCmd == 0)
- s->readerCmd = (MALfcn) getAddress(NULL, s->reader);
- if (s->parser && s->parserCmd == 0)
- s->parserCmd = (MALfcn) getAddress(NULL, s->parser);
- if (s->optimizer && s->optimizerCmd == 0)
- s->optimizerCmd = (MALfcn) getAddress(NULL, s->optimizer);
- if (s->tactics && s->tacticsCmd == 0)
- s->tacticsCmd = (MALfcn) getAddress(NULL, s->tactics);
- if (s->callback && s->callbackCmd == 0)
- s->callbackCmd = (MALfcn) getAddress(NULL, s->callback);
- if (s->engine && s->engineCmd == 0)
- s->engineCmd = (MALfcn) getAddress(NULL, s->engine);
- MT_lock_unset(&mal_contextLock);
- return(fillScenario(c, s));
-*/
-}
-
str
defaultScenario(Client c)
{
- return initScenario(c, scenarioRec);
+ return fillScenario(c, scenarioRec);
}
/*
@@ -412,7 +351,7 @@ setScenario(Client c, str nme)
for (i = 0; i < SCENARIO_PROPERTIES; i++)
c->state[i] = 0;
- msg = initScenario(c, scen);
+ msg = fillScenario(c, scen);
if (msg) {
/* error occurred, reset the scenario , assume default always
works */
c->scenario = c->oldscenario;
diff --git a/monetdb5/optimizer/opt_pipes.c b/monetdb5/optimizer/opt_pipes.c
--- a/monetdb5/optimizer/opt_pipes.c
+++ b/monetdb5/optimizer/opt_pipes.c
@@ -32,8 +32,6 @@ static struct PIPELINES {
char *name;
char *def;
char *status;
- //char *prerequisite;
- char *OLD_prerequisite;
MalBlkPtr mb;
char builtin;
} pipes[MAXOPTPIPES] = {
@@ -52,7 +50,7 @@ static struct PIPELINES {
"optimizer.profiler();"
"optimizer.candidates();"
"optimizer.garbageCollector();",
- "stable", NULL, NULL, 1},
+ "stable", NULL, 1},
/* The default pipe line contains as of Feb2010
* mitosis-mergetable-reorder, aimed at large tables and improved
* access locality.
@@ -93,7 +91,7 @@ static struct PIPELINES {
// "optimizer.jit();" awaiting the new batcalc api
"optimizer.wlc();"
"optimizer.garbageCollector();",
- "stable", NULL, NULL, 1},
+ "stable", NULL, 1},
/*
* Optimistic concurreny control in general leads to more transaction failures
* in an OLTP setting. The partial solution provided is to give out
@@ -130,7 +128,7 @@ static struct PIPELINES {
"optimizer.oltp();"
"optimizer.wlc();"
"optimizer.garbageCollector();",
- "stable", NULL, NULL, 1},
+ "stable", NULL, 1},
/*
* Volcano style execution produces a sequence of blocks from the source
relation
*/
@@ -166,7 +164,7 @@ static struct PIPELINES {
// "optimizer.jit();" awaiting the new batcalc api
"optimizer.wlc();"
"optimizer.garbageCollector();",
- "stable", NULL, NULL, 1},
+ "stable", NULL, 1},
/* The no_mitosis pipe line is (and should be kept!) identical to the
* default pipeline, except that optimizer mitosis is omitted. It is
* used mainly to make some tests work deterministically, and to check
@@ -207,7 +205,7 @@ static struct PIPELINES {
// "optimizer.jit();" awaiting the new batcalc api
"optimizer.wlc();"
"optimizer.garbageCollector();",
- "stable", NULL, NULL, 1},
+ "stable", NULL, 1},
/* The sequential pipe line is (and should be kept!) identical to the
* default pipeline, except that optimizers mitosis & dataflow are
* omitted. It is use mainly to make some tests work
@@ -247,13 +245,13 @@ static struct PIPELINES {
// "optimizer.jit();" awaiting the new batcalc api
"optimizer.wlc();"
"optimizer.garbageCollector();",
- "stable", NULL, NULL, 1},
+ "stable", NULL, 1},
/* Experimental pipelines stressing various components under
* development. Do not use any of these pipelines in production
* settings!
*/
/* sentinel */
- {NULL, NULL, NULL, NULL, NULL, 0}
+ {NULL, NULL, NULL, NULL, 0}
};
/*
@@ -371,14 +369,6 @@ getPipeCatalog(bat *nme, bat *def, bat *
}
for (i = 0; i < MAXOPTPIPES && pipes[i].name; i++) {
- /*
- if (pipes[i].prerequisite && getAddress(pipes[i].prerequisite)
== NULL){
- BBPreclaim(b);
- BBPreclaim(bn);
- BBPreclaim(bs);
- throw(MAL,"getPipeCatalog", SQLSTATE(HY002)
"#MAL.getAddress address of '%s' not found",pipes[i].name);
- }
- */
if (BUNappend(b, pipes[i].name, false) != GDK_SUCCEED ||
BUNappend(bn, pipes[i].def, false) != GDK_SUCCEED ||
BUNappend(bs, pipes[i].status, false) != GDK_SUCCEED) {
@@ -480,10 +470,6 @@ compileOptimizer(Client cntxt, const cha
/* precompile a pipeline as MAL string */
for (j = 0; j < MAXOPTPIPES && pipes[j].def; j++) {
if (pipes[j].mb == NULL) {
- /*
- if (pipes[j].prerequisite &&
getAddress(pipes[j].prerequisite) == NULL)
- continue;
- */
snprintf(buf,2048,"function
optimizer.%s(); %s;end %s;", pipes[j].name,pipes[j].def,pipes[j].name);
msg = compileString(&fcn,cntxt, buf);
if( msg == MAL_SUCCEED){
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list