Commit 570ede67 authored by John Esmet's avatar John Esmet

FT-254 Replace NULL_LOGGER etc with nullptr

parent d6b777d7
......@@ -183,9 +183,7 @@ typedef struct {
typedef struct tokulogger *TOKULOGGER;
typedef struct txn_manager *TXN_MANAGER;
#define NULL_LOGGER ((TOKULOGGER)0)
typedef struct tokutxn *TOKUTXN;
#define NULL_TXN ((TOKUTXN)0)
typedef struct xids_t *XIDS;
......
......@@ -308,9 +308,6 @@ struct txninfo {
BLOCKNUM current_rollback;
};
// TODO: Remove null txn
#define NULL_TXN ((TOKUTXN)0)
static inline int toku_logsizeof_uint8_t (uint32_t v __attribute__((__unused__))) {
return 1;
}
......
......@@ -282,7 +282,7 @@ toku_logger_open_rollback(TOKULOGGER logger, CACHETABLE cachetable, bool create)
FT_HANDLE t = NULL; // Note, there is no DB associated with this FT.
toku_ft_handle_create(&t);
int r = toku_ft_handle_open(t, toku_product_name_strings.rollback_cachefile, create, create, cachetable, NULL_TXN);
int r = toku_ft_handle_open(t, toku_product_name_strings.rollback_cachefile, create, create, cachetable, nullptr);
if (r == 0) {
logger->rollback_cachefile = t->ft->cf;
toku_logger_initialize_rollback_cache(logger, t->ft);
......
......@@ -260,6 +260,4 @@ int toku_get_version_of_logs_on_disk(const char *log_dir, bool *found_any_logs,
TXN_MANAGER toku_logger_get_txn_manager(TOKULOGGER logger);
static const TOKULOGGER NULL_logger __attribute__((__unused__)) = NULL;
#endif /* TOKU_LOGGER_H */
......@@ -136,8 +136,4 @@ int toku_recover_lock (const char *lock_dir, int *lockfd);
int toku_recover_unlock(int lockfd);
static const prepared_txn_callback_t NULL_prepared_txn_callback __attribute__((__unused__)) = NULL;
static const keep_cachetable_callback_t NULL_keep_cachetable_callback __attribute__((__unused__)) = NULL;
#endif // TOKURECOVER_H
......@@ -123,11 +123,11 @@ int recovery_main (int argc, const char *const argv[]) {
return(1);
}
int r = tokudb_recover(NULL,
NULL_prepared_txn_callback,
NULL_keep_cachetable_callback,
NULL_logger,
data_dir, log_dir, NULL, NULL, NULL, NULL, 0);
int r = tokudb_recover(nullptr,
nullptr,
nullptr,
nullptr,
data_dir, log_dir, nullptr, nullptr, nullptr, nullptr, 0);
if (r!=0) {
fprintf(stderr, "Recovery failed\n");
return(1);
......
......@@ -119,8 +119,8 @@ static FT_HANDLE t;
static void setup (void) {
int r;
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
r = toku_open_ft_handle(fname, 1, &t, nodesize, basementnodesize, compression_method, ct, NULL_TXN, toku_builtin_compare_fun); assert(r==0);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &t, nodesize, basementnodesize, compression_method, ct, nullptr, toku_builtin_compare_fun); assert(r==0);
}
static void toku_shutdown (void) {
......
......@@ -115,7 +115,7 @@ cachetable_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
......
......@@ -136,7 +136,7 @@ cachetable_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
......
......@@ -169,7 +169,7 @@ cachetable_test (void) {
check_flush = false;
dirty_flush_called = false;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
evictor_test_helpers::disable_ev_thread(&ct->ev); // disable eviction thread
toku_os_recursive_delete(TOKU_TEST_FILENAME);
......
......@@ -210,7 +210,7 @@ cachetable_test (void) {
int r;
toku_pair_list_set_lock_size(2); // set two bucket mutexes
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
......
......@@ -227,7 +227,7 @@ cachetable_test (void) {
int r;
toku_pair_list_set_lock_size(2); // set two bucket mutexes
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
......
......@@ -116,7 +116,7 @@ cachetable_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -187,7 +187,7 @@ static void checkpoint_pending(void) {
if (verbose) { printf("%s:%d n=%d\n", __FUNCTION__, __LINE__, N); fflush(stdout); }
const int test_limit = N;
int r;
toku_cachetable_create(&ct, test_limit*sizeof(int), ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit*sizeof(int), ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
r = unlink(fname1); if (r!=0) CKERR2(get_error_errno(), ENOENT);
r = toku_cachetable_openf(&cf, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
......
......@@ -152,7 +152,7 @@ cachetable_test (void) {
const int test_limit = 20;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -154,7 +154,7 @@ cachetable_test (void) {
const int test_limit = 20;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -145,7 +145,7 @@ static void cachetable_checkpoint_test(int n, enum cachetable_dirty dirty) {
const int test_limit = n;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -147,7 +147,7 @@ cachetable_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
......
......@@ -147,7 +147,7 @@ cachetable_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
......
......@@ -143,7 +143,7 @@ run_test (void) {
int r;
CACHETABLE ct;
toku_mutex_init(&attr_mutex, NULL);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
......
......@@ -99,7 +99,7 @@ cachetable_test (void) {
const int test_limit = 1000;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
toku_set_cleaner_period(ct, 1);
const char *fname1 = TOKU_TEST_FILENAME;
......
......@@ -111,7 +111,7 @@ run_test (void) {
const int test_limit = 1000;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
toku_set_cleaner_period(ct, 1);
const char *fname1 = TOKU_TEST_FILENAME;
......
......@@ -111,7 +111,7 @@ run_test (void) {
const int test_limit = 1000;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
toku_set_cleaner_period(ct, 1);
const char *fname1 = TOKU_TEST_FILENAME;
......
......@@ -119,7 +119,7 @@ run_test (void) {
const int test_limit = 1000;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
my_cleaner_callback_called = false;
const char *fname1 = TOKU_TEST_FILENAME;
......
......@@ -119,7 +119,7 @@ run_test (void) {
const int test_limit = 1000;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
toku_set_cleaner_period(ct, 1);
my_cleaner_callback_called = false;
......
......@@ -96,7 +96,7 @@ cachetable_test (void) {
int test_limit = 6;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -143,7 +143,7 @@ cachetable_test (void) {
num_entries = 0;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -186,7 +186,7 @@ cachetable_test (void) {
const int test_limit = 16;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -202,7 +202,7 @@ cachetable_test (void) {
const int test_limit = 20;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
evictor_test_helpers::set_hysteresis_limits(&ct->ev, test_limit, 100*test_limit);
evictor_test_helpers::disable_ev_thread(&ct->ev);
const char *fname1 = TOKU_TEST_FILENAME;
......
......@@ -181,7 +181,7 @@ cachetable_test (void) {
num_entries = 0;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -145,7 +145,7 @@ cachetable_test (void) {
const int test_limit = 200;
int r;
ct = NULL;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -139,7 +139,7 @@ cachetable_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -144,7 +144,7 @@ cachetable_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -126,7 +126,7 @@ cachetable_test (enum cachetable_dirty dirty, bool cloneable) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -137,7 +137,7 @@ cachetable_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -97,7 +97,7 @@ cachetable_count_pinned_test (int n) {
const int test_limit = 2*n;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -96,7 +96,7 @@ cachetable_debug_test (int n) {
const int test_limit = n;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -155,7 +155,7 @@ static void cachetable_eviction_full_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -168,7 +168,7 @@ static void cachetable_eviction_full_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -123,7 +123,7 @@ static void cachetable_predef_fetch_maybegetandpin_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
evictor_test_helpers::disable_ev_thread(&ct->ev);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
......
......@@ -130,7 +130,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
evictor_test_helpers::disable_ev_thread(&ct->ev);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
......
......@@ -98,7 +98,7 @@ cachetable_fd_test (void) {
const int test_limit = 1;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
toku_os_recursive_delete(TOKU_TEST_FILENAME);
r = toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU);
assert_zero(r);
......
......@@ -113,7 +113,7 @@ cachetable_test (enum pin_evictor_test_type test_type, bool nonblocking) {
const int test_limit = 7;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
evictor_test_helpers::set_hysteresis_limits(&ct->ev, test_limit, test_limit);
evictor_test_helpers::disable_ev_thread(&ct->ev);
const char *fname1 = TOKU_TEST_FILENAME;
......
......@@ -117,7 +117,7 @@ cachetable_test (void) {
const int test_limit = 400;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
toku_set_cleaner_period(ct, 1);
const char *fname1 = TOKU_TEST_FILENAME;
......
......@@ -97,7 +97,7 @@ test_cachetable_def_flush (int n) {
const int test_limit = 2*n;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
toku_os_recursive_delete(TOKU_TEST_FILENAME);
r = toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU);
assert_zero(r);
......
......@@ -134,7 +134,7 @@ cachetable_getandpin_test (int n) {
const int test_limit = 1024*1024;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -114,7 +114,7 @@ run_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -166,7 +166,7 @@ cachetable_test (void) {
int r;
CACHETABLE ct;
bool doing_prefetch = false;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......@@ -215,7 +215,7 @@ cachetable_test (void) {
// close and reopen cachefile so we can do some simple prefetch tests
toku_cachefile_close(&f1, false, ZERO_LSN);
toku_cachetable_close(&ct);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
//
// verify that a prefetch of the node will succeed
......
......@@ -413,7 +413,7 @@ cachetable_test (void) {
int r;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
......
......@@ -100,7 +100,7 @@ run_test (void) {
const int test_limit = 20;
int r;
ct = NULL;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
f1 = NULL;
......
......@@ -153,7 +153,7 @@ static void cachetable_prefetch_checkpoint_test(int n, enum cachetable_dirty dir
CACHETABLE ct;
CACHETABLE_WRITE_CALLBACK wc = def_write_callback(NULL);
wc.flush_callback = flush;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -139,7 +139,7 @@ static void cachetable_prefetch_close_leak_test (void) {
const int test_limit = 1;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -141,7 +141,7 @@ static void cachetable_prefetch_full_test (bool partial_fetch) {
expect_pf = false;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -152,7 +152,7 @@ fetch (CACHEFILE f __attribute__((__unused__)),
static void cachetable_prefetch_flowcontrol_test (int cachetable_size_limit) {
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, cachetable_size_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, cachetable_size_limit, ZERO_LSN, nullptr);
evictor_test_helpers::set_hysteresis_limits(&ct->ev, cachetable_size_limit, cachetable_size_limit);
evictor_test_helpers::disable_ev_thread(&ct->ev);
const char *fname1 = TOKU_TEST_FILENAME;
......
......@@ -162,7 +162,7 @@ static void cachetable_prefetch_maybegetandpin_test (bool do_partial_fetch) {
const int test_limit = 2;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -119,7 +119,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
const int test_limit = 1;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -122,7 +122,7 @@ static void cachetable_prefetch_maybegetandpin_test (void) {
const int test_limit = 1;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -545,7 +545,7 @@ cachetable_test (void) {
int r;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
......
......@@ -96,7 +96,7 @@ cachetable_put_test (int n) {
const int test_limit = 2*n;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -150,7 +150,7 @@ test_clean (enum cachetable_dirty dirty, bool cloneable) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -137,7 +137,7 @@ test_clean (enum cachetable_dirty dirty, bool cloneable) {
const int test_limit = 200;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -145,7 +145,7 @@ simple_test(bool unlink_on_close) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......@@ -214,7 +214,7 @@ static void test_pair_stays_in_cache(enum cachetable_dirty dirty) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......@@ -245,7 +245,7 @@ static void test_multiple_cachefiles(bool use_same_hash) {
const int test_limit = 1000;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
char fname1[strlen(TOKU_TEST_FILENAME) + sizeof("_1")];
strcpy(fname1, TOKU_TEST_FILENAME);
......@@ -333,7 +333,7 @@ static void test_evictor(void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
char fname1[strlen(TOKU_TEST_FILENAME) + sizeof("_1")];
strcpy(fname1, TOKU_TEST_FILENAME);
......
......@@ -100,7 +100,7 @@ cachetable_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -125,7 +125,7 @@ run_test (pair_lock_type lock_type) {
struct unlockers unlockers = {true, unlock_dummy, NULL, NULL};
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -158,7 +158,7 @@ cachetable_test (bool write_first, bool write_second, bool start_checkpoint) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -164,7 +164,7 @@ run_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -147,7 +147,7 @@ run_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -139,7 +139,7 @@ run_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -173,7 +173,7 @@ cachetable_test (bool write_first, bool write_second, bool start_checkpoint) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -152,7 +152,7 @@ run_test (void) {
int r;
void *ret;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
......
......@@ -158,7 +158,7 @@ run_test (void) {
int r;
void *ret;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
r = toku_cachetable_openf(&f1, ct, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r == 0);
......
......@@ -114,7 +114,7 @@ cachetable_test (void) {
const int test_limit = 120;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -95,7 +95,7 @@ cachetable_test (void) {
const int test_limit = 12;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -118,7 +118,7 @@ static inline void test_mutex_unlock(void) {
static void
test_cachetable_create(void) {
CACHETABLE ct = NULL;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
toku_cachetable_close(&ct);
}
......@@ -172,7 +172,7 @@ static void test_nested_pin (void) {
void *vv,*vv2;
const char *fname = TOKU_TEST_FILENAME;
if (verbose) printf("creating cachetable\n");
toku_cachetable_create(&t, 1, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&t, 1, ZERO_LSN, nullptr);
toku_os_recursive_delete(fname);
r = toku_cachetable_openf(&f, t, fname, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO);
assert(r==0);
......@@ -257,7 +257,7 @@ static void test_multi_filehandles (void) {
unlink(fname1);
unlink(fname2);
toku_cachetable_create(&t, 4, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&t, 4, ZERO_LSN, nullptr);
r = toku_cachetable_openf(&f1, t, fname1, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r==0);
r = link(fname1, fname2); assert(r==0);
r = toku_cachetable_openf(&f2, t, fname2, O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); assert(r==0);
......@@ -325,7 +325,7 @@ static void test_dirty(void) {
int dirty; long long pinned; long entry_size;
int r;
toku_cachetable_create(&t, 4, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&t, 4, ZERO_LSN, nullptr);
const char *fname = TOKU_TEST_FILENAME;
toku_os_recursive_delete(fname);
......@@ -455,7 +455,7 @@ static void test_size_resize(void) {
int n = 3;
long size = 1;
toku_cachetable_create(&t, n*size, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&t, n*size, ZERO_LSN, nullptr);
const char *fname = TOKU_TEST_FILENAME;
unlink(fname);
......@@ -509,7 +509,7 @@ static void test_size_flush(void) {
const int n = 8;
long long size = 1*1024*1024;
toku_cachetable_create(&t, n*size, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&t, n*size, ZERO_LSN, nullptr);
const char *fname = TOKU_TEST_FILENAME;
unlink(fname);
......
......@@ -116,7 +116,7 @@ cachetable_unpin_and_remove_test (int n) {
int i;
CACHETABLE ct;
toku_cachetable_create(&ct, table_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, table_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......@@ -172,7 +172,7 @@ cachetable_put_evict_remove_test (int n) {
int i;
CACHETABLE ct;
toku_cachetable_create(&ct, table_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, table_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -114,7 +114,7 @@ run_test (void) {
const int test_limit = 12;
int r;
ct = NULL;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -97,7 +97,7 @@ cachetable_unpin_test (int n) {
const int test_limit = 2*n;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......@@ -145,7 +145,7 @@ unpin_and_evictor_test(enum unpin_evictor_test_type test_type) {
int r;
CACHETABLE ct;
int test_limit = 4;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -125,7 +125,7 @@ cachetable_test (void) {
test_limit = 6;
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, test_limit, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, test_limit, ZERO_LSN, nullptr);
const char *fname1 = TOKU_TEST_FILENAME;
unlink(fname1);
CACHEFILE f1;
......
......@@ -112,7 +112,7 @@ static void test_sub_block(int n) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
error = toku_open_ft_handle(fname, true, &ft, nodesize, basementnodesize, compression_method, ct, null_txn, toku_builtin_compare_fun);
assert(error == 0);
......
......@@ -118,7 +118,7 @@ static void test_multiple_ft_cursor_dbts(int n) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
......
......@@ -170,7 +170,7 @@ static void test_ft_cursor_first(int n) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
assert(r==0);
......@@ -208,7 +208,7 @@ static void test_ft_cursor_last(int n) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
assert(r==0);
......@@ -247,7 +247,7 @@ static void test_ft_cursor_first_last(int n) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
assert(r==0);
......@@ -289,7 +289,7 @@ static void test_ft_cursor_rfirst(int n) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
assert(r==0);
......@@ -353,7 +353,7 @@ static void test_ft_cursor_walk(int n) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
assert(r==0);
......@@ -415,7 +415,7 @@ static void test_ft_cursor_rwalk(int n) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
assert(r==0);
......@@ -496,7 +496,7 @@ static void test_ft_cursor_rand(int n) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
assert(r==0);
......@@ -546,7 +546,7 @@ static void test_ft_cursor_split(int n) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
assert(r==0);
......@@ -617,7 +617,7 @@ static void test_multiple_ft_cursors(int n) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
assert(r==0);
......@@ -663,7 +663,7 @@ static void test_multiple_ft_cursor_walk(int n) {
int nodesize = 1<<12;
int h = log16(n);
int cachesize = 2 * h * ncursors * nodesize;
toku_cachetable_create(&ct, cachesize, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, cachesize, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
assert(r==0);
......@@ -736,7 +736,7 @@ static void test_ft_cursor_set(int n, int cursor_op) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
assert(r==0);
......@@ -804,7 +804,7 @@ static void test_ft_cursor_set_range(int n) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
assert(r==0);
......@@ -864,7 +864,7 @@ static void test_ft_cursor_delete(int n) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
error = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
assert(error == 0);
......
......@@ -104,7 +104,7 @@ static void test_header (void) {
const char *fname = TOKU_TEST_FILENAME;
// First create dictionary
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
r = toku_open_ft_handle(fname, 1, &t, 1024, 256, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
......@@ -122,7 +122,7 @@ static void test_header (void) {
toku_cachetable_close(&ct);
// Now read dictionary back into memory and examine some header fields
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 0, &t, 1024, 256, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
......
......@@ -101,7 +101,7 @@ static void test_dump_empty_db (void) {
CACHETABLE ct;
int r;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
r = toku_open_ft_handle(fname, 1, &t, 1024, 256, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
......@@ -124,7 +124,7 @@ static void test_multiple_files_of_size (int size) {
toku_os_recursive_delete(TOKU_TEST_FILENAME);
r = toku_os_mkdir(TOKU_TEST_FILENAME, S_IRWXU); assert(r == 0);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(n0, 1, &t0, size, size / 4, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); assert(r==0);
r = toku_open_ft_handle(n1, 1, &t1, size, size / 4, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); assert(r==0);
for (i=0; i<10000; i++) {
......@@ -148,7 +148,7 @@ static void test_multiple_files_of_size (int size) {
/* Now see if the data is all there. */
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(n0, 0, &t0, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
if (verbose) printf("%s:%d r=%d\n", __FILE__, __LINE__,r);
assert(r==0);
......@@ -184,7 +184,7 @@ static void test_multiple_ft_handles_one_db_one_file (void) {
if (verbose) printf("test_multiple_ft_handles_one_db_one_file:");
unlink(fname);
toku_cachetable_create(&ct, 32, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 32, ZERO_LSN, nullptr);
for (i=0; i<MANYN; i++) {
r = toku_open_ft_handle(fname, (i==0), &trees[i], 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
......@@ -223,7 +223,7 @@ static void test_read_what_was_written (void) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); assert(r==0);
r = toku_close_ft_handle_nolsn(ft, 0); assert(r==0);
toku_cachetable_close(&ct);
......@@ -231,7 +231,7 @@ static void test_read_what_was_written (void) {
/* Now see if we can read an empty tree in. */
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 0, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); assert(r==0);
/* See if we can put something in it. */
......@@ -246,7 +246,7 @@ static void test_read_what_was_written (void) {
/* Now see if we can read it in and get the value. */
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 0, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); assert(r==0);
ft_lookup_and_check_nodup(ft, "hello", "there");
......@@ -308,7 +308,7 @@ static void test_read_what_was_written (void) {
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 0, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); assert(r==0);
ft_lookup_and_check_nodup(ft, "hello", "there");
......@@ -341,7 +341,7 @@ static void test_cursor_last_empty(void) {
unlink(fname);
//printf("%s:%d %d alloced\n", __FILE__, __LINE__, toku_get_n_items_malloced()); toku_print_malloced_items();
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
//printf("%s:%d %d alloced\n", __FILE__, __LINE__, toku_get_n_items_malloced()); toku_print_malloced_items();
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); assert(r==0);
//printf("%s:%d %d alloced\n", __FILE__, __LINE__, toku_get_n_items_malloced()); toku_print_malloced_items();
......@@ -375,7 +375,7 @@ static void test_cursor_next (void) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
//printf("%s:%d %d alloced\n", __FILE__, __LINE__, toku_get_n_items_malloced()); toku_print_malloced_items();
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); assert(r==0);
//printf("%s:%d %d alloced\n", __FILE__, __LINE__, toku_get_n_items_malloced()); toku_print_malloced_items();
......@@ -451,7 +451,7 @@ static void test_wrongendian_compare (int wrong_p, unsigned int N) {
assert(wrong_compare_fun(NULL, toku_fill_dbt(&at, b, 4), toku_fill_dbt(&bt, a, 4))<0);
}
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
//printf("%s:%d WRONG=%d\n", __FILE__, __LINE__, wrong_p);
if (0) { // ???? Why is this commented out?
......@@ -548,7 +548,7 @@ static void test_large_kv(int bsize, int ksize, int vsize) {
if (verbose) printf("test_large_kv: %d %d %d\n", bsize, ksize, vsize);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
r = toku_open_ft_handle(fname, 1, &t, bsize, bsize / 4, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
......@@ -592,7 +592,7 @@ static void test_ft_delete_empty(void) {
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
r = toku_open_ft_handle(fname, 1, &t, 4096, 1024, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
......@@ -618,7 +618,7 @@ static void test_ft_delete_present(int n) {
CACHETABLE ct;
int i;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
r = toku_open_ft_handle(fname, 1, &t, 4096, 1024, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
......@@ -681,7 +681,7 @@ static void test_ft_delete_not_present(int n) {
CACHETABLE ct;
int i;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
r = toku_open_ft_handle(fname, 1, &t, 4096, 1024, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
......@@ -725,7 +725,7 @@ static void test_ft_delete_cursor_first(int n) {
CACHETABLE ct;
int i;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
r = toku_open_ft_handle(fname, 1, &t, 4096, 1024, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
......@@ -820,7 +820,7 @@ static void test_insert_delete_lookup(int n) {
CACHETABLE ct;
int i;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
r = toku_open_ft_handle(fname, 1, &t, 4096, 1024, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
......@@ -907,7 +907,7 @@ static void test_new_ft_cursor_first(int n) {
CACHETABLE ct;
int i;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
toku_ft_handle_create(&t);
toku_ft_handle_set_nodesize(t, 4096);
......@@ -959,7 +959,7 @@ static void test_new_ft_cursor_last(int n) {
CACHETABLE ct;
int i;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
toku_ft_handle_create(&t);
toku_ft_handle_set_nodesize(t, 4096);
......@@ -1012,7 +1012,7 @@ static void test_new_ft_cursor_next(int n) {
CACHETABLE ct;
int i;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
toku_ft_handle_create(&t);
toku_ft_handle_set_nodesize(t, 4096);
......@@ -1055,7 +1055,7 @@ static void test_new_ft_cursor_prev(int n) {
CACHETABLE ct;
int i;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
toku_ft_handle_create(&t);
toku_ft_handle_set_nodesize(t, 4096);
......@@ -1098,7 +1098,7 @@ static void test_new_ft_cursor_current(int n) {
CACHETABLE ct;
int i;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
toku_ft_handle_create(&t);
toku_ft_handle_set_nodesize(t, 4096);
......@@ -1180,7 +1180,7 @@ static void test_new_ft_cursor_set_range(int n) {
FT_HANDLE ft=0;
FT_CURSOR cursor=0;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
toku_ft_handle_create(&ft);
toku_ft_handle_set_nodesize(ft, 4096);
......@@ -1241,7 +1241,7 @@ static void test_new_ft_cursor_set(int n, int cursor_op, DB *db) {
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare); assert(r==0);
......
......@@ -101,7 +101,7 @@ static void test0 (void) {
const char *fname = TOKU_TEST_FILENAME;
if (verbose) printf("%s:%d test0\n", __FILE__, __LINE__);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
if (verbose) printf("%s:%d test0\n", __FILE__, __LINE__);
unlink(fname);
r = toku_open_ft_handle(fname, 1, &t, 1024, 256, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
......
......@@ -101,7 +101,7 @@ static void test1 (void) {
const char *fname = TOKU_TEST_FILENAME;
DBT k,v;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
r = toku_open_ft_handle(fname, 1, &t, 1024, 256, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
......
......@@ -102,7 +102,7 @@ static void test2 (int limit) {
const char *fname = TOKU_TEST_FILENAME;
if (verbose) printf("%s:%d checking\n", __FILE__, __LINE__);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
r = toku_open_ft_handle(fname, 1, &t, 1024, 256, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
if (verbose) printf("%s:%d did setup\n", __FILE__, __LINE__);
......
......@@ -106,7 +106,7 @@ static void test3 (int nodesize, int basementnodesize, int count) {
int i;
CACHETABLE ct;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
gettimeofday(&t0, 0);
unlink(fname);
r = toku_open_ft_handle(fname, 1, &t, nodesize, basementnodesize, compression_method, ct, null_txn, toku_builtin_compare_fun);
......
......@@ -106,7 +106,7 @@ static void test4 (int nodesize, int count) {
gettimeofday(&t0, 0);
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &t, nodesize, nodesize / 8, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); assert(r==0);
for (i=0; i<count; i++) {
char key[100],val[100];
......
......@@ -106,7 +106,7 @@ static void test5 (void) {
MALLOC_N(limit,values);
for (i=0; i<limit; i++) values[i]=-1;
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &t, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); assert(r==0);
for (i=0; i<limit/2; i++) {
char key[100],val[100];
......
......@@ -129,7 +129,7 @@ static void verify_dbfile(int n, const char *name) {
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
TOKUTXN const null_txn = NULL;
FT_HANDLE t = NULL;
......
......@@ -336,7 +336,7 @@ static void verify_dbfile(int n, int sorted_keys[], const char *sorted_vals[], c
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
TOKUTXN const null_txn = NULL;
FT_HANDLE t = NULL;
......
......@@ -111,7 +111,7 @@ static void close_ft_and_ct (void) {
static void open_ft_and_ct (bool unlink_old) {
int r;
if (unlink_old) unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &t, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); assert(r==0);
}
......
......@@ -196,7 +196,7 @@ test_pos_infinity(const char *fname, int n) {
int error;
CACHETABLE ct = NULL;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
FT_HANDLE ft = NULL;
error = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_keycompare);
......@@ -230,7 +230,7 @@ test_neg_infinity(const char *fname, int n) {
int error;
CACHETABLE ct = NULL;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
FT_HANDLE ft = NULL;
error = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_keycompare);
......@@ -284,7 +284,7 @@ test_between(const char *fname, int n) {
int error;
CACHETABLE ct = NULL;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
FT_HANDLE ft = NULL;
error = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_keycompare);
......
......@@ -192,7 +192,7 @@ walk_tree(const char *fname, int n) {
int error;
CACHETABLE ct = NULL;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
FT_HANDLE ft = NULL;
error = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare);
......
......@@ -209,7 +209,7 @@ test_make_tree(int height, int fanout, int nperleaf, int do_verify) {
// create a cachetable
CACHETABLE ct = NULL;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
// create the ft
TOKUTXN null_txn = NULL;
......
......@@ -202,7 +202,7 @@ test_msnfilter(int do_verify) {
// create a cachetable
CACHETABLE ct = NULL;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
// create the ft
TOKUTXN null_txn = NULL;
......
......@@ -1226,7 +1226,7 @@ test_main (int argc, const char *argv[]) {
initialize_dummymsn();
int r;
CACHETABLE ct;
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
unlink(fname);
FT_HANDLE t;
r = toku_open_ft_handle(fname, 1, &t, 128*1024, 4096, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun); assert(r==0);
......
......@@ -108,7 +108,7 @@ test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute
unlink(fname);
toku_cachetable_create(&ct, 0, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 0, ZERO_LSN, nullptr);
r = toku_open_ft_handle(fname, 1, &ft, 1<<12, 1<<9, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, test_ft_cursor_keycompare); assert(r==0);
r = toku_ft_cursor(ft, &cursor, NULL, false, false); assert(r==0);
......
......@@ -184,7 +184,7 @@ doit (bool after_child_pin) {
toku_flusher_thread_set_callback(flusher_callback, &after_child_pin);
toku_cachetable_create(&ct, 500*1024*1024, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 500*1024*1024, ZERO_LSN, nullptr);
unlink("foo1.ft_handle");
r = toku_open_ft_handle("foo1.ft_handle", 1, &t, NODESIZE, NODESIZE/2, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
......
......@@ -175,7 +175,7 @@ doit (int state) {
toku_flusher_thread_set_callback(flusher_callback, &state);
toku_cachetable_create(&ct, 500*1024*1024, ZERO_LSN, NULL_LOGGER);
toku_cachetable_create(&ct, 500*1024*1024, ZERO_LSN, nullptr);
unlink("foo2.ft_handle");
unlink("bar2.ft_handle");
// note the basement node size is 5 times the node size
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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