Changeset: 93fbe8b21383 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/93fbe8b21383
Modified Files:
        gdk/gdk_strimps.c
Branch: strimps_update
Log Message:

Remove unneeded code


diffs (138 lines):

diff --git a/gdk/gdk_strimps.c b/gdk/gdk_strimps.c
--- a/gdk/gdk_strimps.c
+++ b/gdk/gdk_strimps.c
@@ -876,134 +876,6 @@ STRMPfree(BAT *b)
 
 /* Parallel creation. does not wok*/
 #if 0
-/* Creates the heap for a string imprint. Returns NULL on failure. This
- * follows closely the Heap creation for the order index.
- */
-static Strimps *
-STRMPcreateStrimpHeap(BAT *b, BAT *s)
-{
-       uint8_t *h1, *h2;
-       Strimps *r = NULL;
-       uint64_t descriptor;
-       size_t i;
-       uint16_t sz;
-       CharPair hpairs[STRIMP_HEADER_SIZE];
-       const char *nme;
-
-       MT_lock_set(&b->batIdxLock);
-       /* Make sure no other thread got here first */
-        if ((r = b->tstrimps) == NULL) {
-               if (STRMPbuildHeader(b, s, hpairs)) { /* Find the header pairs, 
put
-                                                        the result in hpairs */
-                       sz = 8 + STRIMP_HEADER_SIZE; /* add 8-bytes for the 
descriptor and
-                                                       the pair sizes */
-                       for (i = 0; i < STRIMP_HEADER_SIZE; i++) {
-                               sz += hpairs[i].psize;
-                       }
-
-                       nme = GDKinmemory(b->theap->farmid) ? ":memory:"
-                               : BBP_physical(b->batCacheid);
-                       /* Allocate the strimps heap */
-                       if ((r = GDKzalloc(sizeof(Strimps))) == NULL ||
-                           (r->strimps.farmid =
-                            BBPselectfarm(b->batRole, b->ttype, strimpheap)) < 
0 ||
-                           strconcat_len(r->strimps.filename, 
sizeof(r->strimps.filename),
-                                         nme, ".tstrimps",
-                                         NULL) >= sizeof(r->strimps.filename) 
||
-                           HEAPalloc(&r->strimps, BATcount(b) * 
sizeof(uint64_t) + sz,
-                                     sizeof(uint8_t), 0) != GDK_SUCCEED) {
-                               GDKfree(r);
-                               MT_lock_unset(&b->batIdxLock);
-                               return NULL;
-                       }
-
-                       descriptor = STRIMP_VERSION | 
((uint64_t)STRIMP_HEADER_SIZE) << 8 |
-                               ((uint64_t)sz) << 16;
-
-                       ((uint64_t *)r->strimps.base)[0] = descriptor;
-                       r->sizes_base = h1 = (uint8_t *)r->strimps.base + 8;
-                       r->pairs_base = h2 = (uint8_t *)h1 + STRIMP_HEADER_SIZE;
-
-                       for (i = 0; i < STRIMP_HEADER_SIZE; i++) {
-                               uint8_t psize = hpairs[i].psize;
-                               h1[i] = psize;
-                               memcpy(h2, hpairs[i].pbytes, psize);
-                               h2 += psize;
-                       }
-                       r->bitstrings_base = h2;
-                       r->strimps.free = sz;
-
-                       // incref
-                       b->tstrimps = r;
-               }
-       }
-       else
-               //incref
-       MT_lock_unset(&b->batIdxLock);
-       return r;
-}
-
-/* Create */
-gdk_return
-STRMPcreate(BAT *b, BAT *s)
-{
-       lng t0 = 0;
-       BATiter bi;
-       BUN i;
-       Strimps *h;
-       uint64_t *dh;
-       BAT *pb;
-       oid x;
-       struct canditer ci;
-
-       TRC_DEBUG_IF(ACCELERATOR) t0 = GDKusec();
-       if (b->ttype != TYPE_str) {
-               GDKerror("strimps only valid for strings\n");
-               return GDK_FAIL;
-       }
-
-       /* Disable this before merging to default */
-       if (VIEWtparent(b)) {
-               pb = BBP_cache(VIEWtparent(b));
-               assert(pb);
-       } else {
-               pb = b;
-       }
-
-       if (BATcheckstrimps(pb))
-               return GDK_SUCCEED;
-
-       if ((h = STRMPcreateStrimpHeap(pb, s)) == NULL) {
-               return GDK_FAIL;
-       }
-       dh = (uint64_t *)h->bitstrings_base + b->hseqbase;
-
-       canditer_init(&ci, b, s);
-
-       bi = bat_iterator(b);
-       for (i = 0; i < ci.ncand; i++) {
-               x = canditer_next(&ci) - b->hseqbase;
-               const char *cs = BUNtvar(bi, x);
-               if (!strNil(cs))
-                       *dh++ = STRMPmakebitstring(cs, h);
-               else
-                       *dh++ = 0; /* no pairs in nil values */
-       }
-       bat_iterator_end(&bi);
-
-       MT_lock_set(&b->batIdxLock);
-       h->strimps.free += b->batCount*sizeof(uint64_t);
-       MT_lock_unset(&b->batIdxLock);
-
-       /* The thread that reaches this point last needs to write the strimp to 
disk. */
-       if (STRIMP_COMPLETE(pb)) {
-               persistStrimp(pb);
-       }
-
-       TRC_DEBUG(ACCELERATOR, "strimp creation took " LLFMT " usec\n", 
GDKusec()-t0);
-       return GDK_SUCCEED;
-}
-
 /* Update the strimp by computing a bitstring and adding it to the heap.
    This will probably be useful later when strimps take updates into
    account. */
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to