Update of /cvsroot/monetdb/sql/src/storage/bpm
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26843/src/storage/bpm

Modified Files:
        Makefile.ag bpm_distribution.mx bpm_storage.mx bpm_table.mx 
Log Message:
redid most of the bpm storage layer as it needed to be split in snapshot, log
and rollforward


U bpm_storage.mx
Index: bpm_storage.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bpm/bpm_storage.mx,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- bpm_storage.mx      31 Jul 2008 15:31:29 -0000      1.15
+++ bpm_storage.mx      22 Aug 2008 09:50:31 -0000      1.16
@@ -21,69 +21,46 @@
 #define BPMSTORAGE_H
 
 #include "sql_storage.h"
-#include "bpm_logger.h"
-#include "bpm_distribution.h"
+#include "bat/bat_utils.h"
+#include "bat/bat_logger.h"
+#include "bat/bat_storage.h"
 
-#define BPM_SPLIT      1024
[...1899 lines suppressed...]
        sf->destroy_del = (destroy_del_fptr)&destroy_del;
 
-       sf->log_destroy_col = (destroy_col_fptr)&bpm_none;
-       sf->log_destroy_idx = (destroy_idx_fptr)&bpm_none;
-       sf->log_destroy_del = (destroy_del_fptr)&bpm_none;
+       sf->log_destroy_col = (destroy_col_fptr)&log_destroy_col;
+       sf->log_destroy_idx = (destroy_idx_fptr)&log_destroy_idx;
+       sf->log_destroy_del = (destroy_del_fptr)&log_destroy_del;
 
        sf->clear_col = (clear_col_fptr)&clear_col;
        sf->clear_idx = (clear_idx_fptr)&clear_idx;
        sf->clear_del = (clear_del_fptr)&clear_del;
 
-       sf->update_table = (update_table_fptr)&update_table;
-       sf->log_table = (update_table_fptr)&bpm_none;
+       sf->update_table = (update_table_fptr)&bpm_update_table;
+       sf->log_table = (update_table_fptr)&bpm_log_table;
        sf->snapshot_table = (update_table_fptr)&bpm_none;
 
        MT_lock_init(&part_lock, "SQL_part_lock");

U Makefile.ag
Index: Makefile.ag
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bpm/Makefile.ag,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Makefile.ag 19 Jan 2008 17:11:47 -0000      1.3
+++ Makefile.ag 22 Aug 2008 09:50:31 -0000      1.4
@@ -22,5 +22,5 @@
        NOINST
        DIR = libdir
        SOURCES = \
-               bpm_table.mx bpm_storage.mx bpm_logger.mx bpm_distribution.mx
+               bpm_table.mx bpm_storage.mx bpm_distribution.mx
 }

U bpm_distribution.mx
Index: bpm_distribution.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bpm/bpm_distribution.mx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- bpm_distribution.mx 22 Jul 2008 09:35:51 -0000      1.3
+++ bpm_distribution.mx 22 Aug 2008 09:50:31 -0000      1.4
@@ -44,7 +44,7 @@
 @c
 #include "sql_config.h"
 #include "bpm_distribution.h"
-#include "bpm_logger.h"
+#include "bat/bat_logger.h"
 #include "bat/bat_utils.h"
 #include <sql_string.h>
 
@@ -199,9 +199,9 @@
 {
        int p;
 
-        if (!dist_id && (p = logger_find_bat(bpm_logger, "dist_id"))) {
+        if (!dist_id && (p = logger_find_bat(bat_logger, "dist_id"))) {
                 #define get_bat(nme) \
-                        temp_descriptor(logger_find_bat(bpm_logger, nme))
+                        temp_descriptor(logger_find_bat(bat_logger, nme))
                 dist_id = temp_descriptor(p);
                 dist_host = get_bat("dist_host");
                 dist_port = get_bat("dist_port");
@@ -219,12 +219,12 @@
                dist_passwd = bat_new(TYPE_oid, TYPE_str, 0);
 
 #define log_P(l, b, n) logger_add_bat(l, b, n); log_bat_persists(l, b, n)
-                log_P(bpm_logger, dist_id, "dist_id");
-                log_P(bpm_logger, dist_host, "dist_host");
-                log_P(bpm_logger, dist_port, "dist_port");
-                log_P(bpm_logger, dist_dbname, "dist_dbname");
-                log_P(bpm_logger, dist_user, "dist_user");
-                log_P(bpm_logger, dist_passwd, "dist_passwd");
+                log_P(bat_logger, dist_id, "dist_id");
+                log_P(bat_logger, dist_host, "dist_host");
+                log_P(bat_logger, dist_port, "dist_port");
+                log_P(bat_logger, dist_dbname, "dist_dbname");
+                log_P(bat_logger, dist_user, "dist_user");
+                log_P(bat_logger, dist_passwd, "dist_passwd");
         }
 }
 

U bpm_table.mx
Index: bpm_table.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/storage/bpm/bpm_table.mx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- bpm_table.mx        16 Jan 2008 08:51:15 -0000      1.5
+++ bpm_table.mx        22 Aug 2008 09:50:31 -0000      1.6
@@ -46,59 +46,15 @@
 @c
 #include "sql_config.h"
 #include "bpm_table.h"
+#include "bat/bat_table.h"
 #include "bpm_storage.h"
-#include "bat/bat_utils.h"
 
 static BAT *
 full_column(sql_column *c, BAT *d, BAT *s )
 {
        sql_bpm *p = c->data;
-       /* return full normalized column bat
 
-               if (s) {
-                       b := b.semijoin(s);
-                       i := i.semijoin(s);
-                       u := u.semijoin(s);
-               }
-               b := b.kunion(i);
-               b := b.kdiff(u);
-               b := b.kunion(u);
-               b := b.kdiff(reverse(d));
-       */
-       BAT *r, *b, *u, *i = temp_descriptor(p->parts[p->ins].bid);
-
-       if (p->ins==0) {
-               r = i; 
-               if (s) {
-                       r = BATsemijoin(i,s);
-                       bat_destroy(i);
-               }
-               return r;
-       }
-       b = temp_descriptor(p->parts[0].bid);
-       u = temp_descriptor(p->parts[0].ubid);
-       if (s) {
-               BAT *t;
-
-               t = BATsemijoin(b,s); bat_destroy(b); b = t;
-               t = BATsemijoin(i,s); bat_destroy(i); i = t;
-               t = BATsemijoin(u,s); bat_destroy(u); u = t;
-       }
-       assert(b->ttype == i->ttype);
-       if (BATcount(i)) {
-               r = BATkunion(b,i); bat_destroy(b); b = r;
-       }
-       bat_destroy(i); 
-       if (BATcount(u)) {
-               r = BATkdiff(b,u); bat_destroy(b); b = r;
-               assert(b->ttype == u->ttype);
-               r = BATkunion(b,u); bat_destroy(b); b = r;
-       }
-       bat_destroy(u); 
-       if (d && BATcount(d)) {
-               r = BATkdiff(b,BATmirror(d)); bat_destroy(b); b = r;
-       }
-       return b;
+       return delta_full_bat( &p->parts[0], isTemp(c), d, s);
 }
 
 static ssize_t
@@ -197,7 +153,6 @@
                store_funcs.append_col(tr, c, val, c->type.type->localtype);
                cnt++;
        }
-       t->cnt ++;
        if (n) {
                fprintf(stderr, "called table_insert(%s) with wrong number of 
args (%d,%d)\n", t->base.name, list_length(t->columns.set), cnt);
                assert(0);


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to