Changeset: c9e3d141db73 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c9e3d141db73
Removed Files:
gdk/gdk_atoms.h
Modified Files:
clients/Tests/exports.stable.out
gdk/gdk.h
gdk/gdk_atoms.c
gdk/gdk_private.h
sql/backends/monet5/rel_bin.c
sql/backends/monet5/rel_physical.c
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_upgrades.c
sql/backends/monet5/vaults/netcdf/netcdf.c
sql/server/rel_optimize_proj.c
sql/server/rel_optimize_sel.c
sql/server/rel_statistics.c
tools/mserver/mserver5.c
Branch: nested
Log Message:
Merge with default branch.
diffs (truncated from 6509 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
@@ -922,6 +922,7 @@ const char dblRef[];
void debugFunction(stream *fd, MalBlkPtr mb, MalStkPtr stk, int flg, int
first, int size);
const char decompressRef[];
int defConstant(MalBlkPtr mb, int type, ValPtr cst);
+bool default_oahash_enabled;
const char defaultpipeRef[];
const char defineRef[];
void delArgument(InstrPtr p, int varid);
diff --git a/gdk/CMakeLists.txt b/gdk/CMakeLists.txt
--- a/gdk/CMakeLists.txt
+++ b/gdk/CMakeLists.txt
@@ -10,26 +10,8 @@
set(gdk_public_headers
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gdk.h>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gdk_system.h>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gdk_posix.h>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gdk_atoms.h>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gdk_tracer.h>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gdk_hash.h>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gdk_bbp.h>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gdk_utils.h>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gdk_cand.h>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gdk_calc.h>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/gdk_time.h>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monetdb/gdk.h>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monetdb/gdk_system.h>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monetdb/gdk_posix.h>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monetdb/gdk_atoms.h>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monetdb/gdk_tracer.h>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monetdb/gdk_hash.h>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monetdb/gdk_bbp.h>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monetdb/gdk_utils.h>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monetdb/gdk_calc.h>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monetdb/gdk_cand.h>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/monetdb/gdk_time.h>)
if(MONETDB_STATIC)
@@ -46,19 +28,19 @@ target_sources(bat
gdk_calc_compare_lt.c gdk_calc_compare_gt.c
gdk_calc_compare_le.c gdk_calc_compare_ge.c
gdk_calc_compare_generic.c
- gdk_calc.c gdk_calc.h
+ gdk_calc.c
gdk_ssort.c gdk_ssort_impl.h
gdk_aggr.c
gdk_batop.c
- gdk_cand.h gdk_cand.c
+ gdk_cand.c
gdk_search.c
- gdk_hash.c gdk_hash.h
+ gdk_hash.c
gdk_tm.c
gdk_orderidx.c
gdk_align.c
- gdk_bbp.c gdk_bbp.h
+ gdk_bbp.c
gdk_heap.c
- gdk_utils.c gdk_utils.h
+ gdk_utils.c
gdk_atoms.c
gdk_string.c
gdk_qsort.c
@@ -87,7 +69,7 @@ target_sources(bat
gdk_analytic_statistics.c
gdk_analytic_func.c
gdk_analytic.h
- gdk_tracer.c gdk_tracer.h
+ gdk_tracer.c
gdk_rtree.c
gdk_strimps.c
gdk_sketch.c
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -30,6 +30,7 @@
#include <float.h>
#include <inttypes.h>
#include <limits.h>
+#include <math.h>
#include <setjmp.h>
#include <stdarg.h>
#include <stdbool.h>
@@ -56,6 +57,81 @@
# include <dirent.h>
#endif
+#ifdef HAVE_PTHREAD_H
+/* don't re-include config.h; on Windows, don't redefine pid_t in an
+ * incompatible way */
+#undef HAVE_CONFIG_H
+#ifdef pid_t
+#undef pid_t
+#endif
+#include <sched.h>
+#include <pthread.h>
+#endif
+
+#ifdef HAVE_SEMAPHORE_H
+# include <semaphore.h>
+#endif
+
+#ifdef HAVE_DISPATCH_DISPATCH_H
+#include <dispatch/dispatch.h>
+#endif
+
+#ifdef HAVE_SYS_PARAM_H
+# include <sys/param.h> /* prerequisite of sys/sysctl on OpenBSD */
+#endif
+#ifdef BSD /* BSD macro is defined in sys/param.h */
+# include <sys/sysctl.h>
+#endif
+
+#include <sys/types.h>
+
+#ifdef HAVE_FTIME
+#include <sys/timeb.h> /* ftime */
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h> /* gettimeofday */
+#endif
+
+#ifndef HAVE_SYS_SOCKET_H
+#ifdef HAVE_WINSOCK_H
+#include <winsock.h> /* for timeval */
+#endif
+#endif
+
+#ifdef NATIVE_WIN32
+#include <io.h>
+#include <direct.h>
+#endif
+
+/* make sure POSIX_MADV_* and posix_madvise() are defined somehow */
+#ifdef HAVE_SYS_MMAN_H
+# ifndef __USE_BSD
+# define __USE_BSD
+# endif
+# include <sys/mman.h>
+#endif
+
+#ifdef __APPLE__
+/* the compiler on the Mac can't deal with including xxhash.h twice
+ * because of identical redefinitions of types and we happen to know
+ * that the xxhash version is high enough, so just define the magic
+ * inline token and include the file only once */
+#define XXH_INLINE_ALL
+#endif
+
+#include <xxhash.h>
+
+#ifndef __APPLE__
+#if XXH_VERSION_NUMBER >= 0*100*100 + 8*100 + 0 /* at least 0.8.0 */
+/* in newer versions, we can define XXH_INLINE_ALL to inline all hash
+ * functions before including xxhash.h again (we didn't need the first
+ * include, except we need the version number to make the
+ * distinction) */
+#define XXH_INLINE_ALL
+#include <xxhash.h>
+#endif
+#endif
+
#include "stream.h"
#include "mstring.h"
#include "matomic.h"
@@ -116,9 +192,1027 @@ typedef struct allocator_state {
allocator *ma;
} allocator_state;
-#include "gdk_tracer.h"
-#include "gdk_system.h"
-#include "gdk_posix.h"
+/* // TODO: Complete it when documentation is accepted
+ *
+ * Tracer is the general logging system for the MonetDB stack modelled
+ * after the well-known logging schemes (e.g: Python). It provides a
+ * number of logging levels and options to increase or reduce the
+ * verbosity either of individual code parts or of the codebase as a
+ * whole. It allows users to focus on logging messages related to
+ * certain steps of execution, which can be proved handy when it comes
+ * to debugging. The behavior of Tracer can be controlled at runtime
+ * using the SQL API described later on. Certain calls require an "id"
+ * to operate which can be found on the list of each section below.
+ *
+ * Internally, the logger uses a buffer to capture log messages before
+ * they are forwarded to the specific adapter.
+ *
+ * - Sets the minimum flush level that an event will trigger the
+ * logger to flush the buffer
+ * - Produces messages to the output stream. It is also used as a
+ * fallback mechanism in case GDKtracer fails to log for whatever
+ * reason.
+ * - Struct buffer with allocated space etc.
+ * - Flush buffer sends the messages to the selected adapter
+ * - Write about the log structure (e.g: MT_thread_get_name + datetime
+ * + blah blah)
+ */
+
+#define TRC_NAME(TOKEN) TRC_##TOKEN
+
+#define TRC_GENERATE_ENUM(ENUM) TRC_NAME(ENUM),
+
+
+// ADAPTERS
+#define TRC_FOREACH_ADPTR(ADPTR) \
+ ADPTR( BASIC ) \
+ ADPTR( PROFILER ) \
+ ADPTR( MBEDDED ) \
+ \
+ ADPTR( ADAPTERS_COUNT )
+
+typedef enum {
+ TRC_FOREACH_ADPTR(TRC_GENERATE_ENUM)
+} adapter_t;
+
+
+
+// LOG LEVELS
+#define TRC_FOREACH_LEVEL(LEVEL) \
+ LEVEL( M_CRITICAL ) \
+ LEVEL( M_ERROR ) \
+ LEVEL( M_WARNING ) \
+ LEVEL( M_INFO ) \
+ LEVEL( M_DEBUG ) \
+ \
+ LEVEL( LOG_LEVELS_COUNT )
+
+typedef enum {
+ TRC_FOREACH_LEVEL(TRC_GENERATE_ENUM)
+} log_level_t;
+
+
+// LAYERS
+#define TRC_FOREACH_LAYER(LAYER) \
+ LAYER( MDB_ALL ) \
+ LAYER( SQL_ALL ) \
+ LAYER( MAL_ALL ) \
+ LAYER( GDK_ALL ) \
+ \
+ LAYER( LAYERS_COUNT )
+
+typedef enum {
+ TRC_FOREACH_LAYER(TRC_GENERATE_ENUM)
+} layer_t;
+
+
+
+
+// COMPONENTS
+#define TRC_FOREACH_COMP(COMP) \
+ COMP( ACCELERATOR ) \
+ COMP( ALGO ) \
+ COMP( ALLOC ) \
+ COMP( BAT ) \
+ COMP( CHECK ) \
+ COMP( DELTA ) \
+ COMP( HEAP ) \
+ COMP( IO ) \
+ COMP( WAL ) \
+ COMP( PAR ) \
+ COMP( PERF ) \
+ COMP( TEM ) \
+ COMP( THRD ) \
+ COMP( TM ) \
+ \
+ COMP( GEOM ) \
+ COMP( FITS ) \
+ COMP( SHP ) \
+ COMP( PARQUET ) \
+ \
+ COMP( LOADER ) \
+ \
+ COMP( SQL_PARSER ) \
+ COMP( SQL_TRANS ) \
+ COMP( SQL_REWRITER ) \
+ COMP( SQL_EXECUTION ) \
+ COMP( SQL_STORE ) \
+ \
+ COMP( MAL_REMOTE ) \
+ COMP( MAL_MAPI ) \
+ COMP( MAL_SERVER ) \
+ COMP( MAL_LOADER ) \
+ COMP( MAL_INSTRUCTION ) \
+ \
+ COMP( MAL_OPTIMIZER ) \
+ \
+ COMP( GDK ) \
+ \
+ COMP( COMPONENTS_COUNT )
+
+typedef enum {
+ TRC_FOREACH_COMP(TRC_GENERATE_ENUM)
+} component_t;
+
+#undef TRC_GENERATE_ENUM
+
+
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]