Loading newbrt/brt-internal.h +1 −0 Original line number Diff line number Diff line Loading @@ -577,6 +577,7 @@ struct brt_cursor { BOOL is_snapshot_read; // true if query is read_committed, false otherwise BOOL is_leaf_mode; BOOL disable_prefetching; BOOL is_temporary; TOKUTXN ttxn; struct brt_cursor_leaf_info leaf_info; }; Loading newbrt/brt.c +12 −4 Original line number Diff line number Diff line Loading @@ -4387,6 +4387,7 @@ int toku_brt_cursor ( cursor->is_leaf_mode = FALSE; cursor->ttxn = ttxn; cursor->disable_prefetching = disable_prefetching; cursor->is_temporary = FALSE; if (1) { toku_spin_lock(&brt->cursors_lock); toku_list_push(&brt->cursors, &cursor->cursors_link); Loading @@ -4396,6 +4397,11 @@ int toku_brt_cursor ( return 0; } void toku_brt_cursor_set_temporary(BRT_CURSOR brtcursor) { brtcursor->is_temporary = TRUE; } void toku_brt_cursor_set_leaf_mode(BRT_CURSOR brtcursor) { brtcursor->is_leaf_mode = TRUE; Loading Loading @@ -5090,10 +5096,12 @@ brt_search_basement_node( } brt_cursor_cleanup_dbts(brtcursor); if (!brtcursor->is_temporary) { brtcursor->key.data = toku_memdup(key, keylen); brtcursor->val.data = toku_memdup(val, vallen); brtcursor->key.size = keylen; brtcursor->val.size = vallen; } //The search was successful. Prefetching can continue. *doprefetch = TRUE; } Loading newbrt/brt.h +3 −0 Original line number Diff line number Diff line Loading @@ -191,6 +191,9 @@ int toku_verify_brt_with_progress (BRT brt, int (*progress_callback)(void *extra typedef struct brt_cursor *BRT_CURSOR; int toku_brt_cursor (BRT, BRT_CURSOR*, TOKUTXN, BOOL, BOOL) __attribute__ ((warn_unused_result)); void toku_brt_cursor_set_leaf_mode(BRT_CURSOR); // Sets a boolean on the brt cursor that prevents uncessary copying of // the cursor duing a one query. void toku_brt_cursor_set_temporary(BRT_CURSOR); int toku_brt_cursor_is_leaf_mode(BRT_CURSOR); void toku_brt_cursor_set_range_lock(BRT_CURSOR, const DBT *, const DBT *, BOOL, BOOL); Loading src/ydb_cursor.c +7 −0 Original line number Diff line number Diff line Loading @@ -878,6 +878,13 @@ toku_db_cursor_internal(DB * db, DB_TXN * txn, DBC ** c, u_int32_t flags, int is ); assert(r == 0 || r == TOKUDB_MVCC_DICTIONARY_TOO_NEW); if (r == 0) { // Set the is_temporary_cursor boolean inside the brt node so // that a query only needing one cursor will not perform // unecessary malloc calls. if (is_temporary_cursor) { toku_brt_cursor_set_temporary(dbc_struct_i(result)->c); } *c = result; } else { Loading Loading
newbrt/brt-internal.h +1 −0 Original line number Diff line number Diff line Loading @@ -577,6 +577,7 @@ struct brt_cursor { BOOL is_snapshot_read; // true if query is read_committed, false otherwise BOOL is_leaf_mode; BOOL disable_prefetching; BOOL is_temporary; TOKUTXN ttxn; struct brt_cursor_leaf_info leaf_info; }; Loading
newbrt/brt.c +12 −4 Original line number Diff line number Diff line Loading @@ -4387,6 +4387,7 @@ int toku_brt_cursor ( cursor->is_leaf_mode = FALSE; cursor->ttxn = ttxn; cursor->disable_prefetching = disable_prefetching; cursor->is_temporary = FALSE; if (1) { toku_spin_lock(&brt->cursors_lock); toku_list_push(&brt->cursors, &cursor->cursors_link); Loading @@ -4396,6 +4397,11 @@ int toku_brt_cursor ( return 0; } void toku_brt_cursor_set_temporary(BRT_CURSOR brtcursor) { brtcursor->is_temporary = TRUE; } void toku_brt_cursor_set_leaf_mode(BRT_CURSOR brtcursor) { brtcursor->is_leaf_mode = TRUE; Loading Loading @@ -5090,10 +5096,12 @@ brt_search_basement_node( } brt_cursor_cleanup_dbts(brtcursor); if (!brtcursor->is_temporary) { brtcursor->key.data = toku_memdup(key, keylen); brtcursor->val.data = toku_memdup(val, vallen); brtcursor->key.size = keylen; brtcursor->val.size = vallen; } //The search was successful. Prefetching can continue. *doprefetch = TRUE; } Loading
newbrt/brt.h +3 −0 Original line number Diff line number Diff line Loading @@ -191,6 +191,9 @@ int toku_verify_brt_with_progress (BRT brt, int (*progress_callback)(void *extra typedef struct brt_cursor *BRT_CURSOR; int toku_brt_cursor (BRT, BRT_CURSOR*, TOKUTXN, BOOL, BOOL) __attribute__ ((warn_unused_result)); void toku_brt_cursor_set_leaf_mode(BRT_CURSOR); // Sets a boolean on the brt cursor that prevents uncessary copying of // the cursor duing a one query. void toku_brt_cursor_set_temporary(BRT_CURSOR); int toku_brt_cursor_is_leaf_mode(BRT_CURSOR); void toku_brt_cursor_set_range_lock(BRT_CURSOR, const DBT *, const DBT *, BOOL, BOOL); Loading
src/ydb_cursor.c +7 −0 Original line number Diff line number Diff line Loading @@ -878,6 +878,13 @@ toku_db_cursor_internal(DB * db, DB_TXN * txn, DBC ** c, u_int32_t flags, int is ); assert(r == 0 || r == TOKUDB_MVCC_DICTIONARY_TOO_NEW); if (r == 0) { // Set the is_temporary_cursor boolean inside the brt node so // that a query only needing one cursor will not perform // unecessary malloc calls. if (is_temporary_cursor) { toku_brt_cursor_set_temporary(dbc_struct_i(result)->c); } *c = result; } else { Loading