Loading newbrt/brt-cachetable-wrappers.c +5 −22 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ #include <brttypes.h> #include <brt-flusher.h> #include <brt-internal.h> #include <cachetable.h> static void brtnode_get_key_and_fullhash( Loading Loading @@ -49,11 +48,7 @@ cachetable_put_empty_node_with_dep_nodes( brtnode_get_key_and_fullhash, new_node, make_pair_attr(sizeof(BRTNODE)), toku_brtnode_flush_callback, toku_brtnode_pe_est_callback, toku_brtnode_pe_callback, toku_brtnode_cleaner_callback, h, get_write_callbacks_for_node(h), h, num_dependent_nodes, dependent_cf, Loading Loading @@ -142,15 +137,11 @@ toku_pin_brtnode( fullhash, &node_v, NULL, toku_brtnode_flush_callback, get_write_callbacks_for_node(brt->h), toku_brtnode_fetch_callback, toku_brtnode_pe_est_callback, toku_brtnode_pe_callback, toku_brtnode_pf_req_callback, toku_brtnode_pf_callback, toku_brtnode_cleaner_callback, bfe, //read_extraargs brt->h, //write_extraargs unlockers); if (r==0) { BRTNODE node = node_v; Loading Loading @@ -184,15 +175,11 @@ toku_pin_brtnode_holding_lock( fullhash, &node_v, NULL, toku_brtnode_flush_callback, get_write_callbacks_for_node(brt->h), toku_brtnode_fetch_callback, toku_brtnode_pe_est_callback, toku_brtnode_pe_callback, toku_brtnode_pf_req_callback, toku_brtnode_pf_callback, toku_brtnode_cleaner_callback, bfe, brt->h bfe ); assert(r==0); BRTNODE node = node_v; Loading Loading @@ -228,15 +215,11 @@ toku_pin_brtnode_off_client_thread( fullhash, &node_v, NULL, toku_brtnode_flush_callback, get_write_callbacks_for_node(h), toku_brtnode_fetch_callback, toku_brtnode_pe_est_callback, toku_brtnode_pe_callback, toku_brtnode_pf_req_callback, toku_brtnode_pf_callback, toku_brtnode_cleaner_callback, bfe, h, num_dependent_nodes, dependent_cf, dependent_keys, Loading newbrt/brt-cachetable-wrappers.h +1 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ #include <c_dialects.h> #include <brttypes.h> #include "cachetable.h" C_BEGIN Loading newbrt/brt-flusher.h +0 −16 Original line number Diff line number Diff line Loading @@ -65,22 +65,6 @@ toku_flusher_thread_set_callback( void* extra ); /** * Brings the node into memory and flushes the fullest buffer. If the * heaviest child is empty, does nothing, otherwise, executes * flush_some_child to do the flush. * * Wrapped by toku_brtnode_cleaner_callback to provide access to * brt_status which currently just lives in brt.c. */ int toku_brtnode_cleaner_callback( void *brtnode_pv, BLOCKNUM blocknum, u_int32_t fullhash, void *extraargs ); /** * Puts a workitem on the flusher thread queue, scheduling the node to be * flushed by flush_some_child. Loading newbrt/brt-internal.h +11 −0 Original line number Diff line number Diff line Loading @@ -532,10 +532,21 @@ extern void toku_brtnode_pe_est_callback(void* brtnode_pv, long* bytes_freed_est extern int toku_brtnode_pe_callback (void *brtnode_pv, PAIR_ATTR old_attr, PAIR_ATTR* new_attr, void *extraargs); extern BOOL toku_brtnode_pf_req_callback(void* brtnode_pv, void* read_extraargs); int toku_brtnode_pf_callback(void* brtnode_pv, void* read_extraargs, int fd, PAIR_ATTR* sizep); extern int toku_brtnode_cleaner_callback( void *brtnode_pv, BLOCKNUM blocknum, u_int32_t fullhash, void *extraargs); extern int toku_brt_alloc_init_header(BRT t, TOKUTXN txn); extern int toku_read_brt_header_and_store_in_cachefile (BRT brt, CACHEFILE cf, LSN max_acceptable_lsn, struct brt_header **header, BOOL* was_open); extern CACHEKEY* toku_calculate_root_offset_pointer (struct brt_header* h, u_int32_t *root_hash); static inline CACHETABLE_WRITE_CALLBACK get_write_callbacks_for_node(struct brt_header* h) { CACHETABLE_WRITE_CALLBACK wc; wc.flush_callback = toku_brtnode_flush_callback; wc.pe_est_callback = toku_brtnode_pe_est_callback; wc.pe_callback = toku_brtnode_pe_callback; wc.cleaner_callback = toku_brtnode_cleaner_callback; wc.write_extraargs = h; return wc; } static const BRTNODE null_brtnode=0; // How long is the pivot key? Loading newbrt/brt-test-helpers.c +6 −18 Original line number Diff line number Diff line Loading @@ -94,15 +94,11 @@ int toku_testsetup_get_sersize(BRT brt, BLOCKNUM diskoff) // Return the size on toku_cachetable_hash(brt->cf, diskoff), &node_v, NULL, toku_brtnode_flush_callback, get_write_callbacks_for_node(brt->h), toku_brtnode_fetch_callback, toku_brtnode_pe_est_callback, toku_brtnode_pe_callback, toku_brtnode_pf_req_callback, toku_brtnode_pf_callback, toku_brtnode_cleaner_callback, &bfe, brt->h &bfe ); assert(r==0); int size = toku_serialize_brtnode_size(node_v); Loading @@ -124,15 +120,11 @@ int toku_testsetup_insert_to_leaf (BRT brt, BLOCKNUM blocknum, char *key, int ke toku_cachetable_hash(brt->cf, blocknum), &node_v, NULL, toku_brtnode_flush_callback, get_write_callbacks_for_node(brt->h), toku_brtnode_fetch_callback, toku_brtnode_pe_est_callback, toku_brtnode_pe_callback, toku_brtnode_pf_req_callback, toku_brtnode_pf_callback, toku_brtnode_cleaner_callback, &bfe, brt->h &bfe ); if (r!=0) return r; BRTNODE node=node_v; Loading Loading @@ -200,15 +192,11 @@ int toku_testsetup_insert_to_nonleaf (BRT brt, BLOCKNUM blocknum, enum brt_msg_t toku_cachetable_hash(brt->cf, blocknum), &node_v, NULL, toku_brtnode_flush_callback, get_write_callbacks_for_node(brt->h), toku_brtnode_fetch_callback, toku_brtnode_pe_est_callback, toku_brtnode_pe_callback, toku_brtnode_pf_req_callback, toku_brtnode_pf_callback, toku_brtnode_cleaner_callback, &bfe, brt->h &bfe ); if (r!=0) return r; BRTNODE node=node_v; Loading Loading
newbrt/brt-cachetable-wrappers.c +5 −22 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ #include <brttypes.h> #include <brt-flusher.h> #include <brt-internal.h> #include <cachetable.h> static void brtnode_get_key_and_fullhash( Loading Loading @@ -49,11 +48,7 @@ cachetable_put_empty_node_with_dep_nodes( brtnode_get_key_and_fullhash, new_node, make_pair_attr(sizeof(BRTNODE)), toku_brtnode_flush_callback, toku_brtnode_pe_est_callback, toku_brtnode_pe_callback, toku_brtnode_cleaner_callback, h, get_write_callbacks_for_node(h), h, num_dependent_nodes, dependent_cf, Loading Loading @@ -142,15 +137,11 @@ toku_pin_brtnode( fullhash, &node_v, NULL, toku_brtnode_flush_callback, get_write_callbacks_for_node(brt->h), toku_brtnode_fetch_callback, toku_brtnode_pe_est_callback, toku_brtnode_pe_callback, toku_brtnode_pf_req_callback, toku_brtnode_pf_callback, toku_brtnode_cleaner_callback, bfe, //read_extraargs brt->h, //write_extraargs unlockers); if (r==0) { BRTNODE node = node_v; Loading Loading @@ -184,15 +175,11 @@ toku_pin_brtnode_holding_lock( fullhash, &node_v, NULL, toku_brtnode_flush_callback, get_write_callbacks_for_node(brt->h), toku_brtnode_fetch_callback, toku_brtnode_pe_est_callback, toku_brtnode_pe_callback, toku_brtnode_pf_req_callback, toku_brtnode_pf_callback, toku_brtnode_cleaner_callback, bfe, brt->h bfe ); assert(r==0); BRTNODE node = node_v; Loading Loading @@ -228,15 +215,11 @@ toku_pin_brtnode_off_client_thread( fullhash, &node_v, NULL, toku_brtnode_flush_callback, get_write_callbacks_for_node(h), toku_brtnode_fetch_callback, toku_brtnode_pe_est_callback, toku_brtnode_pe_callback, toku_brtnode_pf_req_callback, toku_brtnode_pf_callback, toku_brtnode_cleaner_callback, bfe, h, num_dependent_nodes, dependent_cf, dependent_keys, Loading
newbrt/brt-cachetable-wrappers.h +1 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ #include <c_dialects.h> #include <brttypes.h> #include "cachetable.h" C_BEGIN Loading
newbrt/brt-flusher.h +0 −16 Original line number Diff line number Diff line Loading @@ -65,22 +65,6 @@ toku_flusher_thread_set_callback( void* extra ); /** * Brings the node into memory and flushes the fullest buffer. If the * heaviest child is empty, does nothing, otherwise, executes * flush_some_child to do the flush. * * Wrapped by toku_brtnode_cleaner_callback to provide access to * brt_status which currently just lives in brt.c. */ int toku_brtnode_cleaner_callback( void *brtnode_pv, BLOCKNUM blocknum, u_int32_t fullhash, void *extraargs ); /** * Puts a workitem on the flusher thread queue, scheduling the node to be * flushed by flush_some_child. Loading
newbrt/brt-internal.h +11 −0 Original line number Diff line number Diff line Loading @@ -532,10 +532,21 @@ extern void toku_brtnode_pe_est_callback(void* brtnode_pv, long* bytes_freed_est extern int toku_brtnode_pe_callback (void *brtnode_pv, PAIR_ATTR old_attr, PAIR_ATTR* new_attr, void *extraargs); extern BOOL toku_brtnode_pf_req_callback(void* brtnode_pv, void* read_extraargs); int toku_brtnode_pf_callback(void* brtnode_pv, void* read_extraargs, int fd, PAIR_ATTR* sizep); extern int toku_brtnode_cleaner_callback( void *brtnode_pv, BLOCKNUM blocknum, u_int32_t fullhash, void *extraargs); extern int toku_brt_alloc_init_header(BRT t, TOKUTXN txn); extern int toku_read_brt_header_and_store_in_cachefile (BRT brt, CACHEFILE cf, LSN max_acceptable_lsn, struct brt_header **header, BOOL* was_open); extern CACHEKEY* toku_calculate_root_offset_pointer (struct brt_header* h, u_int32_t *root_hash); static inline CACHETABLE_WRITE_CALLBACK get_write_callbacks_for_node(struct brt_header* h) { CACHETABLE_WRITE_CALLBACK wc; wc.flush_callback = toku_brtnode_flush_callback; wc.pe_est_callback = toku_brtnode_pe_est_callback; wc.pe_callback = toku_brtnode_pe_callback; wc.cleaner_callback = toku_brtnode_cleaner_callback; wc.write_extraargs = h; return wc; } static const BRTNODE null_brtnode=0; // How long is the pivot key? Loading
newbrt/brt-test-helpers.c +6 −18 Original line number Diff line number Diff line Loading @@ -94,15 +94,11 @@ int toku_testsetup_get_sersize(BRT brt, BLOCKNUM diskoff) // Return the size on toku_cachetable_hash(brt->cf, diskoff), &node_v, NULL, toku_brtnode_flush_callback, get_write_callbacks_for_node(brt->h), toku_brtnode_fetch_callback, toku_brtnode_pe_est_callback, toku_brtnode_pe_callback, toku_brtnode_pf_req_callback, toku_brtnode_pf_callback, toku_brtnode_cleaner_callback, &bfe, brt->h &bfe ); assert(r==0); int size = toku_serialize_brtnode_size(node_v); Loading @@ -124,15 +120,11 @@ int toku_testsetup_insert_to_leaf (BRT brt, BLOCKNUM blocknum, char *key, int ke toku_cachetable_hash(brt->cf, blocknum), &node_v, NULL, toku_brtnode_flush_callback, get_write_callbacks_for_node(brt->h), toku_brtnode_fetch_callback, toku_brtnode_pe_est_callback, toku_brtnode_pe_callback, toku_brtnode_pf_req_callback, toku_brtnode_pf_callback, toku_brtnode_cleaner_callback, &bfe, brt->h &bfe ); if (r!=0) return r; BRTNODE node=node_v; Loading Loading @@ -200,15 +192,11 @@ int toku_testsetup_insert_to_nonleaf (BRT brt, BLOCKNUM blocknum, enum brt_msg_t toku_cachetable_hash(brt->cf, blocknum), &node_v, NULL, toku_brtnode_flush_callback, get_write_callbacks_for_node(brt->h), toku_brtnode_fetch_callback, toku_brtnode_pe_est_callback, toku_brtnode_pe_callback, toku_brtnode_pf_req_callback, toku_brtnode_pf_callback, toku_brtnode_cleaner_callback, &bfe, brt->h &bfe ); if (r!=0) return r; BRTNODE node=node_v; Loading