Changeset: 6663ca13e289 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6663ca13e289
Modified Files:
        gdk/gdk_bbp.c
        gdk/gdk_hash.c
        gdk/gdk_join.c
        gdk/gdk_orderidx.c
        gdk/gdk_private.h
Branch: default
Log Message:

Cleanup
- remove hash upgrade code keeping some old hashes;
- remove compile-time option to not persist indexes.


diffs (229 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -310,14 +310,6 @@ BBPselectfarm(role_t role, int type, enu
        if (GDKinmemory(0))
                return 0;
 
-#ifndef PERSISTENTHASH
-       if (hptype == hashheap)
-               role = TRANSIENT;
-#endif
-#ifndef PERSISTENTIDX
-       if (hptype == orderidxheap)
-               role = TRANSIENT;
-#endif
        for (i = 0; i < MAXFARMS; i++)
                if (BBPfarms[i].roles & (1U << (int) role))
                        return i;
@@ -4622,14 +4614,10 @@ BBPdiskscan(const char *parent, size_t b
                                delete = (b == NULL || !b->tvheap || 
!b->batCopiedtodisk || b->tvheap->free == 0);
                        } else if (strncmp(p + 1, "thashl", 6) == 0 ||
                                   strncmp(p + 1, "thashb", 6) == 0) {
-#ifdef PERSISTENTHASH
                                BAT *b = getdesc(bid);
                                delete = b == NULL;
                                if (!delete)
                                        b->thash = (Hash *) 1;
-#else
-                               delete = true;
-#endif
                        } else if (strncmp(p + 1, "thash", 5) == 0) {
                                /* older versions used .thash which we
                                 * can simply ignore */
@@ -4644,14 +4632,10 @@ BBPdiskscan(const char *parent, size_t b
                                if (!delete)
                                        b->timprints = (Imprints *) 1;
                        } else if (strncmp(p + 1, "torderidx", 9) == 0) {
-#ifdef PERSISTENTIDX
                                BAT *b = getdesc(bid);
                                delete = b == NULL;
                                if (!delete)
                                        b->torderidx = (Heap *) 1;
-#else
-                               delete = true;
-#endif
                        } else if (strncmp(p + 1, "tstrimps", 8) == 0) {
                                BAT *b = getdesc(bid);
                                delete = b == NULL;
diff --git a/gdk/gdk_hash.c b/gdk/gdk_hash.c
--- a/gdk/gdk_hash.c
+++ b/gdk/gdk_hash.c
@@ -81,13 +81,6 @@ HASHclear(Hash *h)
 }
 
 #define HASH_VERSION           6
-/* this is only for the change of hash function of the floating point
- * types, the UUID type and the MBR type; if HASH_VERSION is increased
- * again from 6, the code associated with HASH_VERSION_NOUUID and
- * HASH_VERSION_NOMBR must be deleted */
-#define HASH_VERSION_FLOAT     5
-#define HASH_VERSION_NOMBR     4
-#define HASH_VERSION_NOUUID    3
 #define HASH_HEADER_SIZE       7       /* nr of size_t fields in header */
 
 void
@@ -477,45 +470,7 @@ BATcheckhash(BAT *b)
                                        struct stat st;
 
                                        if (read(fd, hdata, sizeof(hdata)) == 
sizeof(hdata) &&
-                                           (hdata[0] == (
-#ifdef PERSISTENTHASH
-                                                   ((size_t) 1 << 24) |
-#endif
-                                                   HASH_VERSION)
-#ifdef HASH_VERSION_NOUUID
-                                            /* if not uuid, also allow 
previous version */
-                                            || (hdata[0] == (
-#ifdef PERSISTENTHASH
-                                                        ((size_t) 1 << 24) |
-#endif
-                                                        HASH_VERSION_NOUUID) &&
-                                                strcmp(ATOMname(b->ttype), 
"flt") != 0 &&
-                                                strcmp(ATOMname(b->ttype), 
"dbl") != 0 &&
-                                                strcmp(ATOMname(b->ttype), 
"uuid") != 0 &&
-                                                strcmp(ATOMname(b->ttype), 
"mbr") != 0)
-#endif
-#ifdef HASH_VERSION_NOMBR
-                                            /* if not uuid, also allow 
previous version */
-                                            || (hdata[0] == (
-#ifdef PERSISTENTHASH
-                                                        ((size_t) 1 << 24) |
-#endif
-                                                        HASH_VERSION_NOMBR) &&
-                                                strcmp(ATOMname(b->ttype), 
"flt") != 0 &&
-                                                strcmp(ATOMname(b->ttype), 
"dbl") != 0 &&
-                                                strcmp(ATOMname(b->ttype), 
"mbr") != 0)
-#endif
-#ifdef HASH_VERSION_FLOAT
-                                            /* if not floating point, also 
allow previous version */
-                                            || (hdata[0] == (
-#ifdef PERSISTENTHASH
-                                                        ((size_t) 1 << 24) |
-#endif
-                                                        HASH_VERSION_FLOAT) &&
-                                                strcmp(ATOMname(b->ttype), 
"flt") != 0 &&
-                                                strcmp(ATOMname(b->ttype), 
"dbl") != 0)
-#endif
-                                                   ) &&
+                                           (hdata[0] == (((size_t) 1 << 24) | 
HASH_VERSION)) &&
                                            hdata[1] > 0 &&
                                            (
 #ifdef BUN2
@@ -616,11 +571,6 @@ BAThashsave_intern(BAT *b, bool dosync)
        TRC_DEBUG_IF(ACCELERATOR) t0 = GDKusec();
 
        if ((h = b->thash) != NULL) {
-#ifndef PERSISTENTHASH
-               /* no need to sync if not persistent */
-               dosync = false;
-#endif
-
                /* only persist if parent BAT hasn't changed in the
                 * mean time */
                if (!b->theap->dirty &&
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -3642,16 +3642,12 @@ joincost(BAT *r, BUN lcount, struct cand
                        /* we have an estimate of the number of unique
                         * values, assume some collisions */
                        rcost *= 1.1 * ((double) cnt / unique_est);
-#ifdef PERSISTENTHASH
                        /* only count the cost of creating the hash for
                         * non-persistent bats */
                        MT_lock_set(&r->theaplock);
                        if (r->batRole != PERSISTENT /* || r->theap->dirty */ 
|| GDKinmemory(r->theap->farmid))
                                rcost += cnt * 2.0;
                        MT_lock_unset(&r->theaplock);
-#else
-                       rcost += cnt * 2.0;
-#endif
                }
        }
        if (cand) {
diff --git a/gdk/gdk_orderidx.c b/gdk/gdk_orderidx.c
--- a/gdk/gdk_orderidx.c
+++ b/gdk/gdk_orderidx.c
@@ -16,7 +16,6 @@
 
 #define ORDERIDX_VERSION       ((oid) 3)
 
-#ifdef PERSISTENTIDX
 static void
 BATidxsync(void *arg)
 {
@@ -68,7 +67,6 @@ BATidxsync(void *arg)
        MT_lock_unset(&b->batIdxLock);
        BBPunfix(b->batCacheid);
 }
-#endif
 
 /* return TRUE if we have a orderidx on the tail, even if we need to read
  * one from disk */
@@ -101,11 +99,7 @@ BATcheckorderidx(BAT *b)
                                oid hdata[ORDERIDXOFF];
 
                                if (read(fd, hdata, sizeof(hdata)) == 
sizeof(hdata) &&
-                                   hdata[0] == (
-#ifdef PERSISTENTIDX
-                                           ((oid) 1 << 24) |
-#endif
-                                           ORDERIDX_VERSION) &&
+                                   hdata[0] == (((oid) 1 << 24) | 
ORDERIDX_VERSION) &&
                                    hdata[1] == (oid) BATcount(b) &&
                                    (hdata[2] == 0 || hdata[2] == 1) &&
                                    fstat(fd, &st) == 0 &&
@@ -171,7 +165,6 @@ createOIDXheap(BAT *b, bool stable)
 void
 persistOIDX(BAT *b)
 {
-#ifdef PERSISTENTIDX
        if ((BBP_status(b->batCacheid) & BBPEXISTING) &&
            b->batInserted == b->batCount &&
            !b->theap->dirty &&
@@ -185,9 +178,6 @@ persistOIDX(BAT *b)
                        BBPunfix(b->batCacheid);
        } else
                TRC_DEBUG(ACCELERATOR, "persistOIDX(" ALGOBATFMT "): NOT 
persisting order index\n", ALGOBATPAR(b));
-#else
-       (void) b;
-#endif
 }
 
 gdk_return
@@ -503,7 +493,6 @@ GDKmergeidx(BAT *b, BAT**a, int n_ar)
        }
 
        b->torderidx = m;
-#ifdef PERSISTENTIDX
        if ((BBP_status(b->batCacheid) & BBPEXISTING) &&
            b->batInserted == b->batCount) {
                MT_Id tid;
@@ -515,7 +504,6 @@ GDKmergeidx(BAT *b, BAT**a, int n_ar)
                        BBPunfix(b->batCacheid);
        } else
                TRC_DEBUG(ACCELERATOR, "GDKmergeidx(%s): NOT persisting 
index\n", BATgetId(b));
-#endif
 
        MT_lock_unset(&b->batIdxLock);
        bat_iterator_end(&bi);
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -16,15 +16,6 @@
 #error this file should not be included outside its source directory
 #endif
 
-/* persist hash heaps for persistent BATs */
-#define PERSISTENTHASH 1
-
-/* persist order index heaps for persistent BATs */
-#define PERSISTENTIDX 1
-
-/* persist strimp heaps for persistent BATs */
-#define PERSISTENTSTRIMP 1
-
 /* only check whether we exceed gdk_vm_maxsize when allocating heaps */
 #define SIZE_CHECK_IN_HEAPS_ONLY 1
 
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to