Changeset: 33da63b647c5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=33da63b647c5
Modified Files:
        clients/Tests/exports.stable.out
        gdk/gdk.h
        gdk/gdk_align.c
        gdk/gdk_analytic_func.c
        gdk/gdk_bat.c
        gdk/gdk_batop.c
        gdk/gdk_bbp.c
        gdk/gdk_cross.c
        gdk/gdk_delta.c
        gdk/gdk_group.c
        gdk/gdk_heap.c
        gdk/gdk_imprints.c
        gdk/gdk_join.c
        gdk/gdk_logger.c
        gdk/gdk_logger.h
        gdk/gdk_orderidx.c
        gdk/gdk_posix.c
        gdk/gdk_posix.h
        gdk/gdk_project.c
        gdk/gdk_sample.c
        gdk/gdk_select.c
        gdk/gdk_storage.c
        gdk/gdk_string.c
        gdk/gdk_tm.c
        geom/monetdb5/geom.c
        monetdb5/extras/rapi/converters.c.h
        monetdb5/modules/atoms/batxml.c
        monetdb5/modules/atoms/blob.c
        monetdb5/modules/atoms/json.c
        monetdb5/modules/atoms/mtime.c
        monetdb5/modules/kernel/algebra.c
        monetdb5/modules/kernel/bat5.c
        monetdb5/modules/kernel/batcolor.c
        monetdb5/modules/kernel/batstr.c
        monetdb5/modules/kernel/microbenchmark.c
        monetdb5/modules/mal/manifold.c
        monetdb5/modules/mal/mat.c
        monetdb5/modules/mal/mkey.c
        monetdb5/modules/mal/orderidx.c
        monetdb5/modules/mal/pcre.c
        monetdb5/modules/mal/remote.c
        monetdb5/modules/mal/tablet.c
        sql/backends/monet5/UDF/capi/capi.c
        sql/backends/monet5/UDF/pyapi/conversion.c
        sql/backends/monet5/UDF/pyapi/convert_loops.h
        sql/backends/monet5/UDF/pyapi/emit.c
        sql/backends/monet5/UDF/pyapi/pyloader.c
        sql/backends/monet5/UDF/udf/udf.c
        sql/backends/monet5/generator/generator.c
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_cast_impl_up_to_flt.h
        sql/backends/monet5/sql_fround_impl.h
        sql/backends/monet5/sql_rank.c
        sql/backends/monet5/sql_result.c
        sql/backends/monet5/sql_round_impl.h
        sql/backends/monet5/vaults/bam/bam_lib.c
        sql/backends/monet5/vaults/fits/fits.c
        sql/backends/monet5/vaults/lidar/lidar.c
        sql/backends/monet5/vaults/netcdf/netcdf.c
Branch: in-memory
Log Message:

Merge with default branch.


diffs (truncated from 3691 to 300 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
@@ -9,7 +9,7 @@ stdout of test 'exports` in directory 'c
 int ALIGNsynced(BAT *b1, BAT *b2);
 int ATOMallocate(const char *nme);
 void *ATOMdup(int id, const void *val);
-bte ATOMelmshift(int sz);
+uint8_t ATOMelmshift(int sz);
 char *ATOMformat(int id, const void *val);
 int ATOMindex(const char *nme);
 size_t ATOMlen(int id, const void *v);
@@ -117,7 +117,7 @@ BAT *BATdiff(BAT *l, BAT *r, BAT *sl, BA
 gdk_return BATextend(BAT *b, BUN newcap) 
__attribute__((__warn_unused_result__));
 void BATfakeCommit(BAT *b);
 gdk_return BATfirstn(BAT **topn, BAT **gids, BAT *b, BAT *cands, BAT *grps, 
BUN n, bool asc, bool nilslast, bool distinct) 
__attribute__((__warn_unused_result__));
-int BATgetaccess(BAT *b);
+restrict_t BATgetaccess(BAT *b);
 PROPrec *BATgetprop(BAT *b, enum prop_t idx);
 gdk_return BATgroup(BAT **groups, BAT **extents, BAT **histo, BAT *b, BAT *s, 
BAT *g, BAT *e, BAT *h) __attribute__((__warn_unused_result__));
 const char *BATgroupaggrinit(BAT *b, BAT *g, BAT *e, BAT *s, oid *minp, oid 
*maxp, BUN *ngrpp, BUN *startp, BUN *endp, const oid **candp, const oid 
**candendp);
@@ -167,7 +167,7 @@ BAT *BATsample(BAT *b, BUN n);
 BAT *BATsample_with_seed(BAT *b, BUN n, unsigned seed);
 BAT *BATselect(BAT *b, BAT *s, const void *tl, const void *th, bool li, bool 
hi, bool anti);
 gdk_return BATsemijoin(BAT **r1p, BAT **r2p, BAT *l, BAT *r, BAT *sl, BAT *sr, 
bool nil_matches, BUN estimate) __attribute__((__warn_unused_result__));
-gdk_return BATsetaccess(BAT *b, int mode);
+gdk_return BATsetaccess(BAT *b, restrict_t mode);
 void BATsetcapacity(BAT *b, BUN cnt);
 void BATsetcount(BAT *b, BUN cnt);
 void BATsetprop(BAT *b, enum prop_t idx, int type, const void *v);
@@ -313,7 +313,7 @@ int MT_join_thread(MT_Id t);
 int MT_lockf(char *filename, int mode, off_t off, off_t len);
 void *MT_mmap(const char *path, int mode, size_t len);
 int MT_munmap(void *p, size_t len);
-int MT_path_absolute(const char *path);
+bool MT_path_absolute(const char *path);
 void MT_sleep_ms(unsigned int ms);
 void OIDXdestroy(BAT *b);
 ssize_t OIDfromStr(const char *src, size_t *len, oid **dst, bool external);
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -9,7 +9,7 @@
 /*
  * @t The Goblin Database Kernel
  * @v Version 3.05
- * @a Martin L. Kersten, Peter Boncz, Niels Nes
+ * @a Martin L. Kersten, Peter Boncz, Niels Nes, Sjoerd Mullender
  *
  * @+ The Inner Core
  * The innermost library of the MonetDB database system is formed by
@@ -573,14 +573,13 @@ typedef struct {
        char *base;             /* base pointer in memory. */
        char filename[32];      /* file containing image of the heap */
 
+       bte farmid;             /* id of farm where heap is located */
        bool copied:1,          /* a copy of an existing map. */
                hashash:1,      /* the string heap contains hash values */
-               forcemap:1,     /* force STORE_MMAP even if heap exists */
                cleanhash:1,    /* string heaps must clean hash */
                dirty:1;        /* specific heap dirty marker */
        storage_t storage;      /* storage mode (mmap/malloc). */
        storage_t newstorage;   /* new desired storage mode at re-allocation. */
-       bte farmid;             /* id of farm where heap is located */
        bat parentid;           /* cache id of VIEW parent bat */
 } Heap;
 
@@ -732,26 +731,6 @@ gdk_export int VALisnil(const ValRecord 
  *  @c image{http://monetdb.cwi.nl/projects/monetdb-mk/imgs/bat2,,,,feps}
  */
 
-typedef struct {
-       /* dynamic bat properties */
-       MT_Id tid;              /* which thread created it */
-       uint32_t
-        copiedtodisk:1,        /* once written */
-        dirty:1,               /* dirty wrt disk? */
-        dirtyflushed:1,        /* was dirty before commit started? */
-        descdirty:1,           /* bat descriptor dirty marker */
-        restricted:2,          /* access privileges */
-        persistence:1,         /* should the BAT persist on disk? */
-        role:8,                /* role of the bat */
-        unused:17;             /* value=0 for now (sneakily used by mat.c) */
-       int sharecnt;           /* incoming view count */
-
-       /* delta status administration */
-       BUN inserted;           /* start of inserted elements */
-       BUN count;              /* tuple count */
-       BUN capacity;           /* tuple capacity */
-} BATrec;
-
 typedef struct PROPrec PROPrec;
 
 /* see also comment near BATassertProps() for more information about
@@ -760,8 +739,8 @@ typedef struct {
        str id;                 /* label for column */
 
        uint16_t width;         /* byte-width of the atom array */
-       bte type;               /* type id. */
-       bte shift;              /* log2 of bun width */
+       int8_t type;            /* type id. */
+       uint8_t shift;          /* log2 of bun width */
        bool varsized:1,        /* varsized/void (true) or fixedsized (false) */
                key:1,          /* no duplicate values present */
                unique:1,       /* no duplicate values allowed */
@@ -800,10 +779,26 @@ typedef struct BAT {
        bat batCacheid;         /* index into BBP */
        oid hseqbase;           /* head seq base */
 
+       /* dynamic bat properties */
+       MT_Id creator_tid;      /* which thread created it */
+       bool
+        batCopiedtodisk:1,     /* once written */
+        batDirtyflushed:1,     /* was dirty before commit started? */
+        batDirtydesc:1;        /* bat descriptor dirty marker */
+       uint8_t /* adjacent bit fields are packed together (if they fit) */
+        batRestricted:2,       /* access privileges */
+        batPersistence:1;      /* should the BAT persist on disk? */
+       uint8_t batRole;        /* role of the bat */
+       uint16_t unused;        /* value=0 for now (sneakily used by mat.c) */
+       int batSharecnt;        /* incoming view count */
+
+       /* delta status administration */
+       BUN batInserted;        /* start of inserted elements */
+       BUN batCount;           /* tuple count */
+       BUN batCapacity;        /* tuple capacity */
+
        /* dynamic column properties */
        COLrec T;               /* column info */
-
-       BATrec S;               /* the BAT properties */
 } BAT;
 
 typedef struct BATiter {
@@ -812,18 +807,6 @@ typedef struct BATiter {
 } BATiter;
 
 /* macros to hide complexity of the BAT structure */
-#define batPersistence S.persistence
-#define batCopiedtodisk        S.copiedtodisk
-#define batConvert     S.convert
-#define batDirtyflushed        S.dirtyflushed
-#define batDirtydesc   S.descdirty
-#define batInserted    S.inserted
-#define batCount       S.count
-#define batCapacity    S.capacity
-#define batSharecnt    S.sharecnt
-#define batRestricted  S.restricted
-#define batRole                S.role
-#define creator_tid    S.tid
 #define ttype          T.type
 #define tkey           T.key
 #define tunique                T.unique
@@ -958,7 +941,7 @@ gdk_export gdk_return BATextend(BAT *b, 
        __attribute__((__warn_unused_result__));
 
 /* internal */
-gdk_export bte ATOMelmshift(int sz);
+gdk_export uint8_t ATOMelmshift(int sz);
 
 /*
  * @- BUN manipulation
@@ -1235,7 +1218,7 @@ typedef var_t stridx_t;
                         (is_oid_nil((b)->tseqbase)                     \
                          ? ((b)->ttype == TYPE_void                    \
                             ? (void) (p), oid_nil                      \
-                            : ((const oid *) (b)->T.heap.base)[p])     \
+                            : ((const oid *) (b)->theap.base)[p])      \
                          : (oid) ((b)->tseqbase + (BUN) (p))))
 
 static inline BATiter
@@ -1266,10 +1249,10 @@ bat_iterator(BAT *b)
  * @item BAT *
  * @tab BATmode (BAT *b, int mode)
  * @item BAT *
- * @tab BATsetaccess (BAT *b, int mode)
+ * @tab BATsetaccess (BAT *b, restrict_t mode)
  * @item int
  * @tab BATdirty (BAT *b)
- * @item int
+ * @item restrict_t
  * @tab BATgetaccess (BAT *b)
  * @end multitable
  *
@@ -1309,8 +1292,21 @@ gdk_export gdk_return BATmode(BAT *b, in
 gdk_export gdk_return BATroles(BAT *b, const char *tnme);
 gdk_export void BAThseqbase(BAT *b, oid o);
 gdk_export void BATtseqbase(BAT *b, oid o);
-gdk_export gdk_return BATsetaccess(BAT *b, int mode);
-gdk_export int BATgetaccess(BAT *b);
+
+/* The batRestricted field indicates whether a BAT is readonly.
+ * we have modes: BAT_WRITE  = all permitted
+ *                BAT_APPEND = append-only
+ *                BAT_READ   = read-only
+ * VIEW bats are always mapped read-only.
+ */
+typedef enum {
+       BAT_WRITE,                /* all kinds of access allowed */
+       BAT_READ,                 /* only read-access allowed */
+       BAT_APPEND,               /* only reads and appends allowed */
+} restrict_t;
+
+gdk_export gdk_return BATsetaccess(BAT *b, restrict_t mode);
+gdk_export restrict_t BATgetaccess(BAT *b);
 
 
 #define BATdirty(b)    (!(b)->batCopiedtodisk ||                       \
@@ -1320,11 +1316,6 @@ gdk_export int BATgetaccess(BAT *b);
 
 #define PERSISTENT             0
 #define TRANSIENT              1
-#define LOG_DIR                        2
-
-#define BAT_WRITE              0       /* all kinds of access allowed */
-#define BAT_READ               1       /* only read-access allowed */
-#define BAT_APPEND             2       /* only reads and appends allowed */
 
 #define BATcapacity(b) (b)->batCapacity
 /*
@@ -2551,16 +2542,6 @@ gdk_export void VIEWbounds(BAT *b, BAT *
                }                                                       \
        } while (false)
 
-/* The batRestricted field indicates whether a BAT is readonly.
- * we have modes: BAT_WRITE  = all permitted
- *                BAT_APPEND = append-only
- *                BAT_READ   = read-only
- * VIEW bats are always mapped read-only.
- */
-
-#define BAThrestricted(b) ((b)->batRestricted)
-#define BATtrestricted(b) (VIEWtparent(b) ? 
BBP_cache(VIEWtparent(b))->batRestricted : (b)->batRestricted)
-
 /* the parentid in a VIEW is correct for the normal view. We must
  * correct for the reversed view.
  */
diff --git a/gdk/gdk_align.c b/gdk/gdk_align.c
--- a/gdk/gdk_align.c
+++ b/gdk/gdk_align.c
@@ -115,7 +115,7 @@ VIEWcreate(oid seq, BAT *b)
         * with a copy from the parent.  Clear the copied flag since
         * our heap was not copied from our parent(s) even if our
         * parent's heap was copied from its parent. */
-       bn->theap.copied = 0;
+       bn->theap.copied = false;
        bn->tprops = NULL;
 
        /* correct values after copy of head and tail info */
@@ -315,7 +315,7 @@ VIEWreset(BAT *b)
                b->batRestricted = BAT_WRITE;
 
                b->tkey = BATtkey(v);
-               b->tunique = 0;
+               b->tunique = false;
 
                /* copy the heaps */
                b->theap = tail;
@@ -336,11 +336,11 @@ VIEWreset(BAT *b)
                        v->theap.parentid = 0;
                }
                b->batSharecnt = 0;
-               b->batCopiedtodisk = 0;
+               b->batCopiedtodisk = false;
                b->batDirtydesc = true;
 
                b->tkey = BATtkey(v);
-               b->tunique = 0;
+               b->tunique = false;
 
                /* make the BAT empty and insert all again */
                DELTAinit(b);
diff --git a/gdk/gdk_analytic_func.c b/gdk/gdk_analytic_func.c
--- a/gdk/gdk_analytic_func.c
+++ b/gdk/gdk_analytic_func.c
@@ -1000,7 +1000,7 @@ GDKanalyticalcount(BAT *r, BAT *b, BAT *
        start = (lng*)Tloc(s, 0);
        end = (lng*)Tloc(e, 0);
 
-       if(!*ignore_nils || b->T.nonil) {
+       if(!*ignore_nils || b->tnonil) {
                for(; i<cnt; i++, rb++)
                        *rb = (end[i] > start[i]) ? (end[i] - start[i]) : 0;
        } else {
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -141,10 +141,10 @@ BATcreatedesc(oid hseq, int tt, bool hea
        return NULL;
 }
 
-bte
+uint8_t
 ATOMelmshift(int sz)
 {
-       bte sh;
+       uint8_t sh;
        int i = sz >> 1;
 
        for (sh = 0; i != 0; sh++) {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to