Commit 0399d06d authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#4682 remove cilkarts code from the loader. refs[t:4682]

git-svn-id: file:///svn/toku/tokudb@42090 c7de825b-a66e-492c-adef-691d508d4ae1
parent 1a382c07
...@@ -6,12 +6,9 @@ ...@@ -6,12 +6,9 @@
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include <c_dialects.h>
#include <brttypes.h> #include <brttypes.h>
#include "cachetable.h" #include "cachetable.h"
C_BEGIN
/** /**
* Put an empty node (that is, no fields filled) into the cachetable. * Put an empty node (that is, no fields filled) into the cachetable.
* In the process, write dependent nodes out for checkpoint if * In the process, write dependent nodes out for checkpoint if
...@@ -129,6 +126,4 @@ toku_unpin_brtnode(BRT brt, BRTNODE node); ...@@ -129,6 +126,4 @@ toku_unpin_brtnode(BRT brt, BRTNODE node);
void void
toku_unpin_brtnode_read_only(BRT brt, BRTNODE node); toku_unpin_brtnode_read_only(BRT brt, BRTNODE node);
C_END
#endif #endif
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include <brttypes.h> #include <brttypes.h>
#include <c_dialects.h>
C_BEGIN
#define ft_flush_before_applying_inbox 1 #define ft_flush_before_applying_inbox 1
#define ft_flush_before_child_pin 2 #define ft_flush_before_child_pin 2
...@@ -161,6 +158,5 @@ default_pick_child_after_split(struct brt_header *h, ...@@ -161,6 +158,5 @@ default_pick_child_after_split(struct brt_header *h,
int childnumb, int childnumb,
void *extra); void *extra);
C_END
#endif // End of header guardian. #endif // End of header guardian.
...@@ -7,9 +7,6 @@ ...@@ -7,9 +7,6 @@
// This must be first to make the 64-bit file mode work right in Linux // This must be first to make the 64-bit file mode work right in Linux
#include <brttypes.h> #include <brttypes.h>
#include <c_dialects.h>
C_BEGIN
typedef enum { typedef enum {
BRT_FLUSHER_CLEANER_TOTAL_NODES = 0, // total number of nodes whose buffers are potentially flushed by cleaner thread BRT_FLUSHER_CLEANER_TOTAL_NODES = 0, // total number of nodes whose buffers are potentially flushed by cleaner thread
...@@ -146,6 +143,4 @@ toku_brt_hot_optimize(BRT brt, ...@@ -146,6 +143,4 @@ toku_brt_hot_optimize(BRT brt,
int (*progress_callback)(void *extra, float progress), int (*progress_callback)(void *extra, float progress),
void *progress_extra); void *progress_extra);
C_END
#endif // End of header guardian. #endif // End of header guardian.
...@@ -25,14 +25,11 @@ ...@@ -25,14 +25,11 @@
#include "omt.h" #include "omt.h"
#include "leafentry.h" #include "leafentry.h"
#include "block_table.h" #include "block_table.h"
#include "c_dialects.h"
#include "mempool.h" #include "mempool.h"
#include "compress.h" #include "compress.h"
// Uncomment the following to use quicklz // Uncomment the following to use quicklz
C_BEGIN
#ifndef BRT_FANOUT #ifndef BRT_FANOUT
#define BRT_FANOUT 16 #define BRT_FANOUT 16
#endif #endif
...@@ -969,6 +966,4 @@ void toku_flusher_thread_set_callback(void (*callback_f)(int, void*), void* extr ...@@ -969,6 +966,4 @@ void toku_flusher_thread_set_callback(void (*callback_f)(int, void*), void* extr
void toku_brt_header_note_hot_begin(BRT brt); void toku_brt_header_note_hot_begin(BRT brt);
void toku_brt_header_note_hot_complete(BRT brt, BOOL success, MSN msn_at_start_of_hot); void toku_brt_header_note_hot_complete(BRT brt, BOOL success, MSN msn_at_start_of_hot);
C_END
#endif #endif
...@@ -13,11 +13,8 @@ ...@@ -13,11 +13,8 @@
#include "cachetable.h" #include "cachetable.h"
#include "log.h" #include "log.h"
#include "brt-search.h" #include "brt-search.h"
#include "c_dialects.h"
#include "compress.h" #include "compress.h"
C_BEGIN
// A callback function is invoked with the key, and the data. // A callback function is invoked with the key, and the data.
// The pointers (to the bytevecs) must not be modified. The data must be copied out before the callback function returns. // The pointers (to the bytevecs) must not be modified. The data must be copied out before the callback function returns.
// Note: In the thread-safe version, the brt node remains locked while the callback function runs. So return soon, and don't call the BRT code from the callback function. // Note: In the thread-safe version, the brt node remains locked while the callback function runs. So return soon, and don't call the BRT code from the callback function.
...@@ -314,6 +311,4 @@ int toku_brt_strerror_r(int error, char *buf, size_t buflen); ...@@ -314,6 +311,4 @@ int toku_brt_strerror_r(int error, char *buf, size_t buflen);
extern BOOL garbage_collection_debug; extern BOOL garbage_collection_debug;
C_END
#endif #endif
...@@ -113,7 +113,3 @@ int brt_loader_call_poll_function(brtloader_poll_callback p, float progress) { ...@@ -113,7 +113,3 @@ int brt_loader_call_poll_function(brtloader_poll_callback p, float progress) {
r = p->poll_function(p->poll_extra, progress); r = p->poll_function(p->poll_extra, progress);
return r; return r;
} }
#if defined(__cplusplus) || defined(__cilkplusplus)
}
#endif
...@@ -10,9 +10,6 @@ ...@@ -10,9 +10,6 @@
#include "queue.h" #include "queue.h"
#include "toku_pthread.h" #include "toku_pthread.h"
#include "dbufio.h" #include "dbufio.h"
#include "c_dialects.h"
C_BEGIN
/* These functions are exported to allow the tests to compile. */ /* These functions are exported to allow the tests to compile. */
...@@ -202,13 +199,10 @@ int merge_row_arrays_base (struct row dest[/*an+bn*/], struct row a[/*an*/], int ...@@ -202,13 +199,10 @@ int merge_row_arrays_base (struct row dest[/*an+bn*/], struct row a[/*an*/], int
int merge_files (struct merge_fileset *fs, BRTLOADER bl, int which_db, DB *dest_db, brt_compare_func, int progress_allocation, QUEUE); int merge_files (struct merge_fileset *fs, BRTLOADER bl, int which_db, DB *dest_db, brt_compare_func, int progress_allocation, QUEUE);
CILK_BEGIN
int sort_and_write_rows (struct rowset rows, struct merge_fileset *fs, BRTLOADER bl, int which_db, DB *dest_db, brt_compare_func); int sort_and_write_rows (struct rowset rows, struct merge_fileset *fs, BRTLOADER bl, int which_db, DB *dest_db, brt_compare_func);
int mergesort_row_array (struct row rows[/*n*/], int n, int which_db, DB *dest_db, brt_compare_func, BRTLOADER, struct rowset *); int mergesort_row_array (struct row rows[/*n*/], int n, int which_db, DB *dest_db, brt_compare_func, BRTLOADER, struct rowset *);
CILK_END
//int write_file_to_dbfile (int outfile, FIDX infile, BRTLOADER bl, const DESCRIPTOR descriptor, int progress_allocation); //int write_file_to_dbfile (int outfile, FIDX infile, BRTLOADER bl, const DESCRIPTOR descriptor, int progress_allocation);
int toku_merge_some_files_using_dbufio (const BOOL to_q, FIDX dest_data, QUEUE q, int n_sources, DBUFIO_FILESET bfs, FIDX srcs_fidxs[/*n_sources*/], BRTLOADER bl, int which_db, DB *dest_db, brt_compare_func compare, int progress_allocation); int toku_merge_some_files_using_dbufio (const BOOL to_q, FIDX dest_data, QUEUE q, int n_sources, DBUFIO_FILESET bfs, FIDX srcs_fidxs[/*n_sources*/], BRTLOADER bl, int which_db, DB *dest_db, brt_compare_func compare, int progress_allocation);
...@@ -261,6 +255,4 @@ int brt_loader_lock_init(BRTLOADER bl); ...@@ -261,6 +255,4 @@ int brt_loader_lock_init(BRTLOADER bl);
void brt_loader_lock_destroy(BRTLOADER bl); void brt_loader_lock_destroy(BRTLOADER bl);
void brt_loader_set_fractal_workers_count_from_c(BRTLOADER bl); void brt_loader_set_fractal_workers_count_from_c(BRTLOADER bl);
C_END
#endif #endif
This diff is collapsed.
...@@ -6,10 +6,6 @@ ...@@ -6,10 +6,6 @@
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include "c_dialects.h"
C_BEGIN
// The loader callbacks are C functions and need to be defined as such // The loader callbacks are C functions and need to be defined as such
typedef void (*brt_loader_error_func)(DB *, int which_db, int err, DBT *key, DBT *val, void *extra); typedef void (*brt_loader_error_func)(DB *, int which_db, int err, DBT *key, DBT *val, void *extra);
...@@ -46,6 +42,4 @@ void brtloader_set_os_fwrite (size_t (*fwrite_fun)(const void*,size_t,size_t,FIL ...@@ -46,6 +42,4 @@ void brtloader_set_os_fwrite (size_t (*fwrite_fun)(const void*,size_t,size_t,FIL
size_t brtloader_leafentry_size(size_t key_size, size_t val_size, TXNID xid); size_t brtloader_leafentry_size(size_t key_size, size_t val_size, TXNID xid);
C_END
#endif // BRTLOADER_H #endif // BRTLOADER_H
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
#include <toku_portability.h> #include <toku_portability.h>
#include <toku_pthread.h> #include <toku_pthread.h>
#include "c_dialects.h"
C_BEGIN
/* Maintain a set of files for reading, with double buffering for the reads. */ /* Maintain a set of files for reading, with double buffering for the reads. */
...@@ -26,6 +23,4 @@ int panic_dbufio_fileset(DBUFIO_FILESET, int error); ...@@ -26,6 +23,4 @@ int panic_dbufio_fileset(DBUFIO_FILESET, int error);
void dbufio_print(DBUFIO_FILESET); void dbufio_print(DBUFIO_FILESET);
C_END
#endif #endif
...@@ -3,10 +3,6 @@ ...@@ -3,10 +3,6 @@
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include "c_dialects.h"
C_BEGIN
// //
// The kibbutz is another threadpool meant to do arbitrary work. // The kibbutz is another threadpool meant to do arbitrary work.
// It is introduced in Dr. No, and as of Dr. No, the only work kibbutzim // It is introduced in Dr. No, and as of Dr. No, the only work kibbutzim
...@@ -38,6 +34,4 @@ void toku_kibbutz_enq (KIBBUTZ k, void (*f)(void*), void *extra); ...@@ -38,6 +34,4 @@ void toku_kibbutz_enq (KIBBUTZ k, void (*f)(void*), void *extra);
// //
void toku_kibbutz_destroy (KIBBUTZ k); void toku_kibbutz_destroy (KIBBUTZ k);
C_END
#endif #endif
...@@ -6,9 +6,6 @@ ...@@ -6,9 +6,6 @@
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include "brttypes.h" #include "brttypes.h"
#include "c_dialects.h"
C_BEGIN
// The abstraction: // The abstraction:
// //
...@@ -53,5 +50,4 @@ int queue_destroy (QUEUE q); ...@@ -53,5 +50,4 @@ int queue_destroy (QUEUE q);
// Requires: The queue must be empty and no consumer should try to dequeue after this (one way to do this is to make sure the consumer saw EOF). // Requires: The queue must be empty and no consumer should try to dequeue after this (one way to do this is to make sure the consumer saw EOF).
// Returns 0 on success. If the queue is not empty, returns EINVAL. Other errors are likely to be bad (some sort of mutex or condvar failure). // Returns 0 on success. If the queue is not empty, returns EINVAL. Other errors are likely to be bad (some sort of mutex or condvar failure).
C_END
#endif #endif
...@@ -11,8 +11,6 @@ ...@@ -11,8 +11,6 @@
#include "test.h" #include "test.h"
#include "brtloader-internal.h" #include "brtloader-internal.h"
C_BEGIN
static int event_count, event_count_trigger; static int event_count, event_count_trigger;
static void my_assert_hook (void) { static void my_assert_hook (void) {
...@@ -536,5 +534,3 @@ int test_main (int argc, const char *argv[]) { ...@@ -536,5 +534,3 @@ int test_main (int argc, const char *argv[]) {
return 0; return 0;
} }
C_END
...@@ -5,10 +5,6 @@ ...@@ -5,10 +5,6 @@
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved." #ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it." #ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#include "c_dialects.h"
C_BEGIN
// A toku_thread is toku_pthread that can be cached. // A toku_thread is toku_pthread that can be cached.
struct toku_thread; struct toku_thread;
...@@ -53,7 +49,4 @@ int toku_thread_pool_run(struct toku_thread_pool *pool, int dowait, int *nthread ...@@ -53,7 +49,4 @@ int toku_thread_pool_run(struct toku_thread_pool *pool, int dowait, int *nthread
// Print the state of the thread pool // Print the state of the thread pool
void toku_thread_pool_print(struct toku_thread_pool *pool, FILE *out); void toku_thread_pool_print(struct toku_thread_pool *pool, FILE *out);
C_END
#endif #endif
...@@ -9,9 +9,6 @@ ...@@ -9,9 +9,6 @@
#include <errno.h> #include <errno.h>
#include "toku_assert.h" #include "toku_assert.h"
#include "toku_pthread.h" #include "toku_pthread.h"
#include "c_dialects.h"
C_BEGIN
struct workitem; struct workitem;
...@@ -217,7 +214,5 @@ void toku_destroy_workers(WORKQUEUE wq, THREADPOOL *tpptr); ...@@ -217,7 +214,5 @@ void toku_destroy_workers(WORKQUEUE wq, THREADPOOL *tpptr);
// workers. // workers.
void *toku_worker(void *arg); void *toku_worker(void *arg);
C_END
#endif #endif
...@@ -8,10 +8,6 @@ ...@@ -8,10 +8,6 @@
#include <toku_list.h> #include <toku_list.h>
#include <toku_pthread.h> #include <toku_pthread.h>
#include "c_dialects.h"
C_BEGIN
// The work struct is the base class for work to be done by some threads // The work struct is the base class for work to be done by some threads
struct work { struct work {
struct toku_list next; struct toku_list next;
...@@ -107,6 +103,4 @@ workset_join(struct workset *ws) { ...@@ -107,6 +103,4 @@ workset_join(struct workset *ws) {
workset_unlock(ws); workset_unlock(ws);
} }
C_END
#endif #endif
#ifndef C_DIALECTS_H
#define C_DIALECTS_H
#ident "$Id$"
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
#if defined(__cplusplus) || defined(__cilkplusplus)
#define C_BEGIN extern "C" {
#define C_END }
#else
#define C_BEGIN
#define C_END
#endif
#if defined(__cilkplusplus)
#define CILK_BEGIN extern "Cilk++" {
#define CILK_END }
#else
#define CILK_BEGIN
#define CILK_END
#endif
#endif
...@@ -5,10 +5,11 @@ ...@@ -5,10 +5,11 @@
/* It evaluates the argument and then calls a function toku_do_assert() which takes all the hits for the branches not taken. */ /* It evaluates the argument and then calls a function toku_do_assert() which takes all the hits for the branches not taken. */
#include <stdint.h> #include <stdint.h>
#include "c_dialects.h"
#include "errno.h" #include "errno.h"
C_BEGIN #if defined(__cplusplus)
extern "C" {
#endif
#ifdef NDEBUG #ifdef NDEBUG
#error NDEBUG should not be set #error NDEBUG should not be set
...@@ -52,6 +53,8 @@ extern void (*do_assert_hook)(void); // Set this to a function you want called a ...@@ -52,6 +53,8 @@ extern void (*do_assert_hook)(void); // Set this to a function you want called a
#define resource_assert(a) assert(a) // indicates resource must be available, otherwise unrecoverable #define resource_assert(a) assert(a) // indicates resource must be available, otherwise unrecoverable
#define resource_assert_zero(a) assert_zero(a) // indicates resource must be available, otherwise unrecoverable #define resource_assert_zero(a) assert_zero(a) // indicates resource must be available, otherwise unrecoverable
C_END #if defined(__cplusplus)
};
#endif
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment