Changeset: 70c3fc5d707a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=70c3fc5d707a
Modified Files:
        gdk/gdk.h
        gdk/gdk_align.c
        gdk/gdk_bbp.c
        gdk/gdk_private.h
Branch: leftmart
Log Message:

Introducing arngment OID index in gdk


diffs (154 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -675,6 +675,7 @@ typedef struct {
 } Hash;
 
 typedef struct Imprints Imprints;
+typedef struct Arngment Arngment;
 
 
 /*
@@ -797,6 +798,7 @@ gdk_export int VALisnil(const ValRecord 
  *           Heap   *hheap;           // heap for varsized head values
  *           Hash   *hhash;           // linear chained hash table on head
  *           Imprints *himprints;     // column imprints index on head
+ *           Arngment *harngment;     // oid index arrangement on head
  *           // Tail properties
  *           int    ttype;            // Tail type number
  *           str    tident;           // name for tail column
@@ -810,6 +812,7 @@ gdk_export int VALisnil(const ValRecord 
  *           Heap   *theap;           // heap for varsized tail values
  *           Hash   *thash;           // linear chained hash table on tail
  *           Imprints *timprints;     // column imprints index on tail
+ *           Arngment *tarngment;     // oid index arrangement on tail
  *  } BAT;
  * @end verbatim
  *
@@ -889,6 +892,7 @@ typedef struct {
        Heap *vheap;            /* space for the varsized data. */
        Hash *hash;             /* hash table */
        Imprints *imprints;     /* column imprints index */
+       Arngment *arngment;     /* oid index arrangement */
 
        PROPrec *props;         /* list of dynamic properties stored in the bat 
descriptor */
 } COLrec;
@@ -2067,10 +2071,12 @@ gdk_export oid OIDnew(oid inc);
  *  BAThash (BAT *b, BUN masksize)
  * @end multitable
  *
- * The current BAT implementation supports two search accelerators:
- * hashing and imprints.  The routine BAThash makes sure that a hash
- * accelerator on the tail of the BAT exists. GDK_FAIL is returned
- * upon failure to create the supportive structures.
+ * The current BAT implementation supports three search accelerators:
+ * hashing, imprints, and oid arrangement.
+ *
+ * The routine BAThash makes sure that a hash accelerator on the tail of the
+ * BAT exists. GDK_FAIL is returned upon failure to create the supportive
+ * structures.
  */
 gdk_export gdk_return BAThash(BAT *b, BUN masksize);
 
@@ -2091,6 +2097,20 @@ gdk_export gdk_return BATimprints(BAT *b
 gdk_export lng IMPSimprintsize(BAT *b);
 
 /*
+ * @- OID index arrangement
+ *
+ * @multitable @columnfractions 0.08 0.7
+ * @item BAT*
+ * @tab
+ *  BAT 
+ * @end multitable
+ *
+ * The oid index arrangement.
+ *
+ */
+
+
+/*
  * @- Multilevel Storage Modes
  *
  * We should bring in the compressed mode as the first, maybe
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -329,6 +329,10 @@ VIEWcreate_(BAT *h, BAT *t, int slice_vi
        /* imprints are shared, but the check is dynamic */
        bn->H->imprints = NULL;
        bn->T->imprints = NULL;
+       /* OID index arrangement */
+       /* TODO: what is the correct step here? slice the OID index? */
+       bn->H->arngment = NULL;
+       bn->T->arngment = NULL;
        BBPcacheit(bs, 1);      /* enter in BBP */
        /* View of VIEW combine, ie we need to fix the head of the mirror */
        if (vc) {
@@ -544,6 +548,13 @@ VIEWunlink(BAT *b)
                        b->H->imprints = NULL;
                if (tpb && b->T->imprints && b->T->imprints == tpb->H->imprints)
                        b->T->imprints = NULL;
+
+               /* unlink OID index arrangement */
+               if (hpb && b->H->arngment && b->H->arngment == hpb->H->arngment)
+                       b->H->arngment = NULL;
+               if (tpb && b->T->arngment && b->T->arngment == tpb->H->arngment)
+                       b->T->arngment = NULL;
+
        }
 }
 
diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -3862,6 +3862,12 @@ BBPdiskscan(const char *parent)
                } else if (strncmp(p + 1, "timprints", 9) == 0) {
                        BAT *b = getdesc(bid);
                        delete = b == NULL;
+               } else if (strncmp(p + 1, "harngment", 9) == 0) {
+                       BAT *b = getdesc(bid);
+                       delete = b == NULL;
+               } else if (strncmp(p + 1, "tarngment", 9) == 0) {
+                       BAT *b = getdesc(bid);
+                       delete = b == NULL;
                } else if (strncmp(p + 1, "priv", 4) != 0 && strncmp(p + 1, 
"new", 3) != 0 && strncmp(p + 1, "head", 4) != 0 && strncmp(p + 1, "tail", 4) 
!= 0) {
                        ok = FALSE;
                }
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -18,7 +18,8 @@ enum heaptype {
        offheap,
        varheap,
        hashheap,
-       imprintsheap
+       imprintsheap,
+       arngmentheap
 };
 
 /*
@@ -220,10 +221,15 @@ struct Imprints {
        BUN dictcnt;            /* counter for cache dictionary               */
 };
 
+struct Arngment {
+       Heap *arngment;
+};
+
 typedef struct {
        MT_Lock swap;
        MT_Lock hash;
        MT_Lock imprints;
+       MT_Lock arngment;
 } batlock_t;
 
 typedef struct {
@@ -298,6 +304,7 @@ extern MT_Lock MT_system_lock;
 #define GDKswapLock(x)  GDKbatLock[(x)&BBP_BATMASK].swap
 #define GDKhashLock(x)  GDKbatLock[(x)&BBP_BATMASK].hash
 #define GDKimprintsLock(x)  GDKbatLock[(x)&BBP_BATMASK].imprints
+#define GDKarngmentLock(x)  GDKbatLock[(x)&BBP_BATMASK].arngment
 #if SIZEOF_SIZE_T == 8
 #define threadmask(y)  ((int) ((mix_int((unsigned int) y) ^ mix_int((unsigned 
int) (y >> 32))) & BBP_THREADMASK))
 #else
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to