Changeset: 5b4f4310903b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5b4f4310903b
Modified Files:
gdk/Makefile.ag
gdk/gdk_logger.c
gdk/gdk_logger.h
gdk/gdk_logger.mx
monetdb5/extras/compiler/Makefile.ag
monetdb5/extras/compiler/mal_compiler.c
monetdb5/extras/compiler/mal_compiler.h
monetdb5/extras/compiler/mal_compiler.mal
monetdb5/extras/compiler/mal_compiler.mx
monetdb5/extras/sphinx/Makefile.ag
monetdb5/extras/sphinx/sphinx.c
monetdb5/extras/sphinx/sphinx.h
monetdb5/extras/sphinx/sphinx.mal
monetdb5/extras/sphinx/sphinx.mx
monetdb5/modules/kernel/Makefile.ag
monetdb5/modules/kernel/alarm.c
monetdb5/modules/kernel/alarm.h
monetdb5/modules/kernel/alarm.mx
monetdb5/modules/kernel/logger.c
monetdb5/modules/kernel/logger.mal
monetdb5/modules/kernel/logger.mx
monetdb5/modules/kernel/microbenchmark.c
monetdb5/modules/kernel/microbenchmark.h
monetdb5/modules/kernel/microbenchmark.mal
monetdb5/modules/kernel/microbenchmark.mx
monetdb5/optimizer/Makefile.ag
monetdb5/optimizer/opt_pipes.c
monetdb5/optimizer/opt_pipes.h
monetdb5/optimizer/opt_pipes.mx
monetdb5/scheduler/Makefile.ag
monetdb5/scheduler/run_memo.c
monetdb5/scheduler/run_memo.h
monetdb5/scheduler/run_memo.mal
monetdb5/scheduler/run_memo.mx
monetdb5/scheduler/run_octopus.c
monetdb5/scheduler/run_octopus.h
monetdb5/scheduler/run_octopus.mal
monetdb5/scheduler/run_octopus.mx
sql/backends/monet5/Makefile.ag
sql/backends/monet5/sql_bpm.c
sql/backends/monet5/sql_bpm.h
sql/backends/monet5/sql_bpm.mal
sql/backends/monet5/sql_bpm.mx
sql/backends/monet5/sql_emptyset.c
sql/backends/monet5/sql_emptyset.h
sql/backends/monet5/sql_emptyset.mx
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_gencode.h
sql/backends/monet5/sql_gencode.mx
sql/backends/monet5/sql_optimizer.c
sql/backends/monet5/sql_optimizer.h
sql/backends/monet5/sql_optimizer.mx
sql/backends/monet5/sql_user.c
sql/backends/monet5/sql_user.h
sql/backends/monet5/sql_user.mx
sql/backends/monet5/vaults/Makefile.ag
sql/backends/monet5/vaults/fits.c
sql/backends/monet5/vaults/fits.h
sql/backends/monet5/vaults/fits.mal
sql/backends/monet5/vaults/fits.mx
sql/backends/monet5/vaults/mseed.c
sql/backends/monet5/vaults/mseed.h
sql/backends/monet5/vaults/mseed.mal
sql/backends/monet5/vaults/mseed.mx
Branch: headless
Log Message:
Split all .mx files that don't use MX macros into constituent files.
diffs (truncated from 6571 to 300 lines):
diff --git a/gdk/Makefile.ag b/gdk/Makefile.ag
--- a/gdk/Makefile.ag
+++ b/gdk/Makefile.ag
@@ -22,7 +22,7 @@
gdk_scanselect_CFLAGS = $(NO_INLINE_CFLAGS)
# gdk_relop.mx
-EXTRA_DIST = gdk_scanselect_defs.mx
+EXTRA_DIST = gdk_scanselect_defs.mx gdk_logger.h
lib_gdk = {
VERSION = $(GDK_VERSION)
@@ -53,4 +53,4 @@
$(MALLOC_LIBS) $(PTHREAD_LIBS) $(DL_LIBS)
}
-EXTRA_DIST = gdk.h gdk_bbp.h gdk_delta.h gdk_posix.h gdk_qsort_impl.h
gdk_ssort_impl.h gdk_storage.h gdk_system.h gdk_tm.h gdk_utils.h
+EXTRA_DIST = gdk.h gdk_bbp.h gdk_delta.h gdk_posix.h gdk_qsort_impl.h
gdk_ssort_impl.h gdk_storage.h gdk_system.h gdk_tm.h gdk_utils.h gdk_logger.h
diff --git a/gdk/gdk_logger.mx b/gdk/gdk_logger.c
rename from gdk/gdk_logger.mx
rename to gdk/gdk_logger.c
--- a/gdk/gdk_logger.mx
+++ b/gdk/gdk_logger.c
@@ -1,188 +1,84 @@
-@/
-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://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
+/*
+ * 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://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
+ *
+ * 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-2011 MonetDB B.V.
+ * All Rights Reserved.
+ */
-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-2011 MonetDB B.V.
-All Rights Reserved.
-@
-
-@f gdk_logger
-@t Transactions
-@a N. J. Nes
-@v 2.0
-
-@* Introduction
-In the philosophy of MonetDB, transaction management overhead should only
-be paid when necessary. Transaction management is for this purpose
-implemented as a separate module and applications are required to
-obey the transaction policy, e.g. obtaining/releasing locks.
-
-This module is designed to support efficient logging of the SQL database.
-Once loaded, the SQL compiler will insert the proper calls at
-transaction commit to include the changes in the log file.
-
-The logger uses a directory to store its log files. One master log file
-stores information about the version of the logger and the transaction
-log files. This file is a simple ascii file with the following format:
- @code{6DIGIT-VERSION\n[log file number \n]*]*}
-The transaction log files have a binary format, which stores fixed size
-logformat headers (flag,nr,bid), where the flag is the type of update logged.
-The nr field indicates how many changes there were (in case of
inserts/deletes).
-The bid stores the bid identifier.
-
-The key decision to be made by the user is the location of the log file.
-Ideally, it should be stored in fail-safe environment, or at least
-the log and databases should be on separate disk columns.
-
-This file system may reside on the same hardware as the database server
-and therefore the writes are done to the same disk, but could also
-reside on another system and then the changes are flushed through the network.
-The logger works under the assumption that it is called to safeguard
-updates on the database when it has an exclusive lock on
-the latest version. This lock should be guaranteed by the calling
-transaction manager first.
-
-Finding the updates applied to a COL is relatively easy, because each
-COL contains a delta structure. On commit these changes are
-written to the log file and the delta management is reset. Since each
-commit is written to the same log file, the beginning and end are
-marked by a log identifier.
-
-A server restart should only (re)process blocks which are completely
-written to disk. A log replay therefore ends in a commit or abort on
-the changed bats. Once all logs have been read, the changes to
-the bats are made persistent, i.e. a bbp sub-commit is done.
-
-@{
-@* Implementation Code
-@h
-#ifndef _LOGGER_H_
-#define _LOGGER_H_
-
-#define LOG_OK 0
-#define LOG_ERR (-1)
-
-#include <gdk.h>
-
-typedef struct logaction {
- int type; /* type of change */
- int nr;
- int ht; /* vid(-1),void etc */
- int tt;
- lng id;
- char *name; /* optional */
- COL *b; /* temporary bat with changes */
-} logaction;
-
-/* during the recover process a number of transactions could be active */
-typedef struct trans {
- int tid; /* transaction id */
- int sz; /* sz of the changes array */
- int nr; /* nr of changes */
-
- logaction *changes;
-
- struct trans *tr;
-} trans;
-
-typedef int (*precommit_fptr)(char *qid, char *cid);
-typedef int (*preversionfix_fptr)(int oldversion, int newversion);
-typedef void (*postversionfix_fptr)(void *lg);
-
-typedef struct logger {
- int debug;
- size_t changes;
- int version;
- lng id;
- int tid;
- char *fn;
- char *dir;
- precommit_fptr phandler;
- preversionfix_fptr prefuncp;
- postversionfix_fptr postfuncp;
- stream *log;
- lng end; /* end of pre-allocated blocks for faster
f(data)sync */
- /* Store log_bids (int) to circumvent trouble with reference counting */
- COL *catalog; /* int, str */
- COL *seqs; /* int, lng */
- COL *snapshots; /* int, int the bid and tid of snapshot bat */
- COL *freed; /* snapshots can be created and destroyed,
- in a single logger transaction.
- These snapshot bats should be freed
- directly (on transaction
- commit). */
-} logger;
-
-#define COLSIZE 0
-
-typedef int log_bid;
-
-@+ Sequence numbers
-The logger also keeps sequence numbers. A sequence needs to store each
-requested (block) of sequence numbers. This is done using the log_sequence
-function. The logger_sequence function can be used to return the
-last logged sequence number. Sequences identifiers should be unique, and
-2 are already used. The first LOG_SID is used internally for the log files
-sequence. The second OBJ_SID is for frontend objects, for example the sql
-objects have a global sequence counter such that each table, trigger, sequence
-etc. has a unique number.
-@h
-/* the sequence identifier for the sequence of log files */
-#define LOG_SID 0
-/* the sequence identifier for frontend objects */
-#define OBJ_SID 1
-
-gdk_export logger *logger_create(int debug, char *fn, char *logdir, char
*dbname, int version, precommit_fptr phandler, preversionfix_fptr prefuncp,
postversionfix_fptr postfuncp);
-gdk_export void logger_destroy(logger *lg);
-gdk_export int logger_exit(logger *lg);
-gdk_export int logger_restart(logger *lg);
-gdk_export int logger_cleanup(logger *lg);
-gdk_export size_t logger_changes(logger *lg);
-gdk_export int logger_sequence(logger *lg, int seq, lng *id);
-
-/* todo pass the transaction id */
-gdk_export int log_bat(logger *lg, COL *b, char *n);
-gdk_export int log_bat_clear(logger *lg, char *n);
-gdk_export int log_bat_persists(logger *lg, COL *b, char *n);
-gdk_export int log_bat_transient(logger *lg, char *n);
-gdk_export int log_delta(logger *lg, COL *b, char *n);
-
-gdk_export int log_tstart(logger *lg); /* TODO return transaction id */
-gdk_export int log_tend(logger *lg);
-gdk_export int log_tend_extra(logger *lg, COL *extra);
-gdk_export int log_abort(logger *lg);
-gdk_export int log_precommit(logger *lg, char *qid, char *cid);
-
-gdk_export int log_sequence(logger *lg, int seq, lng id);
-
-gdk_export log_bid logger_add_bat(logger *lg, COL *b, char *name);
-gdk_export void logger_del_bat(logger *lg, log_bid bid);
-gdk_export log_bid logger_find_bat(logger *lg, char *name);
-
-#endif /*_LOGGER_H_*/
-@c
+/*
+ * @f gdk_logger
+ * @t Transactions
+ * @a N. J. Nes
+ * @v 2.0
+ *
+ * @* Introduction
+ * In the philosophy of MonetDB, transaction management overhead should only
+ * be paid when necessary. Transaction management is for this purpose
+ * implemented as a separate module and applications are required to
+ * obey the transaction policy, e.g. obtaining/releasing locks.
+ *
+ * This module is designed to support efficient logging of the SQL database.
+ * Once loaded, the SQL compiler will insert the proper calls at
+ * transaction commit to include the changes in the log file.
+ *
+ * The logger uses a directory to store its log files. One master log file
+ * stores information about the version of the logger and the transaction
+ * log files. This file is a simple ascii file with the following format:
+ * @code{6DIGIT-VERSION\n[log file number \n]*]*}
+ * The transaction log files have a binary format, which stores fixed size
+ * logformat headers (flag,nr,bid), where the flag is the type of update
logged.
+ * The nr field indicates how many changes there were (in case of
inserts/deletes).
+ * The bid stores the bid identifier.
+ *
+ * The key decision to be made by the user is the location of the log file.
+ * Ideally, it should be stored in fail-safe environment, or at least
+ * the log and databases should be on separate disk columns.
+ *
+ * This file system may reside on the same hardware as the database server
+ * and therefore the writes are done to the same disk, but could also
+ * reside on another system and then the changes are flushed through the
network.
+ * The logger works under the assumption that it is called to safeguard
+ * updates on the database when it has an exclusive lock on
+ * the latest version. This lock should be guaranteed by the calling
+ * transaction manager first.
+ *
+ * Finding the updates applied to a COL is relatively easy, because each
+ * COL contains a delta structure. On commit these changes are
+ * written to the log file and the delta management is reset. Since each
+ * commit is written to the same log file, the beginning and end are
+ * marked by a log identifier.
+ *
+ * A server restart should only (re)process blocks which are completely
+ * written to disk. A log replay therefore ends in a commit or abort on
+ * the changed bats. Once all logs have been read, the changes to
+ * the bats are made persistent, i.e. a bbp sub-commit is done.
+ *
+ * @* Implementation Code
+ */
#include "monetdb_config.h"
#include "gdk_logger.h"
#include <string.h>
-@-
-The log record encoding is geared at reduced storage space, but
-at the expense of readability. A user can not easily inspect the
-log a posteriori to check what has happened.
-
-@c
+/*
+ * @-
+ * The log record encoding is geared at reduced storage space, but
+ * at the expense of readability. A user can not easily inspect the
+ * log a posteriori to check what has happened.
+ *
+ */
#define LOG_START 1
#define LOG_END 2
#define LOG_PRECOMMIT 11
@@ -921,10 +817,11 @@
return 0;
}
-@-
-The log files are incrementally numbered. They are processed in the
-same sequence.
-@c
+/*
+ * @-
+ * The log files are incrementally numbered. They are processed in the
+ * same sequence.
+ */
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list