Changeset: 6a8165c8e305 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6a8165c8e305
Modified Files:
        monetdb5/mal/mal.c
        monetdb5/mal/mal_atom.c
        monetdb5/mal/mal_authorize.c
        monetdb5/mal/mal_box.c
        monetdb5/mal/mal_dataflow.c
        monetdb5/mal/mal_debugger.c
        monetdb5/mal/mal_errors.h
        monetdb5/mal/mal_factory.c
        monetdb5/mal/mal_function.c
        monetdb5/mal/mal_instruction.c
        monetdb5/mal/mal_interpreter.c
        monetdb5/mal/mal_listing.c
        monetdb5/mal/mal_namespace.c
        monetdb5/mal/mal_parser.c
        monetdb5/mal/mal_profiler.c
        monetdb5/mal/mal_properties.c
        monetdb5/mal/mal_readline.c
        monetdb5/mal/mal_recycle.c
        monetdb5/modules/atoms/colxml.c
        monetdb5/modules/mal/Makefile.ag
        monetdb5/modules/mal/attach.c
        monetdb5/modules/mal/cbp.c
        monetdb5/modules/mal/cbp.h
        monetdb5/modules/mal/clients.c
        monetdb5/modules/mal/clients.mal
        monetdb5/modules/mal/extensions.c
        monetdb5/modules/mal/factories.c
        monetdb5/modules/mal/groupby.c
        monetdb5/modules/mal/inspect.c
        monetdb5/modules/mal/language.c
        monetdb5/modules/mal/mal_io.c
        monetdb5/modules/mal/transaction.c
        monetdb5/modules/mal/transaction.h
        monetdb5/modules/mal/transaction.mal
        monetdb5/optimizer/opt_joinpath.c
        monetdb5/optimizer/opt_prejoin.c
Branch: headless
Log Message:

Changing BAT to COL
This involves also changing BATnew into COLnew


diffs (truncated from 4166 to 300 lines):

diff --git a/monetdb5/mal/mal.c b/monetdb5/mal/mal.c
--- a/monetdb5/mal/mal.c
+++ b/monetdb5/mal/mal.c
@@ -174,7 +174,7 @@
  * simple, sequential MAL interpreter. For each MAL function call it creates
  * a stack frame, which is initialized with all constants found in the
  * function body. During interpretation the garbage collector
- * ensures freeing of space consumptive tables (BATs) and strings.
+ * ensures freeing of space consumptive tables (columns) and strings.
  * Furthermore, all temporary structures are garbage collected before
  * the funtion returns the result.
  *
diff --git a/monetdb5/mal/mal_atom.c b/monetdb5/mal/mal_atom.c
--- a/monetdb5/mal/mal_atom.c
+++ b/monetdb5/mal/mal_atom.c
@@ -70,11 +70,11 @@
  * It is not meant for end-users trying to intruduce record- or 
  * struct-like objects in the database. They better decompose
  * the complex object structure and represent the components in
- * different BATs.
+ * different columns.
  *
  * Every MAL command introduced in an atom module should be checked
  * to detect overloading of a predefined function.
- * Subsequently, we update the BAT atom structure.
+ * Subsequently, we update the column atom structure.
  * The function signatures should be parameter-less, which
  * enables additional functions with the same name to appear
  * as ordinary mal operators.
diff --git a/monetdb5/mal/mal_authorize.c b/monetdb5/mal/mal_authorize.c
--- a/monetdb5/mal/mal_authorize.c
+++ b/monetdb5/mal/mal_authorize.c
@@ -159,9 +159,8 @@
 
                b = BATdescriptor(bid);
                if (b == NULL)
-                       throw(MAL, "initTables.passwd", INTERNAL_BAT_ACCESS);
-               fprintf(stderr,
-                               "#warning: converting old password store to new 
format\n");
+                       throw(MAL, "initTables.passwd", INTERNAL_COL_ACCESS);
+               fprintf(stderr, "#warning: converting old password store to new 
format\n");
                fflush(stderr);
 
                /* create new bat */
@@ -425,13 +424,13 @@
                if (b == NULL) {
                        BATundo(user);
                        BATundo(pass);
-                       throw(ILLARG, "addUser", INTERNAL_BAT_ACCESS);
+                       throw(ILLARG, "addUser", INTERNAL_COL_ACCESS);
                }
                if (b->htype != TYPE_str) {
                        BATundo(user);
                        BATundo(pass);
                        BBPreleaseref(b->batCacheid);
-                       throw(ILLARG, "addUser", INTERNAL_BAT_HEAD);
+                       throw(ILLARG, "addUser", INTERNAL_COL_HEAD);
                }
 
                /* associate scenarios given in the BAT with the user */
diff --git a/monetdb5/mal/mal_box.c b/monetdb5/mal/mal_box.c
--- a/monetdb5/mal/mal_box.c
+++ b/monetdb5/mal/mal_box.c
@@ -89,7 +89,7 @@
  * end function;
  * @end example
  * 
- * The function binds to a copy from the local persistent BAT space,
+ * The function binds to a copy from the local persistent column space,
  * much like bat-names are resolved in earlier MonetDB versions. The second
  * statement uses an implementation of take that searches a variable
  * of interest using two string properties. It illustrates that
@@ -99,7 +99,7 @@
  * The result bat @sc{c} is temporary and disappears upon garbage
  * collection. The variable @sc{u} is looked up as the string object user.
  * 
- * Note that BATs @sc{b} and @sc{c} need be released at some point. In general
+ * Note that columns @sc{b} and @sc{c} need be released at some point. In 
general
  * this point in time does not coincide with a computational boundary
  * like a function return. During a session, several bats may be taken
  * out of the box, being processed, and only at the end of a session 
@@ -129,14 +129,14 @@
  * layer and relying on the functionality of the box.
  * However, to improve introspection, we assume that all box 
  * implementations provide a few rudimentary functions, called objects(arglist)
- * and dir(arglist). The function objects() produces a BAT with
+ * and dir(arglist). The function objects() produces a column with
  * the object names, possibly limited to those identified by
  * the arglist.
  * 
  * The world of boxes has not been explored deeply yet.
  * It is envisioned that it could play a role to import/export
  * different objects, e.g.,
- * introduce xml.take() which converts an XML document to a BAT,
+ * introduce xml.take() which converts an XML document to a column,
  * jpeg.take() similer for an image.
  * 
  * Nesting boxes is possible. It provides a simple
@@ -172,12 +172,12 @@
  * i.e. the directory <dbfarm>/box
  * 
  * @- Garbage Collection
- * The key objects managed by MonetDB are the persistent BATs, which
+ * The key objects managed by MonetDB are the persistent columns, which
  * call for an efficient scheme to make them accessible for manipulation
  * in the MAL procedures taking into account a possibly hostile
  * parallel access.
  * 
- * Most kernel routines produce BATs as a result, which will be referenced 
+ * Most kernel routines produce columns as a result, which will be referenced 
  * from the runtime stack. They should be garbage collected as soon as
  * deemed possible to free-up space. By default, temporary results are
  * garbage collected before returning from a MAL function.
@@ -433,14 +433,14 @@
 }
 
 /*
- * The function bindBAT relates a logical BAT name with a physical
+ * The function bindCOL relates a logical column name with a physical
  * representation. The bind commands are typically found in the boxes,
- * which provide users a partial view over the BAT storage area.
+ * which provide users a partial view over the column storage area.
  * That is, all bats bound can be taken out of the box upon need.
- * A variable can be rebound to another BAT at any time.
+ * A variable can be rebound to another column at any time.
 */
 int
-bindBAT(Box box, str name, str location)
+bindCOL(Box box, str name, str location)
 {
        int i;
        ValPtr v;
@@ -552,15 +552,15 @@
 str
 getBoxNames(int *bid)
 {
-       BAT *b;
+       COL *b;
        int i;
 
-       b = BATnew(TYPE_int, TYPE_str, (BUN) MAXSPACES);
+       b = COLnew(TYPE_str, (BUN) MAXSPACES);
        if (b == NULL)
                throw(MAL, "box.getBoxNames", MAL_MALLOC_FAIL);
        for (i = 0; i < topbox; i++)
                if (malbox[i] != NULL) {
-                       BUNins(b, &i, malbox[i]->name, FALSE);
+                       BUNappend(b, malbox[i]->name, FALSE);
                }
        BBPkeepref(*bid = b->batCacheid);
        return MAL_SUCCEED;
@@ -569,7 +569,7 @@
 /*
  * The content of a box is saved on a file for subsequent re-use.
  * The storage is explicitly in terms of MAL operations.
- * For BAT objects, the corresponding object is made persistent.
+ * For column objects, the corresponding object is made persistent.
  * Note that the user can not control these operations directly.
  * The box container is created if it did not yet exist.
  */
@@ -663,7 +663,7 @@
                str tnme; 
                v = &box->val->stk[i];
                if (v->vtype == TYPE_bat) {
-                       BAT *b = (BAT *) BATdescriptor(v->val.bval);
+                       COL *b = BATdescriptor(v->val.bval);
                        if (b) {
                                if (b->batPersistence == PERSISTENT){
                                        str tt = 
getTypeName(getColType(getVarType(box->sym,i)));
diff --git a/monetdb5/mal/mal_dataflow.c b/monetdb5/mal/mal_dataflow.c
--- a/monetdb5/mal/mal_dataflow.c
+++ b/monetdb5/mal/mal_dataflow.c
@@ -151,17 +151,17 @@
 calcclaim(MalStkPtr stk, InstrPtr pci, int i)
 {
        lng total = 0,vol;
-       BAT *b;
+       COL *b;
 
        assert(i < pci->argc);
        if (stk->stk[getArg(pci,i)].vtype == TYPE_bat){
                b = BBPquickdesc(stk->stk[getArg(pci,i)].val.bval,TRUE);
                if (b==NULL)
                        return total;
-               heapinfo(&b->H->heap); total += vol;
-               heapinfo(b->H->vheap); total += vol;
-               hashinfo(b->H->hash); total += vol; 
-               if ( b->htype == TYPE_oid && !BAThordered(b) && !BAThdense(b) ){
+               heapinfo(&b->heap); total += vol;
+               heapinfo(b->vheap); total += vol;
+               hashinfo(b->hash); total += vol; 
+               if ( COLtype(b) == TYPE_oid && !COLordered(b) && !COLdense(b) ){
                        /* assume we may have to do random IO, punish it by 
increasing the claim  with hash elem size*/
                        total += 4 * BATcount(b) ;
                        total = total > (lng) (MEMORY_THRESHOLD * 
monet_memory)? (lng) (MEMORY_THRESHOLD * monet_memory) : total;
@@ -568,7 +568,7 @@
                updMemoryUsedPart(stk,pci,0,pci->retc,-1);
                runtimeProfileBegin(cntxt, mb, stk, stkpc, &runtimeProfile, 1);
 /*
- * To improve memory access behavior we could touch the pages of all BATs to 
enforce them to become memory resident.
+ * To improve memory access behavior we could touch the pages of all columns 
to enforce them to become memory resident.
  * This won't work, because it is not selective enough. The advice should be 
selectively given in the kernel.
  * 
  * The number of instructions allowed is severely limited.
@@ -664,7 +664,7 @@
 #endif
        /* Provide debugging support */
        if( GDKdebug & 10 ) {
-               BAT *b;
+               COL *b;
 
                for( i=0; i< pci->retc; i++)
                if ( garbage[i] == -1 && stk->stk[getArg(pci,i)].vtype == 
TYPE_bat &&
diff --git a/monetdb5/mal/mal_debugger.c b/monetdb5/mal/mal_debugger.c
--- a/monetdb5/mal/mal_debugger.c
+++ b/monetdb5/mal/mal_debugger.c
@@ -91,7 +91,7 @@
  *     var  <obj>       -- print symbol table for module
  *     optimizer <obj>  -- display optimizer steps
  *     print <var>      -- display value of a variable
- *     print <var> <cnt>[<first>] -- display BAT chunk
+ *     print <var> <cnt>[<first>] -- display column chunk
  *     info <var>       -- display bat variable properties
  *     run              -- restart current procedure
  *     where            -- print stack trace
@@ -192,9 +192,9 @@
  * @end example
  * The variables marked 'unused' have been introduced as temporary variables,
  * but which are not referenced in the remainder of the program.
- * It also illustrates basic BAT properties, a complete description of which
+ * It also illustrates basic column properties, a complete description of which
  * can be obtained using the 'info' ('i') command.
- * A sample of the BAT content can be printed passing tuple indices, e.g.
+ * A sample of the column content can be printed passing tuple indices, e.g.
  * 'print b 10 10' prints the second batch of ten tuples.
  * 
  * @node Handling Breakpoints, Profile Switches, Program Debugging, The MAL 
Debugger
@@ -241,7 +241,7 @@
  * activates a listing of all instructions being executed.
  * It is measured in wall-clock time.
  * @item flow
- * shows the total byte size of all BAT target results and input arguments.
+ * shows the total byte size of all column target results and input arguments.
  * It is a good indicator on the amount of data being processed.
  * @item memory
  * keeps track on growing memory needs.
@@ -250,7 +250,7 @@
  * and is used to detect operators consuming excessive amounts of space.
  * @item bigfoot
  * keeps track of the current and maximum virtual memory footprint 
- * of the BATs.[incomplete]
+ * of the columns.[incomplete]
  * @end table
  * 
  * The snippet below shows setting the @sc{memory} and @sc{timer}
@@ -403,13 +403,13 @@
  * block can be listed using @sc{mdb.list()} and @sc{mdb.List()}.
  * An arbitrary code block can be shown with  
@sc{mdb.list}(@emph{module},@emph{function})
  * and @sc{mdb.List}(@emph{module},@emph{function}).
- * A BAT representation of the current function is return by 
@sc{mdb.getDefinition()}@.
+ * A column representation of the current function is return by 
@sc{mdb.getDefinition()}@.
  * 
  * The symbol table and stack content, if available, can be shown with
  * the operations @sc{mdb.var()} and 
@sc{mdb.list}(@emph{module},@emph{function})
  * Access to the stack frames may be helpful in the context of exception 
handling.
  * The operation @sc{mdb.getStackDepth()} gives the depth and individual
- * elements can be accessed as BATs using @sc{mdb.getStackFrame(@emph{n})}.
+ * elements can be accessed as column using @sc{mdb.getStackFrame(@emph{n})}.
  * The top stack frame is accessed using @sc{mdb.getStackFrame()}.
  * 
  * @node Debugger Attachment, The MAL Profiler, Runtime Inspection,  The MAL 
Debugger
@@ -694,11 +694,12 @@
 }
 /*
  * Sometimes we may want to trace the changes applied to the
- * BAT buffer pool and report them together with the MAL
+ * column buffer pool and report them together with the MAL
  * instruction where it happened.
 */
 static int BBPtraceEnabled = 0;
 static str BBPtracePattern = NULL;
+
 char
 BBPTraceCall(Client cntxt, MalBlkPtr mb, MalStkPtr stk, int pc)
 {
@@ -722,9 +723,9 @@
        /* no growing BBP yet */
        action = 0;
        for ( i=0; i<bbpsize; i++){
-               /* what happened to this BAT */
+               /* what happened to this column */
                if ( BBPmirror[i] != BBP_lrefs(i)){
-                       BAT *b = BBPquickdesc(ABS(i), TRUE);
+                       COL *b = BBPquickdesc(i, TRUE);
                        BBPlogical(i,lbuf);
                        if ( BBPtracePattern  && strstr(lbuf,BBPtracePattern) 
!= NULL )
                                continue;
@@ -742,17 +743,14 @@
 }
 
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to