Commit b2c3633e authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

closes #5388, batch pins for keyrange

git-svn-id: file:///svn/toku/tokudb@47026 c7de825b-a66e-492c-adef-691d508d4ae1
parent 3a887ea7
......@@ -119,39 +119,6 @@ toku_create_new_ftnode (
NULL);
}
int
toku_pin_ftnode(
FT_HANDLE brt,
BLOCKNUM blocknum,
uint32_t fullhash,
UNLOCKERS unlockers,
ANCESTORS ancestors,
const PIVOT_BOUNDS bounds,
FTNODE_FETCH_EXTRA bfe,
pair_lock_type lock_type,
bool apply_ancestor_messages, // this bool is probably temporary, for #3972, once we know how range query estimates work, will revisit this
FTNODE *node_p,
bool* msgs_applied)
{
toku_cachetable_begin_batched_pin(brt->ft->cf);
int r = toku_pin_ftnode_batched(
brt,
blocknum,
fullhash,
unlockers,
ancestors,
bounds,
bfe,
lock_type,
apply_ancestor_messages,
false,
node_p,
msgs_applied
);
toku_cachetable_end_batched_pin(brt->ft->cf);
return r;
}
int
toku_pin_ftnode_batched(
FT_HANDLE brt,
......
......@@ -53,28 +53,6 @@ toku_create_new_ftnode (
int n_children
);
/**
* toku_pin_ftnode either pins a ftnode, if the operation is fast (because
* a partial fetch is not required and there is no contention for the node)
* or it returns TOKUDB_TRY_AGAIN after unlocking its ancestors (using
* unlockers and ancestors) and bringing the necessary pieces of the node
* into memory.
*/
int
toku_pin_ftnode(
FT_HANDLE brt,
BLOCKNUM blocknum,
uint32_t fullhash,
UNLOCKERS unlockers,
ANCESTORS ancestors,
const PIVOT_BOUNDS pbounds,
FTNODE_FETCH_EXTRA bfe,
pair_lock_type lock_type,
bool apply_ancestor_messages, // this bool is probably temporary, for #3972, once we know how range query estimates work, will revisit this
FTNODE *node_p,
bool* msgs_applied
);
/**
* Batched version of toku_pin_ftnode, see cachetable batched API for more
* details.
......
......@@ -5252,7 +5252,7 @@ toku_ft_keyrange_internal (FT_HANDLE brt, FTNODE node,
uint32_t fullhash = compute_child_fullhash(brt->ft->cf, node, child_number);
FTNODE childnode;
bool msgs_applied = false;
r = toku_pin_ftnode(
r = toku_pin_ftnode_batched(
brt,
childblocknum,
fullhash,
......@@ -5262,6 +5262,7 @@ toku_ft_keyrange_internal (FT_HANDLE brt, FTNODE node,
bfe,
PL_READ, // may_modify_node is false, because node guaranteed to not change
false,
false,
&childnode,
&msgs_applied
);
......@@ -5312,7 +5313,8 @@ toku_ft_keyrange (FT_HANDLE brt, DBT *key, uint64_t *less_p, uint64_t *equal_p,
uint32_t fullhash;
CACHEKEY root_key;
toku_calculate_root_offset_pointer(brt->ft, &root_key, &fullhash);
toku_pin_ftnode_off_client_thread(
toku_cachetable_begin_batched_pin(brt->ft->cf);
toku_pin_ftnode_off_client_thread_batched(
brt->ft,
root_key,
fullhash,
......@@ -5337,6 +5339,7 @@ toku_ft_keyrange (FT_HANDLE brt, DBT *key, uint64_t *less_p, uint64_t *equal_p,
numrows,
&bfe, &unlockers, (ANCESTORS)NULL, &infinite_bounds);
assert(r == 0 || r == TOKUDB_TRY_AGAIN);
toku_cachetable_end_batched_pin(brt->ft->cf);
if (r == TOKUDB_TRY_AGAIN) {
assert(!unlockers.locked);
goto try_again;
......
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