Changeset: 92ae42232694 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=92ae42232694
Added Files:
        monetdb5/modules/kernel/bat5.c
        monetdb5/modules/kernel/bat5.h
        monetdb5/modules/kernel/bat5.mal
Removed Files:
        monetdb5/modules/kernel/bat5.mx
Modified Files:
        monetdb5/modules/kernel/Makefile.ag
Branch: default
Log Message:

De-Mx the BAT module.


diffs (truncated from 1953 to 300 lines):

diff --git a/monetdb5/modules/kernel/Makefile.ag 
b/monetdb5/modules/kernel/Makefile.ag
--- a/monetdb5/modules/kernel/Makefile.ag
+++ b/monetdb5/modules/kernel/Makefile.ag
@@ -41,7 +41,7 @@ lib_kernel = {
                alarm.c alarm.h \
                algebra.mx \
                array.mx \
-               bat5.mx \
+               bat5.c bat5.h \
                batcalc.c \
                batcolor.mx \
                batifthen.mx \
@@ -63,7 +63,7 @@ lib_kernel = {
 headers_mal = {
        HEADERS = mal
        DIR = libdir/monetdb5
-       SOURCES = calc.mal bat5.mx algebra.mx status.mal unix.mal \
+       SOURCES = calc.mal bat5.mal algebra.mx status.mal unix.mal \
                mmath.mx lock.mal sema.mal alarm.mal batstr.mx batmtime.mx \
                batcolor.mx batifthen.mx batcalc.mal batmmath.mx \
                group.mx aggr.mx array.mx \
diff --git a/monetdb5/modules/kernel/bat5.mx b/monetdb5/modules/kernel/bat5.c
rename from monetdb5/modules/kernel/bat5.mx
rename to monetdb5/modules/kernel/bat5.c
--- a/monetdb5/modules/kernel/bat5.mx
+++ b/monetdb5/modules/kernel/bat5.c
@@ -1,29 +1,24 @@
-@/
-The contents of this file are subject to the MonetDB Public License
-Version 1.1 (the "License"); you may not use this file except in
-compliance with the License. You may obtain a copy of the License at
-http://www.monetdb.org/Legal/MonetDBLicense
-
-Software distributed under the License is distributed on an "AS IS"
-basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-License for the specific language governing rights and limitations
-under the License.
-
-The Original Code is the MonetDB Database System.
-
-The Initial Developer of the Original Code is CWI.
-Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
-Copyright August 2008-2012 MonetDB B.V.
-All Rights Reserved.
-@
-
-@f bat5
-
-@c
 /*
- * @v 2.0
- * @a Peter Boncz, M.L. Kersten
- * @+ Binary Association Tables
+ * The contents of this file are subject to the MonetDB Public License
+ * Version 1.1 (the "License"); you may not use this file except in
+ * compliance with the License. You may obtain a copy of the License at
+ * http://www.monetdb.org/Legal/MonetDBLicense
+ * 
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * 
+ * The Original Code is the MonetDB Database System.
+ * 
+ * The Initial Developer of the Original Code is CWI.
+ * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
+ * Copyright August 2008-2012 MonetDB B.V.
+ * All Rights Reserved.
+*/
+/*
+ * Peter Boncz, M.L. Kersten
+ * Binary Association Tables
  * This module contains the commands and patterns to manage Binary
  * Association Tables (BATs). The relational operations you can execute
  * on BATs have the form of a neat algebra, described in algebra.mx
@@ -41,680 +36,11 @@ All Rights Reserved.
  * and we have to de-reference them before entering the gdk library.
  * (Actual a design error in gdk to differentiate passing int/str)
  * This calls for knowledge on the underlying BAT types`s
- * @-
  */
-@= derefStr
-{ if( @1->@2type >= TYPE_str  && ATOMstorage(@1->@2type) >= TYPE_str)
- { if(@3== 0 || *(str*)@3==0) @3 = (str)str_nil;
-   else @3 = *(str *)@3; 
-}}
-@
-@mal
-# @-
-# The code speaks for itself
-#
-# #command access( b:bat[:any_1,:any_2], mode:int) :bat[:any_1,:any_2]
-# #address BKCaccess;
-#
-# #command setSequenceBase( b:bat[:oid,:any_1], base:oid):void
-# #address BKCsetSequenceBase
-# #comment "Set the sequence base for the void column of a BAT.";
-module bat;
-command attach(tt:int, heapfile:str) :bat[:void,:any_1]
-address BKCattach
-comment "Returns a new BAT with dense head and tail of the given type and uses
-        the given file to initialize the tail. The file will be owned by the
-        server."
 
-command densebat(size:wrd) :bat[:void,:void]
-address BKCdensebat
-comment "Creates a new [void,void] BAT of size 'size'."
-
-command reverse(b:bat[:any_1,:any_2]) :bat[:any_2,:any_1] 
-address BKCreverse
-comment "Returns the reverse view of a BAT (head is tail and tail is head).
-        BEWARE  no copying is involved; input and output refer to the 
-        same object!";
-
-command mirror(b:bat[:any_1,:any_2]) :bat[:any_1,:any_1] 
-address BKCmirror
-comment "Returns the head-mirror image of a BAT (two head columns).";
-
-command order(b:bat[:any_1,:any_2]) :bat[:any_1,:any_2] 
-address BKCorder
-comment "Sorts the BAT itself on the head, in place. ";
-command orderReverse(b:bat[:any_1,:any_2]) :bat[:any_1,:any_2] 
-address BKCorder_rev
-comment "Reverse sorts the BAT itself on the head, in place. ";
-
-command revert(b:bat[:any_1,:any_2]) :bat[:any_1,:any_2] 
-address BKCrevert
-comment "Puts all BUNs in a BAT in reverse order.  (Belongs to the 
-        BAT sequence module)";
-
-# @+ BAT properties
-# Properties of BATs not necessarily require loading the BAT completely.
-# The BAT identifier can be used to access the descriptors.
-# These properties can be inspected with the
-# @emph{info(BAT[:any_1,:any_2]) :bat[str,str] } command:
-# @verbatim
-# > car_age.info.print;
-# #---------------------------------#
-# # BAT:               tmp_31       #
-# # (str)              (str)        #
-# #---------------------------------#
-# [ "batId",           "car_age"    ] # logical bat name
-# [ "batCacheid",      "26"         ] # BBP index
-# [ "batParentid",     "0"          ] # set if a BAT is a view
-# [ "head",            "void"       ] # physical head-type
-# [ "tail",            "int"        ] # physical tail-type
-# [ "batPersistence",  "persistent" ] # transient/session/persistent
-# [ "batRestricted",   "updatable"  ] # read-only/append-only/updatable
-# [ "batDirty",        "clean"      ] # clean/dirty
-# [ "batRefcnt",       "1"          ] # physical refcount
-# [ "batLRefcnt",      "1"          ] # logical refcount (total)
-# [ "batPlevel",       "1"          ] # logical refcount (persistent part)
-# [ "batSet",          "0"          ] # [head,tail] combinations are unique
-# [ "batCopiedtodisk", "1"          ] # has been saved or not
-# @end verbatim
-#
-# Per column, a number of properties are kept. We only show the 
head-properties; the tail properties
-# have the first character of their named replaced by 't' (@emph{sorted}, 
@emph{tdense}, etc.):
-#
-# @verbatim
-# [ "hsorted",         "1"          ] # column is known to be sorted
-# [ "hdense",          "1"          ] # column is known to be densely ascended
-# [ "hseqbase",        "0@0"        ] # if densely ascending first value
-# @end verbatim
-#
-# As described in the @[<a href="www/gdk.html#mod_1_3_0">GDK Technical 
Reference</a>@,
-# BATs store their data in one to six heaps. For each column type that is 
@emph{variable-sized} -
-# like @emph{str} - another
-# heap might be present (@emph{hheap} and @emph{theap}).
-#
-# @verbatim
-# [ "head.free",    "400004"     ] # occupied size in bytes
-# [ "head.size",    "400012"     ] # allocated size in bytes
-# [ "head.maxsize", "400012"     ] # reserver virtual memory in bytes
-# [ "head.storage", "malloced"   ] # malloced/mmap/priv
-# @end verbatim
-#
-# Properties steer the algorithms that Monet uses to execute algebra command. 
For instance,
-# the @emph{find(bat[:any_1,:any_2] b, :any_1) :any_2} that looks up a tail 
value by head,
-# uses binary search if and only if the head column is sorted (in other cases, 
hash-lookup
-# and scan are execution options).
-#
-# Sometimes new (extension) code contains bugs in the property management, 
leaving false
-# properties on produced BATs. You can imagine that later on, this leads to 
additional
-# bugs, as e,g, the binary search algorithms will yield erroneous results on a 
non-sorted
-# sequence.
-command info ( b:bat[:any_1,:any_2]) (:bat[:oid,:str], :bat[:oid,:str])
-address BKCinfo
-comment "Produce a BAT containing info about a BAT in [attribute,value] 
format. 
-        It contains all properties of the BAT record. See the BAT 
documentation 
-        in GDK for more information.";
-
-command getSize ( b:bat[:any_1,:any_2]) :lng
-address BKCbatsize
-comment "Calculate the size of the BAT descriptor, heaps and indices in 
bytes.";
-
-command getMemorySize ( b:bat[:any_1,:any_2]) :lng
-address BKCbatvmsize
-comment "Calculate the size of the BAT heaps and indices in bytes
-rounded to the memory page size (see bbp.getPageSize()).";
-
-command getDiskSize ( b:bat[:any_1,:any_2]) :lng
-address BKCbatdisksize
-comment "Approximate size of the (persistent) BAT heaps as stored on disk 
-in pages of 512 bytes. Indices are not included, as they only live temporarily
-in virtual memory.";
-
-command getCapacity(b:bat[:any_1,:any_2]):lng 
-address BKCgetCapacity
-comment "Returns the current allocation size (in max number of elements) of a 
BAT.";
-
-command getHeadType(b:bat[:any_1,:any_2] ) :str 
-address BKCgetHeadType
-comment "Returns the type of the head column of a BAT, as an integer type 
number.";
-
-command getTailType( b:bat[:any_1,:any_2] ) :str 
-address BKCgetTailType 
-comment "Returns the type of the tail column of a BAT, as an integer type 
number.";
-
-command getRole ( bid:bat[:any_1,:any_2] ) :str 
-address BKCgetRole
-comment "Returns the rolename of the head column of a BAT.";
-
-command setKey( b:bat[:any_1,:any_2], mode:bit) :bat[:any_1,:any_2] 
-address BKCsetkey
-comment "Sets the 'key' property of the head column to 'mode'. In 'key' mode, 
-        the kernel will silently block insertions that cause a duplicate 
-        entries in the head column. KNOWN BUG:when 'key' is set to TRUE, this 
-       function does not automatically eliminate duplicates. 
-        Use b := b.kunique;";
-
-command isaKey( b:bat[:any_1,:any_2]) :bit 
-address BKCgetKey
-comment "return whether the head column of a BAT is unique (key).";
-
-command setSet( b:bat[:any_1,:any_2], mode:bit) :bat[:any_1,:any_2] 
-address BKCsetSet
-comment "Sets the 'set' property on this BAT to 'mode'. In 'set' mode, 
-        the kernel will silently block insertions that cause a duplicate 
-        BUN [head,tail] entries in the BAT.  KNOWN BUG:when 'set' is set 
-        to TRUE, this function does not automatically eliminate duplicates. 
-        Use b := b.sunique; Returns the BAT itself.";
-
-command isaSet( b:bat[:any_1,:any_1]) :bit 
-address BKCisaSet
-comment "return whether the BAT mode is set to unique.";
-
-command setAccess( b:bat[:any_1,:any_2], mode:str) :bat[:any_1,:any_2]
-address BKCsetAccess
-comment "Try to change the update access priviliges 
-       to this BAT. Mode:
-        r[ead-only]      - allow only read access.
-        a[append-only]   - allow reads and update.
-        w[riteable]      - allow all operations.
-       BATs are updatable by default. On making a BAT read-only, 
-        all subsequent updates fail with an error message.Returns 
-        the BAT itself.";
-
-command setAppendMode( b:bat[:any_1,:any_2]) :bat[:any_1,:any_2]
-address BKCsetAppendMode
-comment "Change access privilige of BAT to append only";
-
-command setReadMode( b:bat[:any_1,:any_2]) :bat[:any_1,:any_2]
-address BKCsetReadMode
-comment "Change access privilige of BAT to read only";
-
-command setWriteMode( b:bat[:any_1,:any_2]) :bat[:any_1,:any_2]
-address BKCsetWriteMode
-comment "Change access privilige of BAT to read and write";
-
-command getAccess( b:bat[:any_1,:any_2]):str 
-address BKCgetAccess
-comment "return the access mode attached to this BAT as a character.";
-
-command hasAppendMode( b:bat[:any_1,:any_2]):bit 
-address BKChasAppendMode
-comment "return true if to this BAT is append only.";
-
-command hasWriteMode( b:bat[:any_1,:any_2]):bit 
-address BKChasWriteMode
-comment "return true if to this BAT is read and write.";
-
-command hasReadMode( b:bat[:any_1,:any_2]):bit 
-address BKChasReadMode
-comment "return true if to this BAT is read only.";
-
-
-command getSequenceBase( b:bat[:oid,:any_1]):oid 
-address BKCgetSequenceBase
-comment "Get the sequence base for the void column of a BAT.";
-
-command isSorted(b:bat[:any_1,:any_2]) :bit 
-address BKCisSorted
-comment "Returns whether a BAT is ordered on head or not.";
-command isSortedReverse(b:bat[:any_1,:any_2]) :bit 
-address BKCisSortedReverse
-comment "Returns whether a BAT is ordered on head or not.";
-
-command getStorageSize(b:bat[:any_1,:any_2]) :lng 
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to