Commit 51dacb89 authored by Yoni Fogel's avatar Yoni Fogel

[t:4901] rename struct ft { FT h } to { FT ft }

git-svn-id: file:///svn/toku/tokudb@43771 c7de825b-a66e-492c-adef-691d508d4ae1
parent f0cd39e1
......@@ -110,7 +110,7 @@ toku_create_new_ftnode (
int n_children)
{
return create_new_ftnode_with_dep_nodes(
t->h,
t->ft,
result,
height,
n_children,
......@@ -135,12 +135,12 @@ toku_pin_ftnode(
void *node_v;
*msgs_applied = FALSE;
int r = toku_cachetable_get_and_pin_nonblocking(
brt->h->cf,
brt->ft->cf,
blocknum,
fullhash,
&node_v,
NULL,
get_write_callbacks_for_node(brt->h),
get_write_callbacks_for_node(brt->ft),
toku_ftnode_fetch_callback,
toku_ftnode_pf_req_callback,
toku_ftnode_pf_callback,
......@@ -232,7 +232,7 @@ void
toku_unpin_ftnode_read_only(FT_HANDLE brt, FTNODE node)
{
int r = toku_cachetable_unpin(
brt->h->cf,
brt->ft->cf,
node->thisnodename,
node->fullhash,
(enum cachetable_dirty) node->dirty,
......
......@@ -266,14 +266,14 @@ toku_ft_hot_optimize(FT_HANDLE brt,
u_int32_t fullhash;
{
toku_ft_grab_treelock(brt->h);
toku_ft_grab_treelock(brt->ft);
// Get root node (the first parent of each successive HOT
// call.)
toku_calculate_root_offset_pointer(brt->h, &root_key, &fullhash);
toku_calculate_root_offset_pointer(brt->ft, &root_key, &fullhash);
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, brt->h);
toku_pin_ftnode_off_client_thread(brt->h,
fill_bfe_for_full_read(&bfe, brt->ft);
toku_pin_ftnode_off_client_thread(brt->ft,
(BLOCKNUM) root_key,
fullhash,
&bfe,
......@@ -283,7 +283,7 @@ toku_ft_hot_optimize(FT_HANDLE brt,
&root);
toku_assert_entire_node_in_memory(root);
toku_ft_release_treelock(brt->h);
toku_ft_release_treelock(brt->ft);
}
// Prepare HOT diagnostics.
......@@ -311,12 +311,12 @@ toku_ft_hot_optimize(FT_HANDLE brt,
// This should recurse to the bottom of the tree and then
// return.
if (root->height > 0) {
flush_some_child(brt->h, root, &advice);
flush_some_child(brt->ft, root, &advice);
} else {
// Since there are no children to flush, we should abort
// the HOT call.
flusher.rightmost_leaf_seen = 1;
toku_unpin_ftnode_off_client_thread(brt->h, root);
toku_unpin_ftnode_off_client_thread(brt->ft, root);
}
// Set the highest pivot key seen here, since the parent may
......
......@@ -418,8 +418,8 @@ struct ft_options {
};
struct ft_handle {
// The header is shared. It is also ephemeral.
FT h;
// The fractal tree.
FT ft;
on_redirect_callback redirect_callback;
void *redirect_callback_extra;
......
This diff is collapsed.
......@@ -48,7 +48,7 @@ int toku_testsetup_leaf(FT_HANDLE brt, BLOCKNUM *blocknum, int n_children, char
}
*blocknum = node->thisnodename;
toku_unpin_ftnode(brt->h, node);
toku_unpin_ftnode(brt->ft, node);
return 0;
}
......@@ -68,13 +68,13 @@ int toku_testsetup_nonleaf (FT_HANDLE brt, int height, BLOCKNUM *blocknum, int n
node->totalchildkeylens += keylens[i];
}
*blocknum = node->thisnodename;
toku_unpin_ftnode(brt->h, node);
toku_unpin_ftnode(brt->ft, node);
return 0;
}
int toku_testsetup_root(FT_HANDLE brt, BLOCKNUM blocknum) {
assert(testsetup_initialized);
brt->h->root_blocknum = blocknum;
brt->ft->root_blocknum = blocknum;
return 0;
}
......@@ -83,13 +83,13 @@ int toku_testsetup_get_sersize(FT_HANDLE brt, BLOCKNUM diskoff) // Return the si
assert(testsetup_initialized);
void *node_v;
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, brt->h);
fill_bfe_for_full_read(&bfe, brt->ft);
int r = toku_cachetable_get_and_pin(
brt->h->cf, diskoff,
toku_cachetable_hash(brt->h->cf, diskoff),
brt->ft->cf, diskoff,
toku_cachetable_hash(brt->ft->cf, diskoff),
&node_v,
NULL,
get_write_callbacks_for_node(brt->h),
get_write_callbacks_for_node(brt->ft),
toku_ftnode_fetch_callback,
toku_ftnode_pf_req_callback,
toku_ftnode_pf_callback,
......@@ -98,7 +98,7 @@ int toku_testsetup_get_sersize(FT_HANDLE brt, BLOCKNUM diskoff) // Return the si
);
assert(r==0);
int size = toku_serialize_ftnode_size(node_v);
toku_unpin_ftnode(brt->h, node_v);
toku_unpin_ftnode(brt->ft, node_v);
return size;
}
......@@ -109,14 +109,14 @@ int toku_testsetup_insert_to_leaf (FT_HANDLE brt, BLOCKNUM blocknum, char *key,
assert(testsetup_initialized);
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, brt->h);
fill_bfe_for_full_read(&bfe, brt->ft);
r = toku_cachetable_get_and_pin(
brt->h->cf,
brt->ft->cf,
blocknum,
toku_cachetable_hash(brt->h->cf, blocknum),
toku_cachetable_hash(brt->ft->cf, blocknum),
&node_v,
NULL,
get_write_callbacks_for_node(brt->h),
get_write_callbacks_for_node(brt->ft),
toku_ftnode_fetch_callback,
toku_ftnode_pf_req_callback,
toku_ftnode_pf_callback,
......@@ -135,9 +135,9 @@ int toku_testsetup_insert_to_leaf (FT_HANDLE brt, BLOCKNUM blocknum, char *key,
toku_fill_dbt(&valdbt, val, vallen)}};
toku_ft_node_put_cmd (
brt->h->compare_fun,
brt->h->update_fun,
&brt->h->cmp_descriptor,
brt->ft->compare_fun,
brt->ft->update_fun,
&brt->ft->cmp_descriptor,
node,
&cmd,
true,
......@@ -146,7 +146,7 @@ int toku_testsetup_insert_to_leaf (FT_HANDLE brt, BLOCKNUM blocknum, char *key,
toku_verify_or_set_counts(node);
toku_unpin_ftnode(brt->h, node_v);
toku_unpin_ftnode(brt->ft, node_v);
return 0;
}
......@@ -162,11 +162,11 @@ void
toku_pin_node_with_min_bfe(FTNODE* node, BLOCKNUM b, FT_HANDLE t)
{
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, t->h);
fill_bfe_for_min_read(&bfe, t->ft);
toku_pin_ftnode_off_client_thread(
t->h,
t->ft,
b,
toku_cachetable_hash(t->h->cf, b),
toku_cachetable_hash(t->ft->cf, b),
&bfe,
TRUE,
0,
......@@ -182,14 +182,14 @@ int toku_testsetup_insert_to_nonleaf (FT_HANDLE brt, BLOCKNUM blocknum, enum ft_
assert(testsetup_initialized);
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, brt->h);
fill_bfe_for_full_read(&bfe, brt->ft);
r = toku_cachetable_get_and_pin(
brt->h->cf,
brt->ft->cf,
blocknum,
toku_cachetable_hash(brt->h->cf, blocknum),
toku_cachetable_hash(brt->ft->cf, blocknum),
&node_v,
NULL,
get_write_callbacks_for_node(brt->h),
get_write_callbacks_for_node(brt->ft),
toku_ftnode_fetch_callback,
toku_ftnode_pf_req_callback,
toku_ftnode_pf_callback,
......@@ -203,7 +203,7 @@ int toku_testsetup_insert_to_nonleaf (FT_HANDLE brt, BLOCKNUM blocknum, enum ft_
DBT k;
int childnum = toku_ftnode_which_child(node,
toku_fill_dbt(&k, key, keylen),
&brt->h->cmp_descriptor, brt->h->compare_fun);
&brt->ft->cmp_descriptor, brt->ft->compare_fun);
XIDS xids_0 = xids_get_root_xids();
MSN msn = next_dummymsn();
......@@ -215,6 +215,6 @@ int toku_testsetup_insert_to_nonleaf (FT_HANDLE brt, BLOCKNUM blocknum, enum ft_
node->max_msn_applied_to_node_on_disk = msn;
node->dirty = 1;
toku_unpin_ftnode(brt->h, node_v);
toku_unpin_ftnode(brt->ft, node_v);
return 0;
}
......@@ -18,16 +18,16 @@
static int
compare_pairs (FT_HANDLE brt, const DBT *a, const DBT *b) {
FAKE_DB(db, &brt->h->cmp_descriptor);
int cmp = brt->h->compare_fun(&db, a, b);
FAKE_DB(db, &brt->ft->cmp_descriptor);
int cmp = brt->ft->compare_fun(&db, a, b);
return cmp;
}
static int
compare_leafentries (FT_HANDLE brt, LEAFENTRY a, LEAFENTRY b) {
DBT x,y;
FAKE_DB(db, &brt->h->cmp_descriptor);
int cmp = brt->h->compare_fun(&db,
FAKE_DB(db, &brt->ft->cmp_descriptor);
int cmp = brt->ft->compare_fun(&db,
toku_fill_dbt(&x, le_key(a), le_keylen(a)),
toku_fill_dbt(&y, le_key(b), le_keylen(b)));
return cmp;
......@@ -36,16 +36,16 @@ compare_leafentries (FT_HANDLE brt, LEAFENTRY a, LEAFENTRY b) {
static int
compare_pair_to_leafentry (FT_HANDLE brt, const DBT *a, LEAFENTRY b) {
DBT y;
FAKE_DB(db, &brt->h->cmp_descriptor);
int cmp = brt->h->compare_fun(&db, a, toku_fill_dbt(&y, le_key(b), le_keylen(b)));
FAKE_DB(db, &brt->ft->cmp_descriptor);
int cmp = brt->ft->compare_fun(&db, a, toku_fill_dbt(&y, le_key(b), le_keylen(b)));
return cmp;
}
static int
compare_pair_to_key (FT_HANDLE brt, const DBT *a, bytevec key, ITEMLEN keylen) {
DBT y;
FAKE_DB(db, &brt->h->cmp_descriptor);
int cmp = brt->h->compare_fun(&db, a, toku_fill_dbt(&y, key, keylen));
FAKE_DB(db, &brt->ft->cmp_descriptor);
int cmp = brt->ft->compare_fun(&db, a, toku_fill_dbt(&y, key, keylen));
return cmp;
}
......@@ -171,7 +171,7 @@ verify_sorted_by_key_msn(FT_HANDLE brt, FIFO fifo, OMT mt) {
assert_zero(r);
size_t offset = (size_t) v;
if (i > 0) {
struct toku_fifo_entry_key_msn_cmp_extra extra = { .desc = &brt->h->cmp_descriptor, .cmp = brt->h->compare_fun, .fifo = fifo };
struct toku_fifo_entry_key_msn_cmp_extra extra = { .desc = &brt->ft->cmp_descriptor, .cmp = brt->ft->compare_fun, .fifo = fifo };
if (toku_fifo_entry_key_msn_cmp(&extra, &last_offset, &offset) >= 0) {
result = TOKUDB_NEEDS_REPAIR;
break;
......@@ -185,7 +185,7 @@ verify_sorted_by_key_msn(FT_HANDLE brt, FIFO fifo, OMT mt) {
static int
count_eq_key_msn(FT_HANDLE brt, FIFO fifo, OMT mt, const DBT *key, MSN msn) {
struct toku_fifo_entry_key_msn_heaviside_extra extra = {
.desc = &brt->h->cmp_descriptor, .cmp = brt->h->compare_fun, .fifo = fifo, .key = key, .msn = msn
.desc = &brt->ft->cmp_descriptor, .cmp = brt->ft->compare_fun, .fifo = fifo, .key = key, .msn = msn
};
OMTVALUE v; u_int32_t idx;
int r = toku_omt_find_zero(mt, toku_fifo_entry_key_msn_heaviside, &extra, &v, &idx);
......@@ -206,11 +206,11 @@ toku_get_node_for_verify(
FTNODE* nodep
)
{
u_int32_t fullhash = toku_cachetable_hash(brt->h->cf, blocknum);
u_int32_t fullhash = toku_cachetable_hash(brt->ft->cf, blocknum);
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, brt->h);
fill_bfe_for_full_read(&bfe, brt->ft);
toku_pin_ftnode_off_client_thread(
brt->h,
brt->ft,
blocknum,
fullhash,
&bfe,
......@@ -311,7 +311,7 @@ toku_verify_ftnode (FT_HANDLE brt,
}
struct count_msgs_extra extra = { .count = 0, .key = &keydbt,
.msn = msn, .fifo = bnc->buffer,
.desc = &brt->h->cmp_descriptor, .cmp = brt->h->compare_fun };
.desc = &brt->ft->cmp_descriptor, .cmp = brt->ft->compare_fun };
extra.count = 0;
toku_omt_iterate(bnc->broadcast_list, count_msgs, &extra);
if (ft_msg_type_applies_all(type) || ft_msg_type_does_nothing(type)) {
......@@ -378,9 +378,9 @@ toku_verify_ftnode (FT_HANDLE brt,
done:
{
int r = toku_cachetable_unpin(
brt->h->cf,
brt->ft->cf,
node->thisnodename,
toku_cachetable_hash(brt->h->cf, node->thisnodename),
toku_cachetable_hash(brt->ft->cf, node->thisnodename),
CACHETABLE_CLEAN,
make_ftnode_pair_attr(node)
);
......@@ -395,24 +395,24 @@ done:
int
toku_verify_ft_with_progress (FT_HANDLE brt, int (*progress_callback)(void *extra, float progress), void *progress_extra, int verbose, int keep_on_going) {
assert(brt->h);
assert(brt->ft);
FTNODE root_node = NULL;
{
toku_ft_grab_treelock(brt->h);
toku_ft_grab_treelock(brt->ft);
u_int32_t root_hash;
CACHEKEY root_key;
toku_calculate_root_offset_pointer(brt->h, &root_key, &root_hash);
toku_calculate_root_offset_pointer(brt->ft, &root_key, &root_hash);
toku_get_node_for_verify(root_key, brt, &root_node);
toku_ft_release_treelock(brt->h);
toku_ft_release_treelock(brt->ft);
}
int r = toku_verify_ftnode(brt, ZERO_MSN, ZERO_MSN, root_node, -1, NULL, NULL, progress_callback, progress_extra, 1, verbose, keep_on_going);
if (r == 0) {
toku_ft_lock(brt->h);
brt->h->time_of_last_verification = time(NULL);
brt->h->dirty = 1;
toku_ft_unlock(brt->h);
toku_ft_lock(brt->ft);
brt->ft->time_of_last_verification = time(NULL);
brt->ft->dirty = 1;
toku_ft_unlock(brt->ft);
}
return r;
}
......
......@@ -408,7 +408,7 @@ exit:
// allocate and initialize a brt header.
// t->h->cf is not set to anything.
// t->ft->cf is not set to anything.
int
toku_create_new_ft(FT *ftp, FT_OPTIONS options, CACHEFILE cf, TOKUTXN txn) {
int r;
......@@ -505,7 +505,7 @@ int toku_read_ft_and_store_in_cachefile (FT_HANDLE brt, CACHEFILE cf, LSN max_ac
void
toku_ft_note_ft_handle_open(FT ft, FT_HANDLE live) {
toku_ft_lock(ft);
live->h = ft;
live->ft = ft;
toku_list_push(&ft->live_ft_handles, &live->live_ft_handle_link);
toku_ft_unlock(ft);
}
......@@ -548,7 +548,7 @@ FT_HANDLE toku_ft_get_some_existing_ft_handle(FT h) {
// convenient here for keeping the HOT variables threadsafe.)
void
toku_ft_note_hot_begin(FT_HANDLE brt) {
FT h = brt->h;
FT h = brt->ft;
time_t now = time(NULL);
// hold lock around setting and clearing of dirty bit
......@@ -565,7 +565,7 @@ toku_ft_note_hot_begin(FT_HANDLE brt) {
// Note: See note for toku_ft_note_hot_begin().
void
toku_ft_note_hot_complete(FT_HANDLE brt, BOOL success, MSN msn_at_start_of_hot) {
FT h = brt->h;
FT h = brt->ft;
time_t now = time(NULL);
toku_ft_lock(h);
......@@ -629,7 +629,7 @@ ft_handle_open_for_redirect(FT_HANDLE *new_ftp, const char *fname_in_env, TOKUTX
CACHETABLE ct = toku_cachefile_get_cachetable(old_h->cf);
r = toku_ft_handle_open_with_dict_id(t, fname_in_env, 0, 0, ct, txn, old_h->dict_id);
assert_zero(r);
assert(t->h->dict_id.dictid == old_h->dict_id.dictid);
assert(t->ft->dict_id.dictid == old_h->dict_id.dictid);
*new_ftp = t;
return r;
......@@ -653,14 +653,14 @@ dictionary_redirect_internal(const char *dst_fname_in_env, FT src_h, TOKUTXN txn
FT_HANDLE tmp_dst_ft = NULL;
r = ft_handle_open_for_redirect(&tmp_dst_ft, dst_fname_in_env, txn, src_h);
assert_zero(r);
dst_h = tmp_dst_ft->h;
dst_h = tmp_dst_ft->ft;
// some sanity checks on dst_filenum
dst_filenum = toku_cachefile_filenum(dst_h->cf);
assert(dst_filenum.fileid!=FILENUM_NONE.fileid);
assert(dst_filenum.fileid!=src_filenum.fileid); //Cannot be same file.
// for each live brt, brt->h is currently src_h
// for each live brt, brt->ft is currently src_h
// we want to change it to dummy_dst
while (!toku_list_empty(&src_h->live_ft_handles)) {
list = src_h->live_ft_handles.next;
......@@ -758,7 +758,7 @@ toku_dictionary_redirect (const char *dst_fname_in_env, FT_HANDLE old_ft, TOKUTX
// If the txn aborts, then this operation will be undone
int r;
FT old_h = old_ft->h;
FT old_h = old_ft->ft;
// dst file should not be open. (implies that dst and src are different because src must be open.)
{
......
......@@ -507,11 +507,11 @@ int toku_ft_loader_internal_init (/* out */ FTLOADER *blp,
#define SET_TO_MY_STRDUP(lval, s) do { char *v = toku_strdup(s); if (!v) { int r = errno; toku_ft_loader_internal_destroy(bl, TRUE); return r; } lval = v; } while (0)
MY_CALLOC_N(N, bl->root_xids_that_created);
for (int i=0; i<N; i++) if (brts[i]) bl->root_xids_that_created[i]=brts[i]->h->root_xid_that_created;
for (int i=0; i<N; i++) if (brts[i]) bl->root_xids_that_created[i]=brts[i]->ft->root_xid_that_created;
MY_CALLOC_N(N, bl->dbs);
for (int i=0; i<N; i++) if (brts[i]) bl->dbs[i]=dbs[i];
MY_CALLOC_N(N, bl->descriptors);
for (int i=0; i<N; i++) if (brts[i]) bl->descriptors[i]=&brts[i]->h->descriptor;
for (int i=0; i<N; i++) if (brts[i]) bl->descriptors[i]=&brts[i]->ft->descriptor;
MY_CALLOC_N(N, bl->new_fnames_in_env);
for (int i=0; i<N; i++) SET_TO_MY_STRDUP(bl->new_fnames_in_env[i], new_fnames_in_env[i]);
MY_CALLOC_N(N, bl->extracted_datasizes); // the calloc_n zeroed everything, which is what we want
......
......@@ -193,11 +193,11 @@ toku_logger_open_rollback(TOKULOGGER logger, CACHETABLE cachetable, BOOL create)
assert_zero(r);
r = toku_ft_handle_open(t, ROLLBACK_CACHEFILE_NAME, create, create, cachetable, NULL_TXN);
assert_zero(r);
logger->rollback_cachefile = t->h->cf;
logger->rollback_cachefile = t->ft->cf;
//Verify it is empty
assert(!t->h->panic);
assert(!t->ft->panic);
//Must have no data blocks (rollback logs or otherwise).
toku_block_verify_no_data_blocks_except_root_unlocked(t->h->blocktable, t->h->root_blocknum);
toku_block_verify_no_data_blocks_except_root_unlocked(t->ft->blocktable, t->ft->root_blocknum);
BOOL is_empty;
is_empty = toku_ft_is_empty_fast(t);
assert(is_empty);
......
......@@ -68,8 +68,8 @@ static void file_map_tuple_init(struct file_map_tuple *tuple, FILENUM filenum, F
tuple->iname = iname;
// use a fake DB for comparisons, using the ft's cmp descriptor
memset(&tuple->fake_db, 0, sizeof(tuple->fake_db));
tuple->fake_db.cmp_descriptor = &tuple->ft_handle->h->cmp_descriptor;
tuple->fake_db.descriptor = &tuple->ft_handle->h->descriptor;
tuple->fake_db.cmp_descriptor = &tuple->ft_handle->ft->cmp_descriptor;
tuple->fake_db.descriptor = &tuple->ft_handle->ft->descriptor;
}
static void file_map_tuple_destroy(struct file_map_tuple *tuple) {
......@@ -432,7 +432,7 @@ static int toku_recover_fassociate (struct logtype_fassociate *l, RECOVER_ENV re
r = toku_ft_handle_create(&t);
assert(r==0);
r = toku_ft_handle_open_recovery(t, ROLLBACK_CACHEFILE_NAME, false, false, renv->ct, (TOKUTXN)NULL, l->filenum, max_acceptable_lsn);
renv->logger->rollback_cachefile = t->h->cf;
renv->logger->rollback_cachefile = t->ft->cf;
} else {
r = internal_recover_fopen_or_fcreate(renv, FALSE, 0, &l->iname, l->filenum, l->treeflags, NULL, 0, 0, TOKU_DEFAULT_COMPRESSION_METHOD, max_acceptable_lsn);
assert(r==0);
......@@ -535,7 +535,7 @@ static int recover_xstillopen_internal (TOKUTXN *txnp,
struct file_map_tuple *tuple = NULL;
r = file_map_find(&renv->fmap, open_filenums.filenums[i], &tuple);
if (r==0) {
info.open_fts[info.num_fts++] = tuple->ft_handle->h;
info.open_fts[info.num_fts++] = tuple->ft_handle->ft;
}
else {
assert(r==DB_NOTFOUND);
......@@ -622,9 +622,9 @@ static int toku_recover_suppress_rollback (struct logtype_suppress_rollback *UU(
r = toku_txnid2txn(renv->logger, l->xid, &txn);
assert(r == 0);
assert(txn!=NULL);
FT h = tuple->ft_handle->h;
FT h = tuple->ft_handle->ft;
toku_ft_suppress_rollbacks(h, txn);
r = toku_txn_note_ft(txn, tuple->ft_handle->h);
r = toku_txn_note_ft(txn, tuple->ft_handle->ft);
assert(r==0);
}
return 0;
......@@ -890,7 +890,7 @@ static int toku_recover_enq_insert (struct logtype_enq_insert *l, RECOVER_ENV re
toku_fill_dbt(&valdbt, l->value.data, l->value.len);
r = toku_ft_maybe_insert(tuple->ft_handle, &keydbt, &valdbt, txn, TRUE, l->lsn, FALSE, FT_INSERT);
assert(r == 0);
r = toku_txn_note_ft(txn, tuple->ft_handle->h);
r = toku_txn_note_ft(txn, tuple->ft_handle->ft);
assert(r == 0);
}
return 0;
......
......@@ -330,7 +330,7 @@ test_prefetching(void) {
FT_HANDLE XMALLOC(brt);
FT XCALLOC(brt_h);
brt->h = brt_h;
brt->ft = brt_h;
brt_h->type = FT_CURRENT;
brt_h->panic = 0; brt_h->panic_string = 0;
brt_h->basementnodesize = 128*1024;
......@@ -355,7 +355,7 @@ test_prefetching(void) {
assert(size == 100);
}
FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->h, 1, 1, FALSE);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, 1, 1, FALSE);
assert(r==0);
test_prefetch_read(fd, brt, brt_h);
......
......@@ -273,7 +273,7 @@ test_serialize_nonleaf(void) {
FT_HANDLE XMALLOC(brt);
FT XCALLOC(brt_h);
brt->h = brt_h;
brt->ft = brt_h;
brt_h->type = FT_CURRENT;
brt_h->panic = 0; brt_h->panic_string = 0;
brt_h->basementnodesize = 128*1024;
......@@ -298,7 +298,7 @@ test_serialize_nonleaf(void) {
assert(size == 100);
}
FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->h, 1, 1, FALSE);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, 1, 1, FALSE);
assert(r==0);
test1(fd, brt_h, &dn);
......@@ -359,7 +359,7 @@ test_serialize_leaf(void) {
FT_HANDLE XMALLOC(brt);
FT XCALLOC(brt_h);
brt->h = brt_h;
brt->ft = brt_h;
brt_h->type = FT_CURRENT;
brt_h->panic = 0; brt_h->panic_string = 0;
brt_h->basementnodesize = 128*1024;
......@@ -384,7 +384,7 @@ test_serialize_leaf(void) {
assert(size == 100);
}
FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->h, 1, 1, FALSE);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, 1, 1, FALSE);
assert(r==0);
test1(fd, brt_h, &dn);
......
......@@ -104,7 +104,7 @@ test_serialize_leaf(int valsize, int nelts, double entropy) {
FT_HANDLE XMALLOC(brt);
FT XCALLOC(brt_h);
brt->h = brt_h;
brt->ft = brt_h;
brt_h->type = FT_CURRENT;
brt_h->panic = 0; brt_h->panic_string = 0;
brt_h->basementnodesize = 128*1024;
......@@ -133,7 +133,7 @@ test_serialize_leaf(int valsize, int nelts, double entropy) {
struct timeval t[2];
gettimeofday(&t[0], NULL);
FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->h, 1, 1, FALSE);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, 1, 1, FALSE);
assert(r==0);
gettimeofday(&t[1], NULL);
double dt;
......@@ -237,7 +237,7 @@ test_serialize_nonleaf(int valsize, int nelts, double entropy) {
FT_HANDLE XMALLOC(brt);
FT XCALLOC(brt_h);
brt->h = brt_h;
brt->ft = brt_h;
brt_h->type = FT_CURRENT;
brt_h->panic = 0; brt_h->panic_string = 0;
brt_h->basementnodesize = 128*1024;
......@@ -266,7 +266,7 @@ test_serialize_nonleaf(int valsize, int nelts, double entropy) {
struct timeval t[2];
gettimeofday(&t[0], NULL);
FTNODE_DISK_DATA ndd = NULL;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->h, 1, 1, FALSE);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), &sn, &ndd, TRUE, brt->ft, 1, 1, FALSE);
assert(r==0);
gettimeofday(&t[1], NULL);
double dt;
......
......@@ -186,14 +186,14 @@ static void write_sn_to_disk(int fd, FT_HANDLE brt, FTNODE sn, FTNODE_DISK_DATA*
if (do_clone) {
void* cloned_node_v = NULL;
PAIR_ATTR attr;
toku_ftnode_clone_callback(sn, &cloned_node_v, &attr, FALSE, brt->h);
toku_ftnode_clone_callback(sn, &cloned_node_v, &attr, FALSE, brt->ft);
FTNODE cloned_node = cloned_node_v;
r = toku_serialize_ftnode_to(fd, make_blocknum(20), cloned_node, src_ndd, FALSE, brt->h, 1, 1, FALSE);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), cloned_node, src_ndd, FALSE, brt->ft, 1, 1, FALSE);
assert(r==0);
toku_ftnode_free(&cloned_node);
}
else {
r = toku_serialize_ftnode_to(fd, make_blocknum(20), sn, src_ndd, TRUE, brt->h, 1, 1, FALSE);
r = toku_serialize_ftnode_to(fd, make_blocknum(20), sn, src_ndd, TRUE, brt->ft, 1, 1, FALSE);
assert(r==0);
}
}
......@@ -250,7 +250,7 @@ test_serialize_leaf_check_msn(enum ftnode_verify_type bft, BOOL do_clone) {
FT_HANDLE XMALLOC(brt);
FT XCALLOC(brt_h);
brt->h = brt_h;
brt->ft = brt_h;
brt_h->type = FT_CURRENT;
brt_h->panic = 0; brt_h->panic_string = 0;
brt_h->basementnodesize = 128*1024;
......@@ -392,7 +392,7 @@ test_serialize_leaf_with_large_pivots(enum ftnode_verify_type bft, BOOL do_clone
FT_HANDLE XMALLOC(brt);
FT XCALLOC(brt_h);
brt->h = brt_h;
brt->ft = brt_h;
brt_h->type = FT_CURRENT;
brt_h->panic = 0; brt_h->panic_string = 0;
brt_h->basementnodesize = 128*1024;
......@@ -531,7 +531,7 @@ test_serialize_leaf_with_many_rows(enum ftnode_verify_type bft, BOOL do_clone) {
FT_HANDLE XMALLOC(brt);
FT XCALLOC(brt_h);
brt->h = brt_h;
brt->ft = brt_h;
brt_h->type = FT_CURRENT;
brt_h->panic = 0; brt_h->panic_string = 0;
brt_h->basementnodesize = 128*1024;
......@@ -675,7 +675,7 @@ test_serialize_leaf_with_large_rows(enum ftnode_verify_type bft, BOOL do_clone)
FT_HANDLE XMALLOC(brt);
FT XCALLOC(brt_h);
brt->h = brt_h;
brt->ft = brt_h;
brt_h->type = FT_CURRENT;
brt_h->panic = 0; brt_h->panic_string = 0;
brt_h->basementnodesize = 128*1024;
......@@ -835,7 +835,7 @@ test_serialize_leaf_with_empty_basement_nodes(enum ftnode_verify_type bft, BOOL
FT_HANDLE XMALLOC(brt);
FT XCALLOC(brt_h);
brt->h = brt_h;
brt->ft = brt_h;
brt_h->type = FT_CURRENT;
brt_h->panic = 0; brt_h->panic_string = 0;
brt_h->basementnodesize = 128*1024;
......@@ -959,7 +959,7 @@ test_serialize_leaf_with_multiple_empty_basement_nodes(enum ftnode_verify_type b
FT_HANDLE XMALLOC(brt);
FT XCALLOC(brt_h);
brt->h = brt_h;
brt->ft = brt_h;
brt_h->type = FT_CURRENT;
brt_h->panic = 0; brt_h->panic_string = 0;
brt_h->basementnodesize = 128*1024;
......@@ -1088,7 +1088,7 @@ test_serialize_leaf(enum ftnode_verify_type bft, BOOL do_clone) {
FT_HANDLE XMALLOC(brt);
FT XCALLOC(brt_h);
brt->h = brt_h;
brt->ft = brt_h;
brt_h->type = FT_CURRENT;
brt_h->panic = 0; brt_h->panic_string = 0;
brt_h->basementnodesize = 128*1024;
......@@ -1230,7 +1230,7 @@ test_serialize_nonleaf(enum ftnode_verify_type bft, BOOL do_clone) {
FT_HANDLE XMALLOC(brt);
FT XCALLOC(brt_h);
brt->h = brt_h;
brt->ft = brt_h;
brt_h->type = FT_CURRENT;
brt_h->panic = 0; brt_h->panic_string = 0;
brt_h->basementnodesize = 128*1024;
......
......@@ -25,7 +25,7 @@ static void test_header (void) {
r = toku_open_ft_handle(fname, 1, &t, 1024, 256, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
// now insert some info into the header
FT h = t->h;
FT h = t->ft;
h->dirty = 1;
h->layout_version_original = 13;
h->layout_version_read_from_disk = 14;
......@@ -43,7 +43,7 @@ static void test_header (void) {
r = toku_open_ft_handle(fname, 0, &t, 1024, 256, TOKU_DEFAULT_COMPRESSION_METHOD, ct, null_txn, toku_builtin_compare_fun);
assert(r==0);
h = t->h;
h = t->ft;
STAT64INFO_S expected_stats = {20, 21}; // on checkpoint, on_disk_stats copied to checkpoint_staging_stats
assert(h->layout_version == FT_LAYOUT_VERSION);
assert(h->layout_version_original == 13);
......
......@@ -66,7 +66,7 @@ insert_into_child_buffer(FT_HANDLE brt, FTNODE node, int childnum, int minkey, i
unsigned int key = htonl(val);
DBT thekey; toku_fill_dbt(&thekey, &key, sizeof key);
DBT theval; toku_fill_dbt(&theval, &val, sizeof val);
toku_ft_append_to_child_buffer(brt->h->compare_fun, NULL, node, childnum, FT_INSERT, msn, xids_get_root_xids(), true, &thekey, &theval);
toku_ft_append_to_child_buffer(brt->ft->compare_fun, NULL, node, childnum, FT_INSERT, msn, xids_get_root_xids(), true, &thekey, &theval);
node->max_msn_applied_to_node_on_disk = msn;
}
}
......@@ -90,7 +90,7 @@ make_tree(FT_HANDLE brt, int height, int fanout, int nperleaf, int *seq, int *mi
DBT pivotkey;
toku_ft_nonleaf_append_child(node, child, toku_fill_dbt(&pivotkey, toku_xmemdup(&k, sizeof k), sizeof k));
}
toku_unpin_ftnode(brt->h, child);
toku_unpin_ftnode(brt->ft, child);
insert_into_child_buffer(brt, node, childnum, minkeys[childnum], maxkeys[childnum]);
}
*minkey = minkeys[0];
......@@ -134,12 +134,12 @@ test_make_tree(int height, int fanout, int nperleaf, int do_verify) {
FTNODE newroot = make_tree(brt, height, fanout, nperleaf, &seq, &minkey, &maxkey);
// set the new root to point to the new tree
toku_ft_set_new_root_blocknum(brt->h, newroot->thisnodename);
toku_ft_set_new_root_blocknum(brt->ft, newroot->thisnodename);
newroot->max_msn_applied_to_node_on_disk = last_dummymsn(); // capture msn of last message injected into tree
// unpin the new root
toku_unpin_ftnode(brt->h, newroot);
toku_unpin_ftnode(brt->ft, newroot);
if (do_verify) {
r = toku_verify_ft(brt);
......
......@@ -48,7 +48,7 @@ append_leaf(FT_HANDLE brt, FTNODE leafnode, void *key, size_t keylen, void *val,
FT_MSG_S cmd = { FT_INSERT, msn, xids_get_root_xids(), .u.id = { &thekey, &theval } };
u_int64_t workdone=0;
toku_ft_leaf_apply_cmd(brt->h->compare_fun, brt->h->update_fun, &brt->h->cmp_descriptor, leafnode, &cmd, &workdone, NULL);
toku_ft_leaf_apply_cmd(brt->ft->compare_fun, brt->ft->update_fun, &brt->ft->cmp_descriptor, leafnode, &cmd, &workdone, NULL);
{
int r = toku_ft_lookup(brt, &thekey, lookup_checkf, &pair);
assert(r==0);
......@@ -56,7 +56,7 @@ append_leaf(FT_HANDLE brt, FTNODE leafnode, void *key, size_t keylen, void *val,
}
FT_MSG_S badcmd = { FT_INSERT, msn, xids_get_root_xids(), .u.id = { &thekey, &badval } };
toku_ft_leaf_apply_cmd(brt->h->compare_fun, brt->h->update_fun, &brt->h->cmp_descriptor, leafnode, &badcmd, &workdone, NULL);
toku_ft_leaf_apply_cmd(brt->ft->compare_fun, brt->ft->update_fun, &brt->ft->cmp_descriptor, leafnode, &badcmd, &workdone, NULL);
// message should be rejected for duplicate msn, row should still have original val
......@@ -69,7 +69,7 @@ append_leaf(FT_HANDLE brt, FTNODE leafnode, void *key, size_t keylen, void *val,
// now verify that message with proper msn gets through
msn = next_dummymsn();
FT_MSG_S cmd2 = { FT_INSERT, msn, xids_get_root_xids(), .u.id = { &thekey, &val2 } };
toku_ft_leaf_apply_cmd(brt->h->compare_fun, brt->h->update_fun, &brt->h->cmp_descriptor, leafnode, &cmd2, &workdone, NULL);
toku_ft_leaf_apply_cmd(brt->ft->compare_fun, brt->ft->update_fun, &brt->ft->cmp_descriptor, leafnode, &cmd2, &workdone, NULL);
// message should be accepted, val should have new value
{
......@@ -81,7 +81,7 @@ append_leaf(FT_HANDLE brt, FTNODE leafnode, void *key, size_t keylen, void *val,
// now verify that message with lesser (older) msn is rejected
msn.msn = msn.msn - 10;
FT_MSG_S cmd3 = { FT_INSERT, msn, xids_get_root_xids(), .u.id = { &thekey, &badval } };
toku_ft_leaf_apply_cmd(brt->h->compare_fun, brt->h->update_fun, &brt->h->cmp_descriptor, leafnode, &cmd3, &workdone, NULL);
toku_ft_leaf_apply_cmd(brt->ft->compare_fun, brt->ft->update_fun, &brt->ft->cmp_descriptor, leafnode, &cmd3, &workdone, NULL);
// message should be rejected, val should still have value in pair2
{
......@@ -125,7 +125,7 @@ test_msnfilter(int do_verify) {
FTNODE newroot = make_node(brt, 0);
// set the new root to point to the new tree
toku_ft_set_new_root_blocknum(brt->h, newroot->thisnodename);
toku_ft_set_new_root_blocknum(brt->ft, newroot->thisnodename);
// KLUDGE: Unpin the new root so toku_ft_lookup() can pin it. (Pin lock is no longer a recursive
// mutex.) Just leaving it unpinned for this test program works because it is the only
......@@ -133,7 +133,7 @@ test_msnfilter(int do_verify) {
// node and unlock it again before and after each message injection, but that requires more
// work than it's worth (setting up dummy callbacks, etc.)
//
toku_unpin_ftnode(brt->h, newroot);
toku_unpin_ftnode(brt->ft, newroot);
populate_leaf(brt, newroot, htonl(2), 1);
......
......@@ -126,7 +126,7 @@ insert_random_message_to_bn(FT_HANDLE t, BASEMENTNODE blb, LEAFENTRY *save, XIDS
int64_t numbytes;
int r = apply_msg_to_leafentry(&msg, NULL, &memsize, save, NULL, NULL, NULL, &numbytes);
assert_zero(r);
toku_ft_bn_apply_cmd(t->h->compare_fun, t->h->update_fun, NULL, blb, &msg, NULL, NULL);
toku_ft_bn_apply_cmd(t->ft->compare_fun, t->ft->update_fun, NULL, blb, &msg, NULL, NULL);
if (msn.msn > blb->max_msn_applied.msn) {
blb->max_msn_applied = msn;
}
......@@ -167,11 +167,11 @@ insert_same_message_to_bns(FT_HANDLE t, BASEMENTNODE blb1, BASEMENTNODE blb2, LE
int64_t numbytes;
int r = apply_msg_to_leafentry(&msg, NULL, &memsize, save, NULL, NULL, NULL, &numbytes);
assert_zero(r);
toku_ft_bn_apply_cmd(t->h->compare_fun, t->h->update_fun, NULL, blb1, &msg, NULL, NULL);
toku_ft_bn_apply_cmd(t->ft->compare_fun, t->ft->update_fun, NULL, blb1, &msg, NULL, NULL);
if (msn.msn > blb1->max_msn_applied.msn) {
blb1->max_msn_applied = msn;
}
toku_ft_bn_apply_cmd(t->h->compare_fun, t->h->update_fun, NULL, blb2, &msg, NULL, NULL);
toku_ft_bn_apply_cmd(t->ft->compare_fun, t->ft->update_fun, NULL, blb2, &msg, NULL, NULL);
if (msn.msn > blb2->max_msn_applied.msn) {
blb2->max_msn_applied = msn;
}
......@@ -277,7 +277,7 @@ flush_to_internal(FT_HANDLE t) {
set_BNC(child, 0, child_bnc);
BP_STATE(child, 0) = PT_AVAIL;
toku_bnc_flush_to_child(t->h, parent_bnc, child);
toku_bnc_flush_to_child(t->ft, parent_bnc, child);
int parent_messages_present[num_parent_messages];
int child_messages_present[num_child_messages];
......@@ -412,7 +412,7 @@ flush_to_internal_multiple(FT_HANDLE t) {
}
}
toku_bnc_flush_to_child(t->h, parent_bnc, child);
toku_bnc_flush_to_child(t->ft, parent_bnc, child);
int total_messages = 0;
for (i = 0; i < 8; ++i) {
......@@ -583,7 +583,7 @@ flush_to_leaf(FT_HANDLE t, bool make_leaf_up_to_date, bool use_flush) {
if (make_leaf_up_to_date) {
for (i = 0; i < num_parent_messages; ++i) {
if (!parent_messages_is_fresh[i]) {
toku_ft_leaf_apply_cmd(t->h->compare_fun, t->h->update_fun, &t->h->descriptor, child, parent_messages[i], NULL, NULL);
toku_ft_leaf_apply_cmd(t->ft->compare_fun, t->ft->update_fun, &t->ft->descriptor, child, parent_messages[i], NULL, NULL);
}
}
for (i = 0; i < 8; ++i) {
......@@ -604,7 +604,7 @@ flush_to_leaf(FT_HANDLE t, bool make_leaf_up_to_date, bool use_flush) {
}
if (use_flush) {
toku_bnc_flush_to_child(t->h, parent_bnc, child);
toku_bnc_flush_to_child(t->ft, parent_bnc, child);
destroy_nonleaf_childinfo(parent_bnc);
} else {
FTNODE XMALLOC(parentnode);
......@@ -807,7 +807,7 @@ flush_to_leaf_with_keyrange(FT_HANDLE t, bool make_leaf_up_to_date) {
for (i = 0; i < num_parent_messages; ++i) {
if (dummy_cmp(NULL, parent_messages[i]->u.id.key, &childkeys[7]) <= 0 &&
!parent_messages_is_fresh[i]) {
toku_ft_leaf_apply_cmd(t->h->compare_fun, t->h->update_fun, &t->h->descriptor, child, parent_messages[i], NULL, NULL);
toku_ft_leaf_apply_cmd(t->ft->compare_fun, t->ft->update_fun, &t->ft->descriptor, child, parent_messages[i], NULL, NULL);
}
}
for (i = 0; i < 8; ++i) {
......@@ -1000,8 +1000,8 @@ compare_apply_and_flush(FT_HANDLE t, bool make_leaf_up_to_date) {
if (make_leaf_up_to_date) {
for (i = 0; i < num_parent_messages; ++i) {
if (!parent_messages_is_fresh[i]) {
toku_ft_leaf_apply_cmd(t->h->compare_fun, t->h->update_fun, &t->h->descriptor, child1, parent_messages[i], NULL, NULL);
toku_ft_leaf_apply_cmd(t->h->compare_fun, t->h->update_fun, &t->h->descriptor, child2, parent_messages[i], NULL, NULL);
toku_ft_leaf_apply_cmd(t->ft->compare_fun, t->ft->update_fun, &t->ft->descriptor, child1, parent_messages[i], NULL, NULL);
toku_ft_leaf_apply_cmd(t->ft->compare_fun, t->ft->update_fun, &t->ft->descriptor, child2, parent_messages[i], NULL, NULL);
}
}
for (i = 0; i < 8; ++i) {
......@@ -1015,7 +1015,7 @@ compare_apply_and_flush(FT_HANDLE t, bool make_leaf_up_to_date) {
}
}
toku_bnc_flush_to_child(t->h, parent_bnc, child1);
toku_bnc_flush_to_child(t->ft, parent_bnc, child1);
FTNODE XMALLOC(parentnode);
BLOCKNUM parentblocknum = { 17 };
......@@ -1130,7 +1130,7 @@ test_main (int argc, const char *argv[]) {
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);
r = toku_ft_set_update(t, orthopush_flush_update_fun); assert(r==0);
// HACK
t->h->update_fun = orthopush_flush_update_fun;
t->ft->update_fun = orthopush_flush_update_fun;
for (int i = 0; i < 10; ++i) {
flush_to_internal(t);
......
......@@ -141,11 +141,11 @@ doit (BOOL after_child_pin) {
FTNODE node = NULL;
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, t->h);
fill_bfe_for_min_read(&bfe, t->ft);
toku_pin_ftnode_off_client_thread(
t->h,
t->ft,
node_root,
toku_cachetable_hash(t->h->cf, node_root),
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
TRUE,
0,
......@@ -157,14 +157,14 @@ doit (BOOL after_child_pin) {
assert(toku_bnc_nbytesinbuf(BNC(node, 0)) > 0);
// do the flush
flush_some_child(t->h, node, &fa);
flush_some_child(t->ft, node, &fa);
assert(checkpoint_callback_called);
// now let's pin the root again and make sure it is flushed
toku_pin_ftnode_off_client_thread(
t->h,
t->ft,
node_root,
toku_cachetable_hash(t->h->cf, node_root),
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
TRUE,
0,
......@@ -174,7 +174,7 @@ doit (BOOL after_child_pin) {
assert(node->height == 1);
assert(node->n_children == 1);
assert(toku_bnc_nbytesinbuf(BNC(node, 0)) == 0);
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
void *ret;
r = toku_pthread_join(checkpoint_tid, &ret);
......@@ -197,11 +197,11 @@ doit (BOOL after_child_pin) {
//
// now pin the root, verify that we have a message in there, and that it is clean
//
fill_bfe_for_full_read(&bfe, c_ft->h);
fill_bfe_for_full_read(&bfe, c_ft->ft);
toku_pin_ftnode_off_client_thread(
c_ft->h,
c_ft->ft,
node_root,
toku_cachetable_hash(c_ft->h->cf, node_root),
toku_cachetable_hash(c_ft->ft->cf, node_root),
&bfe,
TRUE,
0,
......@@ -217,12 +217,12 @@ doit (BOOL after_child_pin) {
else {
assert(toku_bnc_nbytesinbuf(BNC(node, 0)) > 0);
}
toku_unpin_ftnode_off_client_thread(c_ft->h, node);
toku_unpin_ftnode_off_client_thread(c_ft->ft, node);
toku_pin_ftnode_off_client_thread(
c_ft->h,
c_ft->ft,
node_leaf,
toku_cachetable_hash(c_ft->h->cf, node_root),
toku_cachetable_hash(c_ft->ft->cf, node_root),
&bfe,
TRUE,
0,
......@@ -238,7 +238,7 @@ doit (BOOL after_child_pin) {
else {
assert(BLB_NBYTESINBUF(node,0) == 0);
}
toku_unpin_ftnode_off_client_thread(c_ft->h, node);
toku_unpin_ftnode_off_client_thread(c_ft->ft, node);
struct check_pair pair1 = {2, "a", 0, NULL, 0};
DBT k;
......
......@@ -152,18 +152,18 @@ doit (int state) {
FTNODE node = NULL;
toku_pin_node_with_min_bfe(&node, node_leaves[0], t);
BLB_SEQINSERT(node, node->n_children-1) = FALSE;
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
toku_pin_node_with_min_bfe(&node, node_leaves[1], t);
BLB_SEQINSERT(node, node->n_children-1) = FALSE;
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, t->h);
fill_bfe_for_min_read(&bfe, t->ft);
toku_pin_ftnode_off_client_thread(
t->h,
t->ft,
node_root,
toku_cachetable_hash(t->h->cf, node_root),
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
TRUE,
0,
......@@ -174,14 +174,14 @@ doit (int state) {
assert(node->n_children == 2);
// do the flush
flush_some_child(t->h, node, &fa);
flush_some_child(t->ft, node, &fa);
assert(checkpoint_callback_called);
// now let's pin the root again and make sure it is has merged
toku_pin_ftnode_off_client_thread(
t->h,
t->ft,
node_root,
toku_cachetable_hash(t->h->cf, node_root),
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
TRUE,
0,
......@@ -190,7 +190,7 @@ doit (int state) {
);
assert(node->height == 1);
assert(node->n_children == 1);
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
void *ret;
r = toku_pthread_join(checkpoint_tid, &ret);
......@@ -216,11 +216,11 @@ doit (int state) {
//
// now pin the root, verify that the state is what we expect
//
fill_bfe_for_full_read(&bfe, c_ft->h);
fill_bfe_for_full_read(&bfe, c_ft->ft);
toku_pin_ftnode_off_client_thread(
c_ft->h,
c_ft->ft,
node_root,
toku_cachetable_hash(c_ft->h->cf, node_root),
toku_cachetable_hash(c_ft->ft->cf, node_root),
&bfe,
TRUE,
0,
......@@ -243,14 +243,14 @@ doit (int state) {
else {
assert(false);
}
toku_unpin_ftnode_off_client_thread(c_ft->h, node);
toku_unpin_ftnode_off_client_thread(c_ft->ft, node);
// now let's verify the leaves are what we expect
if (state == flt_flush_before_merge || state == flt_flush_before_pin_second_node_for_merge) {
toku_pin_ftnode_off_client_thread(
c_ft->h,
c_ft->ft,
left_child,
toku_cachetable_hash(c_ft->h->cf, left_child),
toku_cachetable_hash(c_ft->ft->cf, left_child),
&bfe,
TRUE,
0,
......@@ -261,12 +261,12 @@ doit (int state) {
assert(!node->dirty);
assert(node->n_children == 1);
assert(toku_omt_size(BLB_BUFFER(node,0)) == 1);
toku_unpin_ftnode_off_client_thread(c_ft->h, node);
toku_unpin_ftnode_off_client_thread(c_ft->ft, node);
toku_pin_ftnode_off_client_thread(
c_ft->h,
c_ft->ft,
right_child,
toku_cachetable_hash(c_ft->h->cf, right_child),
toku_cachetable_hash(c_ft->ft->cf, right_child),
&bfe,
TRUE,
0,
......@@ -277,13 +277,13 @@ doit (int state) {
assert(!node->dirty);
assert(node->n_children == 1);
assert(toku_omt_size(BLB_BUFFER(node,0)) == 1);
toku_unpin_ftnode_off_client_thread(c_ft->h, node);
toku_unpin_ftnode_off_client_thread(c_ft->ft, node);
}
else if (state == ft_flush_aflter_merge || state == flt_flush_before_unpin_remove) {
toku_pin_ftnode_off_client_thread(
c_ft->h,
c_ft->ft,
left_child,
toku_cachetable_hash(c_ft->h->cf, left_child),
toku_cachetable_hash(c_ft->ft->cf, left_child),
&bfe,
TRUE,
0,
......@@ -294,7 +294,7 @@ doit (int state) {
assert(!node->dirty);
assert(node->n_children == 1);
assert(toku_omt_size(BLB_BUFFER(node,0)) == 2);
toku_unpin_ftnode_off_client_thread(c_ft->h, node);
toku_unpin_ftnode_off_client_thread(c_ft->ft, node);
}
else {
assert(FALSE);
......
......@@ -172,18 +172,18 @@ doit (int state) {
FTNODE node = NULL;
toku_pin_node_with_min_bfe(&node, node_leaves[0], t);
BLB_SEQINSERT(node, node->n_children-1) = FALSE;
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
toku_pin_node_with_min_bfe(&node, node_leaves[1], t);
BLB_SEQINSERT(node, node->n_children-1) = FALSE;
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, t->h);
fill_bfe_for_min_read(&bfe, t->ft);
toku_pin_ftnode_off_client_thread(
t->h,
t->ft,
node_root,
toku_cachetable_hash(t->h->cf, node_root),
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
TRUE,
0,
......@@ -194,14 +194,14 @@ doit (int state) {
assert(node->n_children == 2);
// do the flush
flush_some_child(t->h, node, &fa);
flush_some_child(t->ft, node, &fa);
assert(checkpoint_callback_called);
// now let's pin the root again and make sure it is has rebalanced
toku_pin_ftnode_off_client_thread(
t->h,
t->ft,
node_root,
toku_cachetable_hash(t->h->cf, node_root),
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
TRUE,
0,
......@@ -210,7 +210,7 @@ doit (int state) {
);
assert(node->height == 1);
assert(node->n_children == 2);
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
void *ret;
r = toku_pthread_join(checkpoint_tid, &ret);
......@@ -236,11 +236,11 @@ doit (int state) {
//
// now pin the root, verify that the state is what we expect
//
fill_bfe_for_full_read(&bfe, c_ft->h);
fill_bfe_for_full_read(&bfe, c_ft->ft);
toku_pin_ftnode_off_client_thread(
c_ft->h,
c_ft->ft,
node_root,
toku_cachetable_hash(c_ft->h->cf, node_root),
toku_cachetable_hash(c_ft->ft->cf, node_root),
&bfe,
TRUE,
0,
......@@ -255,13 +255,13 @@ doit (int state) {
left_child = BP_BLOCKNUM(node,0);
right_child = BP_BLOCKNUM(node,1);
toku_unpin_ftnode_off_client_thread(c_ft->h, node);
toku_unpin_ftnode_off_client_thread(c_ft->ft, node);
// now let's verify the leaves are what we expect
toku_pin_ftnode_off_client_thread(
c_ft->h,
c_ft->ft,
left_child,
toku_cachetable_hash(c_ft->h->cf, left_child),
toku_cachetable_hash(c_ft->ft->cf, left_child),
&bfe,
TRUE,
0,
......@@ -272,12 +272,12 @@ doit (int state) {
assert(!node->dirty);
assert(node->n_children == 1);
assert(toku_omt_size(BLB_BUFFER(node,0)) == 2);
toku_unpin_ftnode_off_client_thread(c_ft->h, node);
toku_unpin_ftnode_off_client_thread(c_ft->ft, node);
toku_pin_ftnode_off_client_thread(
c_ft->h,
c_ft->ft,
right_child,
toku_cachetable_hash(c_ft->h->cf, right_child),
toku_cachetable_hash(c_ft->ft->cf, right_child),
&bfe,
TRUE,
0,
......@@ -288,7 +288,7 @@ doit (int state) {
assert(!node->dirty);
assert(node->n_children == 1);
assert(toku_omt_size(BLB_BUFFER(node,0)) == 2);
toku_unpin_ftnode_off_client_thread(c_ft->h, node);
toku_unpin_ftnode_off_client_thread(c_ft->ft, node);
DBT k;
......
......@@ -155,11 +155,11 @@ doit (BOOL after_split) {
FTNODE node = NULL;
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, t->h);
fill_bfe_for_min_read(&bfe, t->ft);
toku_pin_ftnode_off_client_thread(
t->h,
t->ft,
node_root,
toku_cachetable_hash(t->h->cf, node_root),
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
TRUE,
0,
......@@ -170,14 +170,14 @@ doit (BOOL after_split) {
assert(node->n_children == 1);
// do the flush
flush_some_child(t->h, node, &fa);
flush_some_child(t->ft, node, &fa);
assert(checkpoint_callback_called);
// now let's pin the root again and make sure it is has split
toku_pin_ftnode_off_client_thread(
t->h,
t->ft,
node_root,
toku_cachetable_hash(t->h->cf, node_root),
toku_cachetable_hash(t->ft->cf, node_root),
&bfe,
TRUE,
0,
......@@ -186,7 +186,7 @@ doit (BOOL after_split) {
);
assert(node->height == 1);
assert(node->n_children == 2);
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
void *ret;
r = toku_pthread_join(checkpoint_tid, &ret);
......@@ -212,11 +212,11 @@ doit (BOOL after_split) {
//
// now pin the root, verify that we have a message in there, and that it is clean
//
fill_bfe_for_full_read(&bfe, c_ft->h);
fill_bfe_for_full_read(&bfe, c_ft->ft);
toku_pin_ftnode_off_client_thread(
c_ft->h,
c_ft->ft,
node_root,
toku_cachetable_hash(c_ft->h->cf, node_root),
toku_cachetable_hash(c_ft->ft->cf, node_root),
&bfe,
TRUE,
0,
......@@ -237,14 +237,14 @@ doit (BOOL after_split) {
left_child = BP_BLOCKNUM(node,0);
assert(left_child.b == node_leaf.b);
}
toku_unpin_ftnode_off_client_thread(c_ft->h, node);
toku_unpin_ftnode_off_client_thread(c_ft->ft, node);
// now let's verify the leaves are what we expect
if (after_split) {
toku_pin_ftnode_off_client_thread(
c_ft->h,
c_ft->ft,
left_child,
toku_cachetable_hash(c_ft->h->cf, left_child),
toku_cachetable_hash(c_ft->ft->cf, left_child),
&bfe,
TRUE,
0,
......@@ -255,12 +255,12 @@ doit (BOOL after_split) {
assert(!node->dirty);
assert(node->n_children == 1);
assert(toku_omt_size(BLB_BUFFER(node,0)) == 1);
toku_unpin_ftnode_off_client_thread(c_ft->h, node);
toku_unpin_ftnode_off_client_thread(c_ft->ft, node);
toku_pin_ftnode_off_client_thread(
c_ft->h,
c_ft->ft,
right_child,
toku_cachetable_hash(c_ft->h->cf, right_child),
toku_cachetable_hash(c_ft->ft->cf, right_child),
&bfe,
TRUE,
0,
......@@ -271,13 +271,13 @@ doit (BOOL after_split) {
assert(!node->dirty);
assert(node->n_children == 1);
assert(toku_omt_size(BLB_BUFFER(node,0)) == 1);
toku_unpin_ftnode_off_client_thread(c_ft->h, node);
toku_unpin_ftnode_off_client_thread(c_ft->ft, node);
}
else {
toku_pin_ftnode_off_client_thread(
c_ft->h,
c_ft->ft,
left_child,
toku_cachetable_hash(c_ft->h->cf, left_child),
toku_cachetable_hash(c_ft->ft->cf, left_child),
&bfe,
TRUE,
0,
......@@ -288,7 +288,7 @@ doit (BOOL after_split) {
assert(!node->dirty);
assert(node->n_children == 1);
assert(toku_omt_size(BLB_BUFFER(node,0)) == 2);
toku_unpin_ftnode_off_client_thread(c_ft->h, node);
toku_unpin_ftnode_off_client_thread(c_ft->ft, node);
}
......
......@@ -59,8 +59,8 @@ doit (void) {
assert(r==0);
toku_free(fname);
brt->h->update_fun = update_func;
brt->h->update_fun = update_func;
brt->ft->update_fun = update_func;
brt->ft->update_fun = update_func;
toku_testsetup_initialize(); // must precede any other toku_testsetup calls
......@@ -161,11 +161,11 @@ doit (void) {
// now lock and release the leaf node to make sure it is what we expect it to be.
FTNODE node = NULL;
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, brt->h);
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_off_client_thread(
brt->h,
brt->ft,
node_leaf,
toku_cachetable_hash(brt->h->cf, node_leaf),
toku_cachetable_hash(brt->ft->cf, node_leaf),
&bfe,
TRUE,
0,
......@@ -176,7 +176,7 @@ doit (void) {
assert(node->n_children == 2);
assert(BP_STATE(node,0) == PT_AVAIL);
assert(BP_STATE(node,1) == PT_AVAIL);
toku_unpin_ftnode_off_client_thread(brt->h, node);
toku_unpin_ftnode_off_client_thread(brt->ft, node);
// now do a lookup on one of the keys, this should bring a leaf node up to date
DBT k;
......@@ -190,11 +190,11 @@ doit (void) {
// node is in memory and another is
// on disk
//
fill_bfe_for_min_read(&bfe, brt->h);
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_off_client_thread(
brt->h,
brt->ft,
node_leaf,
toku_cachetable_hash(brt->h->cf, node_leaf),
toku_cachetable_hash(brt->ft->cf, node_leaf),
&bfe,
TRUE,
0,
......@@ -205,16 +205,16 @@ doit (void) {
assert(node->n_children == 2);
assert(BP_STATE(node,0) == PT_AVAIL);
assert(BP_STATE(node,1) == PT_AVAIL);
toku_unpin_ftnode_off_client_thread(brt->h, node);
toku_unpin_ftnode_off_client_thread(brt->ft, node);
//
// now let us induce a clean on the internal node
//
fill_bfe_for_min_read(&bfe, brt->h);
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_off_client_thread(
brt->h,
brt->ft,
node_internal,
toku_cachetable_hash(brt->h->cf, node_internal),
toku_cachetable_hash(brt->ft->cf, node_internal),
&bfe,
TRUE,
0,
......@@ -229,16 +229,16 @@ doit (void) {
r = toku_ftnode_cleaner_callback(
node,
node_internal,
toku_cachetable_hash(brt->h->cf, node_internal),
brt->h
toku_cachetable_hash(brt->ft->cf, node_internal),
brt->ft
);
// verify that node_internal's buffer is empty
fill_bfe_for_min_read(&bfe, brt->h);
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_off_client_thread(
brt->h,
brt->ft,
node_internal,
toku_cachetable_hash(brt->h->cf, node_internal),
toku_cachetable_hash(brt->ft->cf, node_internal),
&bfe,
TRUE,
0,
......@@ -247,7 +247,7 @@ doit (void) {
);
// check that buffers are empty
assert(toku_bnc_nbytesinbuf(BNC(node, 0)) == 0);
toku_unpin_ftnode_off_client_thread(brt->h, node);
toku_unpin_ftnode_off_client_thread(brt->ft, node);
//
// now run a checkpoint to get everything clean,
......
......@@ -60,7 +60,7 @@ doit (BOOL keep_other_bn_in_memory) {
toku_free(fname);
brt->options.update_fun = update_func;
brt->h->update_fun = update_func;
brt->ft->update_fun = update_func;
toku_testsetup_initialize(); // must precede any other toku_testsetup calls
......@@ -166,11 +166,11 @@ doit (BOOL keep_other_bn_in_memory) {
// now lock and release the leaf node to make sure it is what we expect it to be.
FTNODE node = NULL;
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, brt->h);
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_off_client_thread(
brt->h,
brt->ft,
node_leaf,
toku_cachetable_hash(brt->h->cf, node_leaf),
toku_cachetable_hash(brt->ft->cf, node_leaf),
&bfe,
TRUE,
0,
......@@ -182,13 +182,13 @@ doit (BOOL keep_other_bn_in_memory) {
// a hack to get the basement nodes evicted
for (int i = 0; i < 20; i++) {
PAIR_ATTR attr;
toku_ftnode_pe_callback(node, make_pair_attr(0xffffffff), &attr, brt->h);
toku_ftnode_pe_callback(node, make_pair_attr(0xffffffff), &attr, brt->ft);
}
// this ensures that when we do the lookups below,
// that the data is read off disk
assert(BP_STATE(node,0) == PT_ON_DISK);
assert(BP_STATE(node,1) == PT_ON_DISK);
toku_unpin_ftnode_off_client_thread(brt->h, node);
toku_unpin_ftnode_off_client_thread(brt->ft, node);
// now do a lookup on one of the keys, this should bring a leaf node up to date
DBT k;
......@@ -204,7 +204,7 @@ doit (BOOL keep_other_bn_in_memory) {
// but only one should have broadcast message
// applied.
//
fill_bfe_for_full_read(&bfe, brt->h);
fill_bfe_for_full_read(&bfe, brt->ft);
}
else {
//
......@@ -213,12 +213,12 @@ doit (BOOL keep_other_bn_in_memory) {
// node is in memory and another is
// on disk
//
fill_bfe_for_min_read(&bfe, brt->h);
fill_bfe_for_min_read(&bfe, brt->ft);
}
toku_pin_ftnode_off_client_thread(
brt->h,
brt->ft,
node_leaf,
toku_cachetable_hash(brt->h->cf, node_leaf),
toku_cachetable_hash(brt->ft->cf, node_leaf),
&bfe,
TRUE,
0,
......@@ -234,16 +234,16 @@ doit (BOOL keep_other_bn_in_memory) {
else {
assert(BP_STATE(node,1) == PT_ON_DISK);
}
toku_unpin_ftnode_off_client_thread(brt->h, node);
toku_unpin_ftnode_off_client_thread(brt->ft, node);
//
// now let us induce a clean on the internal node
//
fill_bfe_for_min_read(&bfe, brt->h);
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_off_client_thread(
brt->h,
brt->ft,
node_internal,
toku_cachetable_hash(brt->h->cf, node_internal),
toku_cachetable_hash(brt->ft->cf, node_internal),
&bfe,
TRUE,
0,
......@@ -258,16 +258,16 @@ doit (BOOL keep_other_bn_in_memory) {
r = toku_ftnode_cleaner_callback(
node,
node_internal,
toku_cachetable_hash(brt->h->cf, node_internal),
brt->h
toku_cachetable_hash(brt->ft->cf, node_internal),
brt->ft
);
// verify that node_internal's buffer is empty
fill_bfe_for_min_read(&bfe, brt->h);
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_off_client_thread(
brt->h,
brt->ft,
node_internal,
toku_cachetable_hash(brt->h->cf, node_internal),
toku_cachetable_hash(brt->ft->cf, node_internal),
&bfe,
TRUE,
0,
......@@ -276,7 +276,7 @@ doit (BOOL keep_other_bn_in_memory) {
);
// check that buffers are empty
assert(toku_bnc_nbytesinbuf(BNC(node, 0)) == 0);
toku_unpin_ftnode_off_client_thread(brt->h, node);
toku_unpin_ftnode_off_client_thread(brt->ft, node);
//
// now run a checkpoint to get everything clean,
......
......@@ -59,7 +59,7 @@ doit (void) {
toku_free(fname);
brt->options.update_fun = update_func;
brt->h->update_fun = update_func;
brt->ft->update_fun = update_func;
toku_testsetup_initialize(); // must precede any other toku_testsetup calls
......@@ -144,7 +144,7 @@ doit (void) {
toku_pin_node_with_min_bfe(&node, node_leaf[1], brt);
// hack to get merge going
BLB_SEQINSERT(node, node->n_children-1) = FALSE;
toku_unpin_ftnode(brt->h, node);
toku_unpin_ftnode(brt->ft, node);
// now do a lookup on one of the keys, this should bring a leaf node up to date
DBT k;
......@@ -153,11 +153,11 @@ doit (void) {
assert(r==0);
struct ftnode_fetch_extra bfe;
fill_bfe_for_min_read(&bfe, brt->h);
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_off_client_thread(
brt->h,
brt->ft,
node_internal,
toku_cachetable_hash(brt->h->cf, node_internal),
toku_cachetable_hash(brt->ft->cf, node_internal),
&bfe,
TRUE,
0,
......@@ -171,16 +171,16 @@ doit (void) {
r = toku_ftnode_cleaner_callback(
node,
node_internal,
toku_cachetable_hash(brt->h->cf, node_internal),
brt->h
toku_cachetable_hash(brt->ft->cf, node_internal),
brt->ft
);
// verify that node_internal's buffer is empty
fill_bfe_for_min_read(&bfe, brt->h);
fill_bfe_for_min_read(&bfe, brt->ft);
toku_pin_ftnode_off_client_thread(
brt->h,
brt->ft,
node_internal,
toku_cachetable_hash(brt->h->cf, node_internal),
toku_cachetable_hash(brt->ft->cf, node_internal),
&bfe,
TRUE,
0,
......@@ -191,7 +191,7 @@ doit (void) {
assert(node->n_children == 1);
// check that buffers are empty
assert(toku_bnc_nbytesinbuf(BNC(node, 0)) == 0);
toku_unpin_ftnode_off_client_thread(brt->h, node);
toku_unpin_ftnode_off_client_thread(brt->ft, node);
//
// now run a checkpoint to get everything clean,
......
......@@ -185,7 +185,7 @@ doit (void) {
);
curr_child_to_flush = 0;
num_flushes_called = 0;
flush_some_child(t->h, node, &fa);
flush_some_child(t->ft, node, &fa);
assert(num_flushes_called == 1);
toku_pin_node_with_min_bfe(&node, node_internal, t);
......@@ -196,14 +196,14 @@ doit (void) {
// child 1 should still have message in buffer
assert(toku_bnc_n_entries(node->bp[0].ptr.u.nonleaf) == 0);
assert(toku_bnc_n_entries(node->bp[1].ptr.u.nonleaf) > 0);
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
r = toku_checkpoint(ct, NULL, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT);
assert_zero(r);
toku_pin_node_with_min_bfe(&node, node_internal, t);
assert(!node->dirty);
curr_child_to_flush = 1;
num_flushes_called = 0;
flush_some_child(t->h, node, &fa);
flush_some_child(t->ft, node, &fa);
assert(num_flushes_called == 1);
toku_pin_node_with_min_bfe(&node, node_internal, t);
......@@ -214,14 +214,14 @@ doit (void) {
assert(toku_bnc_n_entries(node->bp[0].ptr.u.nonleaf) == 0);
assert(toku_bnc_n_entries(node->bp[1].ptr.u.nonleaf) == 0);
// now let's do a flush with an empty buffer, make sure it is ok
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
r = toku_checkpoint(ct, NULL, NULL, NULL, NULL, NULL, CLIENT_CHECKPOINT);
assert_zero(r);
toku_pin_node_with_min_bfe(&node, node_internal, t);
assert(!node->dirty);
curr_child_to_flush = 0;
num_flushes_called = 0;
flush_some_child(t->h, node, &fa);
flush_some_child(t->ft, node, &fa);
assert(num_flushes_called == 1);
toku_pin_node_with_min_bfe(&node, node_internal, t);
......@@ -231,7 +231,7 @@ doit (void) {
// both buffers should be empty now
assert(toku_bnc_n_entries(node->bp[0].ptr.u.nonleaf) == 0);
assert(toku_bnc_n_entries(node->bp[1].ptr.u.nonleaf) == 0);
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
// now let's start a flush from the root, that always recursively flushes
flusher_advice_init(
......@@ -250,18 +250,18 @@ doit (void) {
toku_assert_entire_node_in_memory(node); // entire root is in memory
curr_child_to_flush = i;
num_flushes_called = 0;
flush_some_child(t->h, node, &fa);
flush_some_child(t->ft, node, &fa);
assert(num_flushes_called == 2);
toku_pin_node_with_min_bfe(&node, node_internal, t);
assert(!node->dirty); // nothing was flushed, so node better not be dirty
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
toku_pin_node_with_min_bfe(&node, node_leaf[0], t);
assert(!node->dirty); // nothing was flushed, so node better not be dirty
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
toku_pin_node_with_min_bfe(&node, node_leaf[1], t);
assert(!node->dirty); // nothing was flushed, so node better not be dirty
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
}
// now one more test to show a bug was fixed
......@@ -286,17 +286,17 @@ doit (void) {
toku_pin_node_with_min_bfe(&node, node_internal, t);
for (int i = 0; i < 20; i++) {
PAIR_ATTR attr;
toku_ftnode_pe_callback(node, make_pair_attr(0xffffffff), &attr, t->h);
toku_ftnode_pe_callback(node, make_pair_attr(0xffffffff), &attr, t->ft);
}
assert(BP_STATE(node,0) == PT_COMPRESSED);
toku_unpin_ftnode(t->h, node);
toku_unpin_ftnode(t->ft, node);
//now let's do the same test as above
toku_pin_node_with_min_bfe(&node, node_root, t);
toku_assert_entire_node_in_memory(node); // entire root is in memory
curr_child_to_flush = 0;
num_flushes_called = 0;
flush_some_child(t->h, node, &fa);
flush_some_child(t->ft, node, &fa);
assert(num_flushes_called == 2);
r = toku_close_ft_handle_nolsn(t, 0); assert(r==0);
......
......@@ -171,12 +171,12 @@ test_split_on_boundary(void)
FTNODE nodea, nodeb;
DBT splitk;
// if we haven't done it right, we should hit the assert in the top of move_leafentries
ftleaf_split(brt->h, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
verify_basement_node_msns(nodea, dummy_msn_3884);
verify_basement_node_msns(nodeb, dummy_msn_3884);
toku_unpin_ftnode(brt->h, nodeb);
toku_unpin_ftnode(brt->ft, nodeb);
r = toku_close_ft_handle_nolsn(brt, NULL); assert(r == 0);
r = toku_cachetable_close(&ct); assert(r == 0);
......@@ -244,9 +244,9 @@ test_split_with_everything_on_the_left(void)
FTNODE nodea, nodeb;
DBT splitk;
// if we haven't done it right, we should hit the assert in the top of move_leafentries
ftleaf_split(brt->h, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
toku_unpin_ftnode(brt->h, nodeb);
toku_unpin_ftnode(brt->ft, nodeb);
r = toku_close_ft_handle_nolsn(brt, NULL); assert(r == 0);
r = toku_cachetable_close(&ct); assert(r == 0);
......@@ -319,9 +319,9 @@ test_split_on_boundary_of_last_node(void)
FTNODE nodea, nodeb;
DBT splitk;
// if we haven't done it right, we should hit the assert in the top of move_leafentries
ftleaf_split(brt->h, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
toku_unpin_ftnode(brt->h, nodeb);
toku_unpin_ftnode(brt->ft, nodeb);
r = toku_close_ft_handle_nolsn(brt, NULL); assert(r == 0);
r = toku_cachetable_close(&ct); assert(r == 0);
......@@ -387,9 +387,9 @@ test_split_at_begin(void)
FTNODE nodea, nodeb;
DBT splitk;
// if we haven't done it right, we should hit the assert in the top of move_leafentries
ftleaf_split(brt->h, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
toku_unpin_ftnode(brt->h, nodeb);
toku_unpin_ftnode(brt->ft, nodeb);
r = toku_close_ft_handle_nolsn(brt, NULL); assert(r == 0);
r = toku_cachetable_close(&ct); assert(r == 0);
......@@ -451,9 +451,9 @@ test_split_at_end(void)
FTNODE nodea, nodeb;
DBT splitk;
// if we haven't done it right, we should hit the assert in the top of move_leafentries
ftleaf_split(brt->h, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
toku_unpin_ftnode(brt->h, nodeb);
toku_unpin_ftnode(brt->ft, nodeb);
r = toku_close_ft_handle_nolsn(brt, NULL); assert(r == 0);
r = toku_cachetable_close(&ct); assert(r == 0);
......@@ -505,12 +505,12 @@ test_split_odd_nodes(void)
FTNODE nodea, nodeb;
DBT splitk;
// if we haven't done it right, we should hit the assert in the top of move_leafentries
ftleaf_split(brt->h, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
ftleaf_split(brt->ft, &sn, &nodea, &nodeb, &splitk, TRUE, 0, NULL);
verify_basement_node_msns(nodea, dummy_msn_3884);
verify_basement_node_msns(nodeb, dummy_msn_3884);
toku_unpin_ftnode(brt->h, nodeb);
toku_unpin_ftnode(brt->ft, nodeb);
r = toku_close_ft_handle_nolsn(brt, NULL); assert(r == 0);
r = toku_cachetable_close(&ct); assert(r == 0);
......
......@@ -71,11 +71,11 @@ doit (void) {
// we pin it and verify that it is not
FTNODE node;
struct ftnode_fetch_extra bfe;
fill_bfe_for_full_read(&bfe, t->h);
fill_bfe_for_full_read(&bfe, t->ft);
toku_pin_ftnode_off_client_thread(
t->h,
t->ft,
node_internal,
toku_cachetable_hash(t->h->cf, node_internal),
toku_cachetable_hash(t->ft->cf, node_internal),
&bfe,
TRUE,
0,
......@@ -86,7 +86,7 @@ doit (void) {
// simply assert that the buffer is less than 50MB,
// we inserted 100MB of data in there.
assert(toku_bnc_nbytesinbuf(BNC(node, 0)) < 50*1000*1000);
toku_unpin_ftnode_off_client_thread(t->h, node);
toku_unpin_ftnode_off_client_thread(t->ft, node);
r = toku_close_ft_handle_nolsn(t, 0); assert(r==0);
r = toku_cachetable_close(&ct); assert(r==0);
......
......@@ -70,7 +70,7 @@ insert_into_child_buffer(FT_HANDLE brt, FTNODE node, int childnum, int minkey, i
unsigned int key = htonl(val);
DBT thekey; toku_fill_dbt(&thekey, &key, sizeof key);
DBT theval; toku_fill_dbt(&theval, &val, sizeof val);
toku_ft_append_to_child_buffer(brt->h->compare_fun, NULL, node, childnum, FT_INSERT, msn, xids_get_root_xids(), true, &thekey, &theval);
toku_ft_append_to_child_buffer(brt->ft->compare_fun, NULL, node, childnum, FT_INSERT, msn, xids_get_root_xids(), true, &thekey, &theval);
// Create bad tree (don't do following):
// node->max_msn_applied_to_node = msn;
......@@ -96,7 +96,7 @@ make_tree(FT_HANDLE brt, int height, int fanout, int nperleaf, int *seq, int *mi
DBT pivotkey;
toku_ft_nonleaf_append_child(node, child, toku_fill_dbt(&pivotkey, toku_xmemdup(&k, sizeof k), sizeof k));
}
toku_unpin_ftnode(brt->h, child);
toku_unpin_ftnode(brt->ft, child);
insert_into_child_buffer(brt, node, childnum, minkeys[childnum], maxkeys[childnum]);
}
*minkey = minkeys[0];
......@@ -140,13 +140,13 @@ test_make_tree(int height, int fanout, int nperleaf, int do_verify) {
FTNODE newroot = make_tree(brt, height, fanout, nperleaf, &seq, &minkey, &maxkey);
// set the new root to point to the new tree
toku_ft_set_new_root_blocknum(brt->h, newroot->thisnodename);
toku_ft_set_new_root_blocknum(brt->ft, newroot->thisnodename);
// Create bad tree (don't do following):
// newroot->max_msn_applied_to_node = last_dummymsn(); // capture msn of last message injected into tree
// unpin the new root
toku_unpin_ftnode(brt->h, newroot);
toku_unpin_ftnode(brt->ft, newroot);
if (do_verify) {
r = toku_verify_ft(brt);
......
......@@ -67,7 +67,7 @@ make_tree(FT_HANDLE brt, int height, int fanout, int nperleaf, int *seq, int *mi
DBT pivotkey;
toku_ft_nonleaf_append_child(node, child, toku_fill_dbt(&pivotkey, toku_xmemdup(&k, sizeof k), sizeof k));
}
toku_unpin_ftnode(brt->h, child);
toku_unpin_ftnode(brt->ft, child);
}
*minkey = minkeys[0];
*maxkey = maxkeys[0];
......@@ -110,10 +110,10 @@ test_make_tree(int height, int fanout, int nperleaf, int do_verify) {
FTNODE newroot = make_tree(brt, height, fanout, nperleaf, &seq, &minkey, &maxkey);
// discard the old root block
toku_ft_set_new_root_blocknum(brt->h, newroot->thisnodename);
toku_ft_set_new_root_blocknum(brt->ft, newroot->thisnodename);
// unpin the new root
toku_unpin_ftnode(brt->h, newroot);
toku_unpin_ftnode(brt->ft, newroot);
if (do_verify) {
r = toku_verify_ft(brt);
......
......@@ -70,10 +70,10 @@ test_dup_in_leaf(int do_verify) {
populate_leaf(newroot, htonl(2), 2);
// set the new root to point to the new tree
toku_ft_set_new_root_blocknum(brt->h, newroot->thisnodename);
toku_ft_set_new_root_blocknum(brt->ft, newroot->thisnodename);
// unpin the new root
toku_unpin_ftnode(brt->h, newroot);
toku_unpin_ftnode(brt->ft, newroot);
if (do_verify) {
r = toku_verify_ft(brt);
......
......@@ -67,7 +67,7 @@ make_tree(FT_HANDLE brt, int height, int fanout, int nperleaf, int *seq, int *mi
DBT pivotkey;
toku_ft_nonleaf_append_child(node, child, toku_fill_dbt(&pivotkey, toku_xmemdup(&k, sizeof k), sizeof k));
}
toku_unpin_ftnode(brt->h, child);
toku_unpin_ftnode(brt->ft, child);
}
*minkey = minkeys[0];
*maxkey = maxkeys[0];
......@@ -111,10 +111,10 @@ test_make_tree(int height, int fanout, int nperleaf, int do_verify) {
// discard the old root block
// set the new root to point to the new tree
toku_ft_set_new_root_blocknum(brt->h, newroot->thisnodename);
toku_ft_set_new_root_blocknum(brt->ft, newroot->thisnodename);
// unpin the new root
toku_unpin_ftnode(brt->h, newroot);
toku_unpin_ftnode(brt->ft, newroot);
if (do_verify) {
r = toku_verify_ft(brt);
......
......@@ -58,7 +58,7 @@ insert_into_child_buffer(FT_HANDLE brt, FTNODE node, int childnum, int minkey, i
DBT thekey; toku_fill_dbt(&thekey, &key, sizeof key);
DBT theval; toku_fill_dbt(&theval, &val, sizeof val);
MSN msn = next_dummymsn();
toku_ft_append_to_child_buffer(brt->h->compare_fun, NULL, node, childnum, FT_INSERT, msn, xids_get_root_xids(), true, &thekey, &theval);
toku_ft_append_to_child_buffer(brt->ft->compare_fun, NULL, node, childnum, FT_INSERT, msn, xids_get_root_xids(), true, &thekey, &theval);
}
}
......@@ -81,7 +81,7 @@ make_tree(FT_HANDLE brt, int height, int fanout, int nperleaf, int *seq, int *mi
DBT pivotkey;
toku_ft_nonleaf_append_child(node, child, toku_fill_dbt(&pivotkey, toku_xmemdup(&k, sizeof k), sizeof k));
}
toku_unpin_ftnode(brt->h, child);
toku_unpin_ftnode(brt->ft, child);
insert_into_child_buffer(brt, node, childnum, minkeys[childnum], maxkeys[childnum]);
}
*minkey = minkeys[0];
......@@ -126,10 +126,10 @@ test_make_tree(int height, int fanout, int nperleaf, int do_verify) {
// discard the old root block
// set the new root to point to the new tree
toku_ft_set_new_root_blocknum(brt->h, newroot->thisnodename);
toku_ft_set_new_root_blocknum(brt->ft, newroot->thisnodename);
// unpin the new root
toku_unpin_ftnode(brt->h, newroot);
toku_unpin_ftnode(brt->ft, newroot);
if (do_verify) {
r = toku_verify_ft(brt);
......
......@@ -69,10 +69,10 @@ test_dup_in_leaf(int do_verify) {
populate_leaf(newroot, htonl(1), 2);
// set the new root to point to the new tree
toku_ft_set_new_root_blocknum(brt->h, newroot->thisnodename);
toku_ft_set_new_root_blocknum(brt->ft, newroot->thisnodename);
// unpin the new root
toku_unpin_ftnode(brt->h, newroot);
toku_unpin_ftnode(brt->ft, newroot);
if (do_verify) {
r = toku_verify_ft(brt);
......
......@@ -67,7 +67,7 @@ make_tree(FT_HANDLE brt, int height, int fanout, int nperleaf, int *seq, int *mi
DBT pivotkey;
toku_ft_nonleaf_append_child(node, child, toku_fill_dbt(&pivotkey, toku_xmemdup(&k, sizeof k), sizeof k));
}
toku_unpin_ftnode(brt->h, child);
toku_unpin_ftnode(brt->ft, child);
}
*minkey = minkeys[0];
*maxkey = maxkeys[0];
......@@ -110,10 +110,10 @@ test_make_tree(int height, int fanout, int nperleaf, int do_verify) {
FTNODE newroot = make_tree(brt, height, fanout, nperleaf, &seq, &minkey, &maxkey);
// discard the old root block
toku_ft_set_new_root_blocknum(brt->h, newroot->thisnodename);
toku_ft_set_new_root_blocknum(brt->ft, newroot->thisnodename);
// unpin the new root
toku_unpin_ftnode(brt->h, newroot);
toku_unpin_ftnode(brt->ft, newroot);
if (do_verify) {
r = toku_verify_ft(brt);
......
......@@ -182,7 +182,7 @@ toku_indexer_create_indexer(DB_ENV *env,
XCALLOC_N(N, indexer->i->fnums);
if ( !indexer->i->fnums ) { rval = ENOMEM; goto create_exit; }
for(int i=0;i<indexer->i->N;i++) {
indexer->i->fnums[i] = toku_cachefile_filenum(db_struct_i(dest_dbs[i])->ft_handle->h->cf);
indexer->i->fnums[i] = toku_cachefile_filenum(db_struct_i(dest_dbs[i])->ft_handle->ft->cf);
}
indexer->i->filenums.num = N;
indexer->i->filenums.filenums = indexer->i->fnums;
......
......@@ -362,8 +362,8 @@ toku_db_open(DB * db, DB_TXN * txn, const char *fname, const char *dbname, DBTYP
// Need to investigate further.
static void db_on_redirect_callback(FT_HANDLE brt, void* extra) {
DB* db = extra;
db->descriptor = &brt->h->descriptor;
db->cmp_descriptor = &brt->h->cmp_descriptor;
db->descriptor = &brt->ft->descriptor;
db->cmp_descriptor = &brt->ft->cmp_descriptor;
}
int
......@@ -425,8 +425,8 @@ db_open_iname(DB * db, DB_TXN * txn, const char *iname_in_env, u_int32_t flags,
// is in the brt header. we need a copy of the pointer in the DB.
// TODO: there may be a cleaner way to do this.
// toku_ft_get_descriptor(db, &cmp_desc, &desc); ??
db->descriptor = &brt->h->descriptor;
db->cmp_descriptor = &brt->h->cmp_descriptor;
db->descriptor = &brt->ft->descriptor;
db->cmp_descriptor = &brt->ft->cmp_descriptor;
if (need_locktree) {
db->i->dict_id = toku_ft_get_dictionary_id(db->i->ft_handle);
......
......@@ -34,7 +34,7 @@ static inline int db_opened(DB *db) {
static inline toku_dbt_cmp
toku_db_get_compare_fun(DB* db) {
return db->i->ft_handle->h->compare_fun;
return db->i->ft_handle->ft->compare_fun;
}
int toku_db_pre_acquire_fileops_lock(DB *db, DB_TXN *txn);
......
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