Changeset: 530675d42876 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=530675d42876
Modified Files:
        monetdb5/mal/mal.h
        monetdb5/modules/kernel/alarm.mx
        monetdb5/modules/mal/bbp.c
        monetdb5/modules/mal/bbp.h
        monetdb5/modules/mal/bbp.mal
        monetdb5/modules/mal/cbp.c
        monetdb5/modules/mal/cbp.h
        monetdb5/modules/mal/cbp.mal
        monetdb5/modules/mal/mal_init.mal
Branch: headless
Log Message:

Minor changes
Rename BBP to CBP and some preliminary steps
just to allow for sync with GDK compiled version.


diffs (truncated from 781 to 300 lines):

diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h
--- a/monetdb5/mal/mal.h
+++ b/monetdb5/mal/mal.h
@@ -127,4 +127,8 @@
        int RPreset0;     /* Number of instructions evicted from RP by reset() 
due to updates*/
 } *RecPtr, RecStat;
 
+
+/* Conversion macros to prepare for the Column Switch */
+#define COL BAT
+#define COLnew(A,S)    BATnew(TYPE_void,A,S)
 #endif /*  _MAL_H*/
diff --git a/monetdb5/modules/kernel/alarm.mx b/monetdb5/modules/kernel/alarm.mx
--- a/monetdb5/modules/kernel/alarm.mx
+++ b/monetdb5/modules/kernel/alarm.mx
@@ -1,91 +1,27 @@
-@/
-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
+/*
+ * 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.
+*/
 
-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 alarm
-@a M.L. Kersten, P. Boncz
-
-@+ Timers and Timed Interrupts
-This module handles various signaling/timer functionalities.
-The Monet interface supports two timer commands: @emph{ alarm} and @emph{ 
sleep}.
-Their argument is the number of seconds to wait before the timer goes off.
-The @emph{ sleep} command blocks till the alarm goes off.
-The @emph{ alarm} command continues directly, executes off a MIL
-string when it goes off.
-The parameterless routines @emph{ time} and @emph{ ctime} provide access to
-the cpu clock.They return an integer and string, respectively.
-@{
-@mal
-module alarm;
-
-command sleep(secs:int):void 
-address ALARMsleep 
-comment "sleep X secs";
-command alarm(secs:int, action:str):void 
-address ALARMsetalarm 
-comment "execute action in X secs";
-command timers{unsafe}() (:col[:str],:col[:str])
-address ALARMtimers
-comment "give a list of all active timers";
-command usec{unsafe}() :lng 
-address ALARMusec
-comment "return cpu microseconds info";
-command time{unsafe}() :int 
-address ALARMtime 
-comment "time in millisecs";
-command epoch{unsafe}() :int 
-address ALARMepoch 
-comment "current time as unix epoch";
-command ctime{unsafe}() :str 
-address ALARMctime 
-comment "current time as a string";
-command prelude():void
-address ALARMprelude 
-comment "Initialize alarm module";
-command epilogue():void
-address ALARMepilogue 
-comment "Finalize alarm module";
-
-alarm.prelude();
-
-@* Implementation
-@+ The Clock Interrupt Generator
-A clock event generator, called @%timer@, has been added to the database 
kernel.
-It accepts a message @%CLKalarm(sec, usec)@, which generates an alarm
-after the time indicated.
-The timer maintains a small stack of timing events sorted in priority of 
firing.
-The top contains the next timer event to go off.
-The timer is disabled when no timer events are outstanding.
 @h
+#ifndef _GDK_ALARM_
+#define _GDK_ALARM_
 #include <mal.h>
 #include <signal.h>
-#define MAXtimer                200
-
-typedef struct {
-       str action;             /* MIL action (as a string) */
-       MT_Sema sema;           /* barrier */
-       time_t alarm_time;      /* time when the alarm goes off */
-} monet_timer_t;
-
-@c
-#include "monetdb_config.h"
-#include "alarm.h"
-#include <time.h>
 
 #ifdef WIN32
 #if !defined(LIBMAL) && !defined(LIBATOMS) && !defined(LIBKERNEL) && 
!defined(LIBMAL) && !defined(LIBOPTIMIZER) && !defined(LIBSCHEDULER) && 
!defined(LIBMONETDB5)
@@ -107,15 +43,48 @@
 alarm_export str ALARMepoch(int *res);
 alarm_export str ALARMtime(int *res);
 
-static monet_timer_t timer[MAXtimer];
+#endif
+@c
+/* Author(s) M.L. Kersten, P. Boncz
+ * Timers and Timed Interrupts
+ * This module handles various signaling/timer functionalities.
+ * The MonetDB interface supports two timer commands: @emph{ alarm} and @emph{ 
sleep}.
+ * Their argument is the number of seconds to wait before the timer goes off.
+ * The @emph{ sleep} command blocks till the alarm goes off.
+ * The @emph{ alarm} command continues directly, executes off a MIL
+ * string when it goes off.
+ * The parameterless routines @emph{ time} and @emph{ ctime} provide access to
+ * the cpu clock.They return an integer and string, respectively.
+ * 
+ * The Clock Interrupt Generator
+ * A clock event generator, called @%timer@, has been added to the database 
kernel.
+ * It accepts a message @%CLKalarm(sec, usec)@, which generates an alarm
+ * after the time indicated.
+ * The timer maintains a small stack of timing events sorted in priority of 
firing.
+ * The top contains the next timer event to go off.
+ * The timer is disabled when no timer events are outstanding.
+*/
+#include "monetdb_config.h"
+#include "alarm.h"
+#include <time.h>
+
+#define MAXtimer                200
+
+typedef struct {
+       str action;             /* MIL action (as a string) */
+       MT_Sema sema;           /* barrier */
+       time_t alarm_time;      /* time when the alarm goes off */
+} monetdb_timer_t;
+
+static monetdb_timer_t timer[MAXtimer];
 static int timerTop = 0;
 
-@
-@-
-The timer is awakened by a clock interrupt. The interrupt granularity
-is OS-dependent. The timer should be initialized as long as there
-are outstanding timer events.
-@c
+/*
+ * The timer is awakened by a clock interrupt. The interrupt granularity
+ * is OS-dependent. The timer should be initialized as long as there
+ * are outstanding timer events.
+*/
+
 #ifdef SIGALRM
 static void
 CLKinitTimer(int sec, int usec)
@@ -127,10 +96,10 @@
        alarm(i);
 }
 #endif
-@-
-A new alarm is pushed onto the stack using @%CLKalarm@.
-The parameter is the real-time value to be approximated.
-@c
+/*
+ * A new alarm is pushed onto the stack using CLKalarm().
+ * The parameter is the real-time value to be approximated.
+*/
 #ifdef SIGALRM
 static void
 CLKalarm(time_t t, str action)
@@ -162,10 +131,10 @@
        }
 }
 #endif
-@-
-Once a timer interrupt occurs, we should inspect the timer queue and
-emit a notify signal.
-@c
+/*
+ * Once a timer interrupt occurs, we should inspect the timer queue and
+ * emit a notify signal.
+*/
 #ifdef SIGALRM
 /* HACK to pacify compiler */
 #if (defined(__INTEL_COMPILER) && (SIZEOF_VOID_P > SIZEOF_INT))
@@ -204,13 +173,12 @@
 }
 #endif
 
-bat *
+void
 CLKprelude(void)
 {
 #ifdef SIGALRM
        (void) signal(SIGALRM, CLKsignal);
 #endif
-       return NULL;
 }
 
 void
diff --git a/monetdb5/modules/mal/bbp.c b/monetdb5/modules/mal/cbp.c
rename from monetdb5/modules/mal/bbp.c
rename to monetdb5/modules/mal/cbp.c
--- a/monetdb5/modules/mal/bbp.c
+++ b/monetdb5/modules/mal/cbp.c
@@ -18,15 +18,14 @@
 */
 
 /* Author(s) M.L.Kersten
- * The BBP module implements an interface over the BAT buffer pool 
functionality.
- * It is primarilly meant to ease inspection of the BAT collection managed
- * by the server.
+ * The CBP module implements an interface over the column buffer pool 
functionality.
+ * It is primarilly meant to ease inspection of the column collection managed 
by the server.
 */
 #include "monetdb_config.h"
 #include "bbp.h"
 
 /*
- * Compression and decompression are handled explicity. A compressed BAT is
+ * Compression and decompression are handled explicity. A compressed column is
  * recognized by its file extension on the heap name.
  * Compression of heaps can be useful to reduce the diskspace and as 
preparation
  * for shipping data around. We keep the truncated file around for consistency
@@ -122,7 +121,7 @@
 }
 
 str
-CMDbbpcompress(int *ret, int *bid, str *fnme)
+CBPcompress(int *ret, int *bid, str *fnme)
 {
        BAT *b;
        str msg;
@@ -144,8 +143,9 @@
        BBPkeepref(*ret = b->batCacheid);
        return MAL_SUCCEED;
 }
+
 str
-CMDbbpdecompress(int *ret, int *bid, str *fnme)
+CBPdecompress(int *ret, int *bid, str *fnme)
 {
        BAT *b, *bn;
        int decomp=0;
@@ -154,8 +154,7 @@
        if (b == 0)
                throw(MAL, "bbp.decompress", INTERNAL_BAT_ACCESS);
        if (BATcount(b) ){
-
-               bn = BATnew(b->htype,b->ttype,0);
+               bn = BATnew(TYPE_void,b->ttype,0);
                /* copy the properties of the source */
                bn->hsorted = b->hsorted;
                bn->tsorted = b->tsorted;
@@ -174,10 +173,6 @@
                bn->T->width = b->T->width;
                bn->T->shift = b->T->shift;
 
-               if (b->H->type)
-                       decomp += 
CMDdecompressheap(&b->H->heap,&bn->H->heap,*fnme);
-               if (b->H->type)
-                       decomp += 
CMDdecompressheap(b->H->vheap,bn->H->vheap,*fnme);
                if (b->T->type)
                        decomp += 
CMDdecompressheap(&b->T->heap,&bn->T->heap,*fnme);
                if (b->T->type)
@@ -205,7 +200,7 @@
 }
 
 str
-CMDbbptruncate(int *ret, int *bid, str *fnme)
+CBPtruncate(int *ret, int *bid, str *fnme)
 {
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to