Changeset: 72e790fad0a1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=72e790fad0a1
Modified Files:
monetdb5/modules/kernel/array.mx
monetdb5/modules/mal/Makefile.ag
monetdb5/modules/mal/algebraExtensions.mx
monetdb5/modules/mal/attach.c
monetdb5/modules/mal/attach.h
monetdb5/modules/mal/attach.mal
monetdb5/modules/mal/attach.mx
monetdb5/modules/mal/bbp.c
monetdb5/modules/mal/bbp.h
monetdb5/modules/mal/bbp.mal
monetdb5/modules/mal/bbp.mx
monetdb5/modules/mal/box.mx
monetdb5/modules/mal/chopper.mx
monetdb5/modules/mal/clients.c
monetdb5/modules/mal/clients.h
monetdb5/modules/mal/clients.mal
monetdb5/modules/mal/clients.mx
monetdb5/modules/mal/cluster.mx
monetdb5/modules/mal/const.mx
monetdb5/modules/mal/constraints.mx
monetdb5/modules/mal/extensions.c
monetdb5/modules/mal/extensions.h
monetdb5/modules/mal/extensions.mal
monetdb5/modules/mal/extensions.mx
monetdb5/modules/mal/factories.c
monetdb5/modules/mal/factories.h
monetdb5/modules/mal/factories.mal
monetdb5/modules/mal/factories.mx
monetdb5/modules/mal/groupby.c
monetdb5/modules/mal/groupby.h
monetdb5/modules/mal/groupby.mal
monetdb5/modules/mal/groupby.mx
monetdb5/modules/mal/inspect.c
monetdb5/modules/mal/inspect.h
monetdb5/modules/mal/inspect.mal
monetdb5/modules/mal/inspect.mx
monetdb5/modules/mal/language.c
monetdb5/modules/mal/language.h
monetdb5/modules/mal/language.mal
monetdb5/modules/mal/language.mx
monetdb5/modules/mal/mal_init.mal
monetdb5/modules/mal/mal_io.h
monetdb5/modules/mal/mal_io.mal
monetdb5/modules/mal/mal_io.mx
monetdb5/modules/mal/mal_mapi.mx
monetdb5/modules/mal/mat.c
monetdb5/modules/mal/mat.h
monetdb5/modules/mal/mat.mal
monetdb5/modules/mal/mat.mx
monetdb5/modules/mal/mdb.c
monetdb5/modules/mal/mdb.h
monetdb5/modules/mal/mdb.mal
monetdb5/modules/mal/mdb.mx
monetdb5/modules/mal/mkey.c
monetdb5/modules/mal/mkey.h
monetdb5/modules/mal/mkey.mal
monetdb5/modules/mal/mkey.mx
monetdb5/modules/mal/pcre.mx
monetdb5/modules/mal/pcrelib.c
monetdb5/modules/mal/pcrelib.h
monetdb5/modules/mal/pcrelib.mal
monetdb5/modules/mal/pqueue.mx
monetdb5/modules/mal/prelude.mx
monetdb5/modules/mal/profiler.c
monetdb5/modules/mal/profiler.h
monetdb5/modules/mal/profiler.mal
monetdb5/modules/mal/profiler.mx
monetdb5/modules/mal/remote.c
monetdb5/modules/mal/remote.h
monetdb5/modules/mal/remote.mal
monetdb5/modules/mal/remote.mx
monetdb5/modules/mal/replication.c
monetdb5/modules/mal/replication.h
monetdb5/modules/mal/replication.mal
monetdb5/modules/mal/replication.mx
monetdb5/modules/mal/statistics.mx
monetdb5/modules/mal/table_sql.c
monetdb5/modules/mal/tablet.c
monetdb5/modules/mal/tablet.h
monetdb5/modules/mal/tablet.mal
monetdb5/modules/mal/tablet.mx
monetdb5/modules/mal/tablet_mk.mx
monetdb5/modules/mal/tablet_si.mx
monetdb5/modules/mal/tablet_sql.mx
monetdb5/modules/mal/tokenizer.c
monetdb5/modules/mal/tokenizer.h
monetdb5/modules/mal/tokenizer.mal
monetdb5/modules/mal/tokenizer.mx
monetdb5/modules/mal/transaction.c
monetdb5/modules/mal/transaction.h
monetdb5/modules/mal/transaction.mal
monetdb5/modules/mal/transaction.mx
monetdb5/modules/mal/urlbox.mx
monetdb5/modules/mal/zorder.c
monetdb5/modules/mal/zorder.h
monetdb5/modules/mal/zorder.mal
monetdb5/modules/mal/zorder.mx
monetdb5/optimizer/opt_prelude.c
monetdb5/optimizer/opt_prelude.h
Branch: headless
Log Message:
Module mal de-Mx-ed
Two files remain to be handled, due to multiple type variants.
mat.x and pqueue.mx
diffs (truncated from 40752 to 300 lines):
diff --git a/monetdb5/modules/kernel/array.mx b/monetdb5/modules/kernel/array.mx
--- a/monetdb5/modules/kernel/array.mx
+++ b/monetdb5/modules/kernel/array.mx
@@ -62,7 +62,23 @@
@- Implementation
-@include ../mal/prelude.mx
+The Mx macro below is used in many places throughout the code base to
+access the BAT descriptor.
+
+@= getBATdescriptor
+ if( (@3= BATdescriptor(*@2)) == NULL ){ *@1 = 0;
+ return throwMessage("@4", RUNTIME_OBJECT_MISSING);
+ }
+@= Pseudo
+ if (BBPindex("@1_@2_@3") <= 0)
+ BATname(b, "@1_@2_@3");
+ BATroles(b,"@1","@2");
+ BATmode(b,TRANSIENT);
+ BATfakeCommit(b);
+ *ret = b->batCacheid;
+ BBPkeepref(*ret);
+
+
@h
/*============================================================================*/
diff --git a/monetdb5/modules/mal/Makefile.ag b/monetdb5/modules/mal/Makefile.ag
--- a/monetdb5/modules/mal/Makefile.ag
+++ b/monetdb5/modules/mal/Makefile.ag
@@ -28,56 +28,48 @@
lib_mal = {
NOINST
SOURCES = \
- algebraExtensions.mx \
- attach.mx \
- extensions.mx \
- bbp.mx \
- chopper.mx \
- clients.mx \
- cluster.mx \
- const.mx \
- constraints.mx \
- factories.mx \
- groupby.mx \
+ attach.c \
+ extensions.c \
+ bbp.c \
+ clients.c \
+ factories.c \
+ groupby.c \
histogram.c \
- inspect.mx \
- language.mx \
- mal_io.mx \
- mal_mapi.mx \
+ inspect.c \
+ language.c \
+ mal_io.c \
manual.c \
- mat.mx \
- mdb.mx \
+ mat.c \
+ mdb.c \
mkey.mx \
- pcre.mx \
+ pcre.c \
pqueue.mx \
- profiler.mx \
+ profiler.c \
recycle.c \
- remote.mx \
- replication.mx \
+ remote.c \
+ replication.c \
sabaoth.c \
- statistics.mx \
tablet.mx \
- tablet_sql.mx \
- tokenizer.mx \
+ tablet_sql.c \
+ tokenizer.c \
trader.c \
- transaction.mx \
- urlbox.mx \
- zorder.mx
+ transaction.c \
+ zorder.c
}
headers_mal = {
HEADERS = mal
DIR = libdir/monetdb5
- SOURCES = language.mx constraints.mx mal_init.mal bbp.mx \
- profiler.mx const.mx attach.mx extensions.mx
algebraExtensions.mx \
- inspect.mx manual.mal mal_io.mx pqueue.mx mkey.mx \
- chopper.mx clients.mx \
- factories.mx groupby.mx mdb.mx pcre.mx tablet.mx mat.mx
histogram.mal \
- urlbox.mx statistics.mx transaction.mx \
- mal_mapi.mx sabaoth.mal remote.mx \
+ SOURCES = language.mal mal_init.mal bbp.mal \
+ profiler.c attach.mal extensions.mal \
+ inspect.mal manual.mal mal_io.mal pqueue.mx mkey.mx \
+ clients.mal \
+ factories.mal groupby.mal mdb.mal pcre.mal tablet.mx mat.mal
histogram.mal \
+ transaction.mal \
+ sabaoth.mal remote.c \
txtsim.mx recycle.mal \
- cluster.mx trader.mal replication.mx \
- tokenizer.mx zorder.mx
+ trader.mal replication.mal \
+ tokenizer.mal trader.mal zorder.mal
}
EXTRA_DIST = prelude.mx histogram.mal histogram.h mal_init.mal manual.mal
manual.h recycle.mal recycle.h sabaoth.mal sabaoth.h trader.mal trader.h
diff --git a/monetdb5/modules/mal/algebraExtensions.mx
b/monetdb5/modules/mal/algebraExtensions.mx
deleted file mode 100644
--- a/monetdb5/modules/mal/algebraExtensions.mx
+++ /dev/null
@@ -1,104 +0,0 @@
-@/
-The contents of this file are subject to the MonetDB Public License
-Version 1.1 (the "License"); you may not use this file except in
-compliance with the License. You may obtain a copy of the License at
-http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
-
-Software distributed under the License is distributed on an "AS IS"
-basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-License for the specific language governing rights and limitations
-under the License.
-
-The Original Code is the MonetDB Database System.
-
-The Initial Developer of the Original Code is CWI.
-Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-Copyright August 2008-2011 MonetDB B.V.
-All Rights Reserved.
-@
-
-@f algebraExtensions
-@v 2.0
-@a M.L.Kersten, P. Boncz
-@+ Algebra Extensions
-The algebra extensions rely
-on the MAL runtime setting, but logically belong to the kernel/algebra
-module.
-@mal
-
-pattern algebra.project( b:col[:any_1], val:any_2) :col[:any_2]
-address ALGprojectCst
-comment "Fill the tail column with a newly typed constant.";
-pattern algebra.project(b:col[:any_1], val:col[:any_2]) :col[:any_2]
-address ALGprojectCst
-comment "Fill the tail column with a constant taken from the aligned BAT.";
-
-@{
-@include prelude.mx
-@+ Implementation section
-In most cases we pass a BAT identifier, which should be unified
-with a BAT descriptor. Upon failure we can simply abort the function.
-
-@h
-#ifndef _ALGEBRA_EXTENSIONS_H
-#define _ALGEBRA_EXTENSIONS_H
-#include "mal_box.h"
-#include "mal_client.h"
-#include "mal_interpreter.h"
-#include "column.h"
-#include "algebra.h"
-
-#ifdef WIN32
-#if !defined(LIBMAL) && !defined(LIBATOMS) && !defined(LIBKERNEL) &&
!defined(LIBMAL) && !defined(LIBOPTIMIZER) && !defined(LIBSCHEDULER) &&
!defined(LIBMONETDB5)
-#define ae_export extern __declspec(dllimport)
-#else
-#define ae_export extern __declspec(dllexport)
-#endif
-#else
-#define ae_export extern
-#endif
-
-ae_export str ALGprojectCst(Client cntxt,MalBlkPtr mb, MalStkPtr stk, InstrPtr
pci);
-ae_export str ALGprojectCstBody(bat *result, int *bid, ptr *p, int tt);
-#endif /* _ALGEBRA_EXTENSIONS_H*/
-
-@c
-#include "monetdb_config.h"
-#include "algebraExtensions.h"
-
-str
-ALGprojectCstBody(bat *result, int *bid, ptr *p, int tt){
- BAT *b, *bn;
-
- if ((b = BATdescriptor(*bid)) == NULL) {
- throw(MAL, "bbp.project", INTERNAL_BAT_ACCESS);
- }
-
- if (ATOMvarsized(tt)) {
- if (p == 0 || *(str *) p == 0)
- p = (ptr *) str_nil;
- else
- p = *(ptr **) p;
- }
- bn = BATconst(b, tt, p);
- BBPunfix(b->batCacheid);
- if (bn) {
- *result = bn->batCacheid;
- BBPkeepref(bn->batCacheid);
- return MAL_SUCCEED;
- }
- throw(MAL, "bbp.project", INTERNAL_OBJ_CREATE);
-}
-
-str
-ALGprojectCst(Client cntxt,MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
-{
- int *result = (int *) getArgReference(stk, pci, 0);
- int *bid = (int *) getArgReference(stk, pci, 1);
- ptr *p = (ptr *) getArgReference(stk, pci, 2);
- int tt = getArgType(mb, pci, 2);
-
- (void) cntxt;
- return ALGprojectCstBody(result, bid, p, tt);
-}
-@}
diff --git a/monetdb5/modules/mal/attach.c b/monetdb5/modules/mal/attach.c
new file mode 100644
--- /dev/null
+++ b/monetdb5/modules/mal/attach.c
@@ -0,0 +1,105 @@
+/*
+ * The contents of this file are subject to the MonetDB Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
+ *
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * The Original Code is the MonetDB Database System.
+ *
+ * The Initial Developer of the Original Code is CWI.
+ * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
+ * Copyright August 2008-2011 MonetDB B.V.
+ * All Rights Reserved.
+*/
+
+/* Author(s) Martin Kersten
+ * Attach
+ * The attach module provides a mechanism to easily share a (readonly)
+ * BATs between two mservers.
+ *
+ * The module is intended to support cheap attachment of BATs identified
+ * using several protocols, but for the moment we assume a single Linux
+ * cluster with NSF.
+ * In this context the bind() creates a symbolic link.
+ *
+ * Beware that the argument to the patterns is the full path to
+ * the base of the BAT. Depending on their type we need to
+ * establish attachment to head,tail, hheap and theap.
+ * The count argument is needed, because it can not be derived from the
+ * file structure itself.
+*/
+
+#include "monetdb_config.h"
+#include "attach.h"
+
+str
+ATTbind(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
+{
+#ifdef WIN32
+ (void) cntxt;
+ (void) mb;
+ (void) stk;
+ (void) pci;
+ throw(MAL, "attach.bind", "Not available on Windows");
+#else
+ int *ret = (int*) getArgReference(stk, pci, 0);
+ str fnme = *(str*) getArgReference(stk, pci, 1);
+ int bid;
+
+ (void) cntxt;
+ (void) mb;
+ bid = BBPimportEntry(fnme);
+ if (bid ){
+ BBPkeepref(*ret= bid);
+ return MAL_SUCCEED;
+ }
+ throw(MAL, "attach.bind", INTERNAL_BAT_ACCESS);
+#endif
+}
+
+str
+ATTbindPartition(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
+{
+ int *ret,bid;
+ BAT *b, *view;
+ str msg= MAL_SUCCEED;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list