Changeset: 18901d241a8d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=18901d241a8d
Modified Files:
monetdb5/optimizer/Makefile.ag
monetdb5/optimizer/opt_mapreduce.c
monetdb5/optimizer/opt_octopus.c
monetdb5/optimizer/opt_wrapper.c
Branch: headless
Log Message:
Get optimizers to compile
diffs (174 lines):
diff --git a/monetdb5/optimizer/Makefile.ag b/monetdb5/optimizer/Makefile.ag
--- a/monetdb5/optimizer/Makefile.ag
+++ b/monetdb5/optimizer/Makefile.ag
@@ -40,7 +40,7 @@
opt_dataflow.c \
opt_deadcode.c \
# opt_derivepath.c \
-# opt_dictionary.c \ need a rewrite
+# opt_dictionary.c \
opt_emptySet.c \
opt_evaluate.c \
opt_factorize.c \
@@ -48,13 +48,13 @@
opt_history.c \
opt_inline.c \
# opt_joinpath.c \
- opt_joinselect.c \
+# opt_joinselect.c \
opt_macro.c \
# opt_mapreduce.c \
opt_mergetable.c \
opt_mitosis.c \
opt_multiplex.c \
-# opt_octopus.c \
+ opt_octopus.c \
opt_pipes.c \
opt_prejoin.c \
opt_prelude.c \
@@ -64,13 +64,14 @@
opt_reduce.c \
opt_remap.c \
opt_remoteQueries.c \
+ opt_replication.c \
opt_reorder.c \
opt_selcrack.c \
opt_singleton.c \
opt_statistics.c \
opt_strengthReduction.c \
opt_support.c \
- opt_tarantula.c \
+# opt_tarantula.c \
opt_trace.c \
opt_wrapper.c
}
diff --git a/monetdb5/optimizer/opt_mapreduce.c
b/monetdb5/optimizer/opt_mapreduce.c
--- a/monetdb5/optimizer/opt_mapreduce.c
+++ b/monetdb5/optimizer/opt_mapreduce.c
@@ -22,7 +22,7 @@
* The Map-Reduce infrastructure requires a little optimizer to turn
* an arbitrary query into a plan to be executed on the systems in the cloud.
* Each cloud consists of a series of named servers, managed by Merovingian
- * with the pattern "*/cloudname/node/*". The cloudname is detected from
+ * with the pattern "*<slash>cloudname/node<slash>*". The cloudname is
detected from
* the schema in which an SQL table is stored. Only schemas starting with
* "mr_" are considered to be mapreduce schemas on the query node. The
* cloudname is the schema name without the leading "mr_" prefix.
@@ -35,11 +35,7 @@
* result sets should be assembled.
*/
-#include "monetdb_config.h"
#include "opt_mapreduce.h"
-#include "mal_interpreter.h"
-#include "remote.h"
-#include "opt_statistics.h"
typedef struct _mapnode {
str uri;
@@ -72,8 +68,7 @@
{
str msg;
COL *cloud;
- oid p, q;
- COLiter bi;
+ oid p;
char nodes[BUFSIZ];
char *n = nodes;
int mapcount = 0;
@@ -84,7 +79,8 @@
return msg;
mal_set_lock(mal_contextLock, "mapreduce");
- cloud = COLdescriptor(*ret); /* should succeed */
+ if ( (msg= getCOLdescriptor(&cloud,ret)) )
+ throwagain(MAL, "optimizer.mapreduce",msg);
mapnodes = (mapnode*)GDKzalloc(sizeof(mapnode) * (COLcount(cloud) + 1));
if (mapnodes == NULL) {
@@ -92,9 +88,8 @@
throw(MAL, "mapreduce.getCloud", MAL_MALLOC_FAIL);
}
- bi = col_iterator(cloud);
- COLloop(cloud, p, q) {
- str t = (str)BUNtail(bi, p);
+ COLforloop(cloud, p) {
+ str t = (str)COLgetString(cloud,p);
mapnodes[mapcount].uri = GDKstrdup(t);
mapnodes[mapcount].user = GDKstrdup("monetdb");
mapnodes[mapcount].pass = GDKstrdup("monetdb");
diff --git a/monetdb5/optimizer/opt_octopus.c b/monetdb5/optimizer/opt_octopus.c
--- a/monetdb5/optimizer/opt_octopus.c
+++ b/monetdb5/optimizer/opt_octopus.c
@@ -1151,7 +1151,6 @@
/* replace arguments with returns from octopus
block */
for ( j = p->retc; j < p->argc; j++)
- /* if ( !(malPart[getArg(p,0)] &
malPart[getArg(p,j)]) ){*/
if ( malPart[getArg(p,j)] > 1 &&
!memb(malPart[getArg(p,j)],0) ){
cl =
OCTgetCluster(malPart[getArg(p,j)]);
if ( cl > 0 ) {
@@ -1169,7 +1168,7 @@
}
pushInstruction(mb, p);
}
- } }
+ }
for (i = last + 1; i < limit; i++){
if ( old[i] == pci){
diff --git a/monetdb5/optimizer/opt_wrapper.c b/monetdb5/optimizer/opt_wrapper.c
--- a/monetdb5/optimizer/opt_wrapper.c
+++ b/monetdb5/optimizer/opt_wrapper.c
@@ -50,7 +50,9 @@
#include "opt_datacyclotron.h"
#include "opt_dataflow.h"
#include "opt_deadcode.h"
+/* TODO
#include "opt_derivepath.h"
+*/
#include "opt_dictionary.h"
#include "opt_emptySet.h"
#include "opt_evaluate.h"
@@ -58,8 +60,10 @@
#include "opt_garbagecollector.h"
#include "opt_history.h"
#include "opt_inline.h"
+/* TODO
#include "opt_joinpath.h"
#include "opt_joinselect.h"
+*/
#include "opt_mapreduce.h"
#include "opt_mergetable.h"
#include "opt_mitosis.h"
@@ -158,12 +162,14 @@
if( strcmp("optimizer.deadcode",optimizer) == 0)
actions= OPTdeadcodeImplementation(cntxt, mb,stk,p);
else
+/* TODO
if( strcmp("optimizer.derivePath",optimizer) == 0)
actions= OPTderivePathImplementation(cntxt, mb,stk,p);
else
if( strcmp("optimizer.dictionary",optimizer) == 0)
actions= OPTdictionaryImplementation(cntxt, mb,stk,p);
else
+*/
if( strcmp("optimizer.emptySet",optimizer) == 0)
actions= OPTemptySetImplementation(cntxt, mb,stk,p);
else
@@ -182,12 +188,14 @@
if( strcmp("optimizer.inline",optimizer) == 0)
actions= OPTinlineImplementation(cntxt, mb,stk,p);
else
+/* TODO
if( strcmp("optimizer.joinPath",optimizer) == 0)
actions= OPTjoinPathImplementation(cntxt, mb,stk,p);
else
if( strcmp("optimizer.joinselect",optimizer) == 0)
actions= OPTjoinselectImplementation(cntxt, mb,stk,p);
else
+*/
if( strcmp("optimizer.mapreduce",optimizer) == 0)
actions= OPTmapreduceImplementation(cntxt, mb,stk,p);
else
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list