Changeset: 0963829226e4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0963829226e4
Modified Files:
        clients/Tests/exports.stable.out
        gdk/gdk.h
        gdk/gdk_delta.c
        gdk/gdk_storage.c
Branch: default
Log Message:

Removed function BATundo and the batDirtyflushed field in the BAT descriptor.


diffs (142 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -201,7 +201,6 @@ gdk_return BATsum(void *res, int tp, BAT
 gdk_return BATthetajoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT 
*sr, int op, bool nil_matches, BUN estimate) 
__attribute__((__warn_unused_result__));
 BAT *BATthetaselect(BAT *b, BAT *s, const void *val, const char *op);
 void BATtseqbase(BAT *b, oid o);
-void BATundo(BAT *b);
 BAT *BATunique(BAT *b, BAT *s);
 BAT *BATunmask(BAT *b);
 gdk_return BATupdate(BAT *b, BAT *p, BAT *n, bool force) 
__attribute__((__warn_unused_result__));
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -794,8 +794,6 @@ typedef struct BAT {
        bool
         batTransient:1,        /* should the BAT persist on disk? */
         batCopiedtodisk:1;     /* once written */
-       /* not part of bitfields since not in BATiter */
-       bool batDirtyflushed;   /* was dirty before commit started? */
        uint16_t selcnt;        /* how often used in equi select without hash */
        uint16_t unused;        /* value=0 for now (sneakily used by mat.c) */
        int batSharecnt;        /* incoming view count */
@@ -2076,16 +2074,14 @@ gdk_export gdk_return TMsubcommit_list(b
  * @tab BATcommit (BAT *b)
  * @item BAT *
  * @tab BATfakeCommit (BAT *b)
- * @item BAT *
- * @tab BATundo (BAT *b)
  * @end multitable
  *
  * The BAT keeps track of updates with respect to a 'previous state'.
- * Do not confuse 'previous state' with 'stable' or
- * 'commited-on-disk', because these concepts are not always the
- * same. In particular, they diverge when BATcommit, BATfakecommit,
- * and BATundo are called explictly, bypassing the normal global
- * TMcommit protocol (some applications need that flexibility).
+ * Do not confuse 'previous state' with 'stable' or 'commited-on-disk',
+ * because these concepts are not always the same. In particular, they
+ * diverge when BATcommit and BATfakecommit are called explicitly,
+ * bypassing the normal global TMcommit protocol (some applications need
+ * that flexibility).
  *
  * BATcommit make the current BAT state the new 'stable state'.  This
  * happens inside the global TMcommit on all persistent BATs previous
@@ -2101,7 +2097,6 @@ gdk_export gdk_return TMsubcommit_list(b
  */
 gdk_export void BATcommit(BAT *b, BUN size);
 gdk_export void BATfakeCommit(BAT *b);
-gdk_export void BATundo(BAT *b);
 
 /*
  * @+ BAT Alignment and BAT views
diff --git a/gdk/gdk_delta.c b/gdk/gdk_delta.c
--- a/gdk/gdk_delta.c
+++ b/gdk/gdk_delta.c
@@ -39,9 +39,6 @@ BATcommit(BAT *b, BUN size)
        assert(size <= BATcount(b) || size == BUN_NONE);
        TRC_DEBUG(DELTA, "BATcommit1 %s free %zu ins " BUNFMT " base %p\n",
                  BATgetId(b), b->theap->free, b->batInserted, b->theap->base);
-       if (!BATdirty(b)) {
-               b->batDirtyflushed = false;
-       }
        b->batInserted = size < BATcount(b) ? size : BATcount(b);
        TRC_DEBUG(DELTA, "BATcommit2 %s free %zu ins " BUNFMT " base %p\n",
                  BATgetId(b), b->theap->free, b->batInserted, b->theap->base);
@@ -61,50 +58,3 @@ BATfakeCommit(BAT *b)
                        b->tvheap->dirty = false;
        }
 }
-
-/*
- * The routine @%BATundo@ restores the BAT to the previous commit
- * point.  The inserted elements are removed from the accelerators,
- * deleted from the heap. The guarded elements from uncommitted
- * deletes are inserted into the accelerators.
- */
-void
-BATundo(BAT *b)
-{
-       BUN p, bunlast, bunfirst;
-
-       if (b == NULL)
-               return;
-       MT_lock_set(&b->theaplock);
-       BATiter bi = bat_iterator_nolock(b);
-       assert(b->theap->parentid == b->batCacheid);
-       TRC_DEBUG(DELTA, "BATundo: %s \n", BATgetId(b));
-       if (b->batDirtyflushed) {
-               b->theap->dirty = true;
-       } else {
-               b->theap->dirty = false;
-               if (b->tvheap)
-                       b->tvheap->dirty = false;
-       }
-       bunfirst = b->batInserted;
-       bunlast = BATcount(b) - 1;
-       if (bunlast >= b->batInserted) {
-               BUN i = bunfirst;
-               gdk_return (*tunfix) (const void *) = 
BATatoms[b->ttype].atomUnfix;
-               void (*tatmdel) (Heap *, var_t *) = BATatoms[b->ttype].atomDel;
-
-               HASHdestroy(b);
-               if (tunfix || tatmdel) {
-                       for (p = bunfirst; p <= bunlast; p++, i++) {
-                               if (tunfix)
-                                       (void) (*tunfix) (BUNtail(bi, p));
-                               if (tatmdel)
-                                       (*tatmdel) (b->tvheap, (var_t *) 
BUNtloc(bi, p));
-                       }
-               }
-       }
-       b->theap->free = tailsize(b, b->batInserted);
-
-       BATsetcount(b, b->batInserted);
-       MT_lock_unset(&b->theaplock);
-}
diff --git a/gdk/gdk_storage.c b/gdk/gdk_storage.c
--- a/gdk/gdk_storage.c
+++ b/gdk/gdk_storage.c
@@ -628,7 +628,6 @@ GDKload(int farmid, const char *nme, con
 static void
 DESCclean(BAT *b)
 {
-       b->batDirtyflushed = DELTAdirty(b);
        b->theap->dirty = false;
        if (b->tvheap)
                b->tvheap->dirty = false;
@@ -761,13 +760,11 @@ BATsave_locked(BAT *b, BATiter *bi, BUN 
                if (size != b->batCount || b->batInserted < b->batCount) {
                        /* if the sizes don't match, the BAT must be dirty */
                        b->batCopiedtodisk = false;
-                       b->batDirtyflushed = true;
                        b->theap->dirty = true;
                        if (b->tvheap)
                                b->tvheap->dirty = true;
                } else {
                        b->batCopiedtodisk = true;
-                       b->batDirtyflushed = DELTAdirty(b);
                }
                MT_lock_unset(&b->theaplock);
                if (b->thash && b->thash != (Hash *) 1)
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to