Changeset: 64833d933361 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=64833d933361
Modified Files:
gdk/gdk.h
gdk/gdk_align.c
gdk/gdk_atoms.c
gdk/gdk_batop.mx
gdk/gdk_bbp.c
gdk/gdk_bbp.h
gdk/gdk_col.c
gdk/gdk_delta.c
gdk/gdk_logger.c
gdk/gdk_posix.c
gdk/gdk_rangejoin.mx
gdk/gdk_relop.mx
gdk/gdk_scanselect.mx
gdk/gdk_scanselect_defs.mx
gdk/gdk_search.c
gdk/gdk_setop.mx
gdk/gdk_storage.c
gdk/gdk_tm.c
gdk/gdk_utils.c
gdk/gdk_value.c
Branch: headless
Log Message:
s/BBP/CBP/g
diffs (truncated from 6569 to 300 lines):
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -63,7 +63,7 @@
* COL routines that define the primitive operations on the
* database tables (COLs).
* @item
- * BBP routines to manage the COL Buffer Pool (BBP).
+ * CBP routines to manage the COL Buffer Pool (CBP).
* @item
* ATOM routines to manipulate primitive types, define new types
* using an ADT interface.
@@ -494,7 +494,7 @@
#define TYPE_chr 2
#define TYPE_bte 3
#define TYPE_sht 4
-#define TYPE_bat 5 /* COL id: index in BBPcache */
+#define TYPE_bat 5 /* COL id: index in CBPcache */
#define TYPE_int 6
#define TYPE_oid 7
#define TYPE_wrd 8
@@ -529,7 +529,7 @@
#define SIZEOF_WRD SIZEOF_SSIZE_T
typedef ssize_t wrd;
-typedef int bat; /* Index into BBP */
+typedef int bat; /* Index into CBP */
typedef void *ptr; /* Internal coding of types */
#define SIZEOF_PTR SIZEOF_VOID_P
@@ -766,12 +766,12 @@
* @verbatim
* typedef struct {
* // static COL properties
- * bat batCacheid; // bat id: index in BBPcache
+ * bat batCacheid; // bat id: index in CBPcache
* int batPersistence; // persistence mode
* bit batCopiedtodisk; // COL is saved on disk?
* bit batSet; // all tuples in the COL are unique?
* // dynamic COL properties
- * int batHeat; // heat of COL in the BBP
+ * int batHeat; // heat of COL in the CBP
* sht batDirty; // COL modified after last commit?
* bit batDirtydesc; // COL descriptor specific dirty flag
* Heap* batBuns; // Heap where the buns are stored
@@ -813,7 +813,7 @@
* The reason for this complex structure is
* to allow for a COL to exist in two incarnations at the time: the
* @emph{normal view} and the @emph{reversed view}. Each bat @emph{b} has a
- * COLmirror(@emph{b}) which has the negative @strong{cacheid} of b in the
BBP.
+ * COLmirror(@emph{b}) which has the negative @strong{cacheid} of b in the
CBP.
*
* Since we don't want to pay cost to keep both views in line with each other
* under COL updates, we work with shared pieces of memory between
@@ -841,7 +841,7 @@
typedef struct {
/* static bat properties */
- bat batCacheid; /* index into BBP */
+ bat batCacheid; /* index into CBP */
/* dynamic column properties */
str id; /* label for head/tail column */
@@ -1754,52 +1754,52 @@
*
* @multitable @columnfractions 0.08 0.7
* @item int
- * @tab BBPfix (bat bi)
+ * @tab CBPfix (bat bi)
* @item int
- * @tab BBPunfix (bat bi)
+ * @tab CBPunfix (bat bi)
* @item int
- * @tab BBPincref (bat bi, int logical)
+ * @tab CBPincref (bat bi, int logical)
* @item int
- * @tab BBPdecref (bat bi, int logical)
+ * @tab CBPdecref (bat bi, int logical)
* @item void
- * @tab BBPhot (bat bi)
+ * @tab CBPhot (bat bi)
* @item void
- * @tab BBPcold (bat bi)
+ * @tab CBPcold (bat bi)
* @item str
- * @tab BBPname (bat bi)
+ * @tab CBPname (bat bi)
* @item bat
- * @tab BBPindex (str nme)
+ * @tab CBPindex (str nme)
* @item COL*
* @tab COLdescriptor (bat bi)
* @item bat
- * @tab BBPcacheid (COL *b)
+ * @tab CBPcacheid (COL *b)
* @end multitable
* @
* The COL Buffer Pool module contains the code to manage the storage
- * location of COLs. It uses two tables @%BBPlogical@ and @%BBphysical@
+ * location of COLs. It uses two tables @%CBPlogical@ and @%BBphysical@
* to relate the COL name with its corresponding file system name.
* This information is retained in an ASCII file within the database home
* directory for ease of inspection. It is loaded upon restart
* of the server and saved upon transaction commit (if necessary).
* @
- * The remaining BBP tables contain status information to load, swap and
+ * The remaining CBP tables contain status information to load, swap and
* migrate the COLs. The core table is
- * @%BBPcache@ which contains a pointer to the COL descriptor with its heaps.
+ * @%CBPcache@ which contains a pointer to the COL descriptor with its heaps.
* A zero entry means that the file resides on disk. Otherwise it has been read
* or mapped into memory.
* @
* COLs loaded into memory are retained in a COL buffer pool. They
* retain their position within the cache during their life cycle, which
* make indexing COLs a stable operation. Their descriptor can be
- * obtained using @%BBPcacheid@.
+ * obtained using @%CBPcacheid@.
* @
- * The @%BBPindex@ routine checks if a COL with a certain name is
+ * The @%CBPindex@ routine checks if a COL with a certain name is
* registered in the buffer pools. If so, it returns its COL id.
* The @%COLdescriptor@ routine has a COL id parameter, and returns
* a pointer to the corresponding COL record (after incrementing the reference
* count). The COL will be loaded into memory, if necessary.
* @
- * The structure of the BBP file obeys the tuple format for GDK.
+ * The structure of the CBP file obeys the tuple format for GDK.
*
* The status and COL persistency information is encoded in the status field.
*/
@@ -1807,64 +1807,64 @@
COL *b; /* if loaded: COL* handle */
str nme; /* logical name */
str bak; /* logical name backups */
- bat next; /* next BBP slot in link list */
+ bat next; /* next CBP slot in link list */
COL *cache; /* cached header info */
str path; /* dir + basename for storage */
str options; /* A string list of options */
int refs; /* in-memory references on which the loaded
status of a COL relies */
int lrefs; /* logical references on which the existence of
a COL relies */
- int lastused; /* BBP LRU stamp */
+ int lastused; /* CBP LRU stamp */
volatile int status; /* status mask used for spin locking */
/* MT_Id pid; non-zero thread-id if this COL is private */
-} BBPrec;
+} CBPrec;
-gdk_export bat BBPmaxsize;
-gdk_export bat BBPlimit;
-gdk_export int BBP_dirty; /* BBP table dirty? */
-gdk_export BBPrec *BBP;
+gdk_export bat CBPmaxsize;
+gdk_export bat CBPlimit;
+gdk_export int CBP_dirty; /* CBP table dirty? */
+gdk_export CBPrec *CBP;
/* fast defines without checks; internal use only */
-#define BBP_cache(i) BBP[i].b
-#define BBP_logical(i) BBP[i].nme
-#define BBP_next(i) BBP[i].next
-#define BBP_physical(i) BBP[i].path
-#define BBP_options(i) BBP[i].options
-#define BBP_desc(i) BBP[i].cache
-#define BBP_refs(i) BBP[i].refs
-#define BBP_lrefs(i) BBP[i].lrefs
-#define BBP_lastused(i) BBP[i].lastused
-#define BBP_status(i) BBP[i].status
-#define BBP_pid(i) BBP[i].pid
+#define CBP_cache(i) CBP[i].b
+#define CBP_logical(i) CBP[i].nme
+#define CBP_next(i) CBP[i].next
+#define CBP_physical(i) CBP[i].path
+#define CBP_options(i) CBP[i].options
+#define CBP_desc(i) CBP[i].cache
+#define CBP_refs(i) CBP[i].refs
+#define CBP_lrefs(i) CBP[i].lrefs
+#define CBP_lastused(i) CBP[i].lastused
+#define CBP_status(i) CBP[i].status
+#define CBP_pid(i) CBP[i].pid
/* macros that nicely check parameters */
-#define BBPdirty(x) (BBP_dirty=(x))
-#define BBPcacheid(b) ((b)->batCacheid)
-#define BBPstatus(i) (BBPcheck((i),"BBPstatus")?BBP_status(i):-1)
-#define BBPcurstamp() BBP_curstamp
-#define BBPrefs(i) (BBPcheck((i),"BBPrefs")?BBP_refs(i):-1)
-#define BBPcache(i) (BBPcheck((i),"BBPcache")?BBP_cache(i):(COL*) NULL)
-#define BBPname(i) (BBPcheck((i),"BBPname")?((i) > 0 ||
BBP_logical(i))?BBP_logical(i):BBP_logical(-(i)):"")
-#define BBPvalid(i) (BBP_logical(i) != NULL && *BBP_logical(i) != '.')
-#define COLgetId(b) BBPname((b)->batCacheid)
-#define BBPfix(i) BBPincref((i), FALSE)
-#define BBPunfix(i) BBPdecref((i), FALSE)
+#define CBPdirty(x) (CBP_dirty=(x))
+#define CBPcacheid(b) ((b)->batCacheid)
+#define CBPstatus(i) (CBPcheck((i),"CBPstatus")?CBP_status(i):-1)
+#define CBPcurstamp() CBP_curstamp
+#define CBPrefs(i) (CBPcheck((i),"CBPrefs")?CBP_refs(i):-1)
+#define CBPcache(i) (CBPcheck((i),"CBPcache")?CBP_cache(i):(COL*) NULL)
+#define CBPname(i) (CBPcheck((i),"CBPname")?((i) > 0 ||
CBP_logical(i))?CBP_logical(i):CBP_logical(-(i)):"")
+#define CBPvalid(i) (CBP_logical(i) != NULL && *CBP_logical(i) != '.')
+#define COLgetId(b) CBPname((b)->batCacheid)
+#define CBPfix(i) CBPincref((i), FALSE)
+#define CBPunfix(i) CBPdecref((i), FALSE)
-#define BBPRENAME_ALREADY (-1)
-#define BBPRENAME_ILLEGAL (-2)
-#define BBPRENAME_LONG (-3)
+#define CBPRENAME_ALREADY (-1)
+#define CBPRENAME_ILLEGAL (-2)
+#define CBPRENAME_LONG (-3)
-gdk_export void BBPlock(const char *s);
+gdk_export void CBPlock(const char *s);
-gdk_export void BBPhot(bat b);
-gdk_export void BBPcold(bat b);
-gdk_export void BBPtrim(size_t memdelta, size_t vmdelta);
-gdk_export void BBPunlock(const char *s);
+gdk_export void CBPhot(bat b);
+gdk_export void CBPcold(bat b);
+gdk_export void CBPtrim(size_t memdelta, size_t vmdelta);
+gdk_export void CBPunlock(const char *s);
-gdk_export str BBPlogical(bat b, str buf);
-gdk_export str BBPphysical(bat b, str buf);
-gdk_export int BBP_curstamp;
-gdk_export COL *BBPgetdesc(bat i);
-gdk_export COL *BBPquickdesc(bat b, int delaccess);
+gdk_export str CBPlogical(bat b, str buf);
+gdk_export str CBPphysical(bat b, str buf);
+gdk_export int CBP_curstamp;
+gdk_export COL *CBPgetdesc(bat i);
+gdk_export COL *CBPquickdesc(bat b, int delaccess);
/*
*
@@ -2322,8 +2322,8 @@
#define strdup _strdup
#endif
-#define BBP_BATMASK 511
-#define BBP_THREADMASK 63
+#define CBP_BATMASK 511
+#define CBP_THREADMASK 63
typedef struct {
MT_Lock swap;
@@ -2336,14 +2336,14 @@
bat free;
} bbplock_t;
-#define GDKswapLock(x) GDKbatLock[(x&BBP_BATMASK)].swap
-#define GDKhashLock(x) GDKbatLock[(x&BBP_BATMASK)].hash
-#define GDKtrimLock(y) GDKbbpLock[(y&BBP_THREADMASK)].trim
-#define GDKcacheLock(y) GDKbbpLock[(y&BBP_THREADMASK)].alloc
-#define BBP_free(y) GDKbbpLock[(y&BBP_THREADMASK)].free
+#define GDKswapLock(x) GDKbatLock[(x&CBP_BATMASK)].swap
+#define GDKhashLock(x) GDKbatLock[(x&CBP_BATMASK)].hash
+#define GDKtrimLock(y) GDKbbpLock[(y&CBP_THREADMASK)].trim
+#define GDKcacheLock(y) GDKbbpLock[(y&CBP_THREADMASK)].alloc
+#define CBP_free(y) GDKbbpLock[(y&CBP_THREADMASK)].free
-gdk_export batlock_t GDKbatLock[BBP_BATMASK + 1];
-gdk_export bbplock_t GDKbbpLock[BBP_THREADMASK + 1];
+gdk_export batlock_t GDKbatLock[CBP_BATMASK + 1];
+gdk_export bbplock_t GDKbbpLock[CBP_THREADMASK + 1];
gdk_export MT_Lock GDKnameLock;
gdk_export MT_Lock GDKthreadLock;
gdk_export MT_Lock GDKunloadLock;
@@ -2512,11 +2512,11 @@
/* #endif */
static inline bat
-BBPcheck(register bat x, register const char *y)
+CBPcheck(register bat x, register const char *y)
{
assert(x >= 0 || x == bat_nil);
if (x && x != bat_nil) {
- if (x >= BBPsize || BBP[x].nme == NULL) {
+ if (x >= CBPsize || CBP[x].nme == NULL) {
CHECKDEBUG THRprintf(GDKout, "#%s: range error %d\n",
y, (int) x);
} else {
return x;
@@ -2530,11 +2530,11 @@
{
register COL *b = NULL;
- if (BBPcheck(i, "COLdescriptor")) {
- BBPfix(i);
- b = BBP_cache(i);
+ if (CBPcheck(i, "COLdescriptor")) {
+ CBPfix(i);
+ b = CBP_cache(i);
if (b == NULL)
- b = BBPdescriptor(i);
+ b = CBPdescriptor(i);
}
return b;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list