Commit 79eb0c0f authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel

closes #5653, export a function to change number of bucket mutexes

git-svn-id: file:///svn/toku/tokudb@49497 c7de825b-a66e-492c-adef-691d508d4ae1
parent 76adfbcd
......@@ -709,6 +709,7 @@ int main (int argc, char *const argv[] __attribute__((__unused__))) {
printf("void db_env_set_mvcc_garbage_collection_verification(uint32_t) %s;\n", VISIBLE);
printf("void db_env_enable_engine_status(uint32_t) %s;\n", VISIBLE);
printf("void db_env_set_flusher_thread_callback (void (*)(int, void*), void*) %s;\n", VISIBLE);
printf("void db_env_set_num_bucket_mutexes(uint32_t) %s;\n", VISIBLE);
printf("#if defined(__cplusplus) || defined(__cilkplusplus)\n}\n#endif\n");
printf("#endif\n");
......
......@@ -3075,8 +3075,11 @@ int cleaner::run_cleaner(void) {
static_assert(std::is_pod<pair_list>::value, "pair_list isn't POD");
const uint32_t INITIAL_PAIR_LIST_SIZE = 1<<20;
const uint32_t PAIR_LOCK_SIZE = 1<<20;
uint32_t PAIR_LOCK_SIZE = 1<<20;
void toku_pair_list_set_lock_size(uint32_t num_locks) {
PAIR_LOCK_SIZE = num_locks;
}
// Allocates the hash table of pairs inside this pair list.
//
......
......@@ -552,4 +552,9 @@ int toku_cachetable_get_checkpointing_user_data_status(void);
int toku_cleaner_thread_for_test(CACHETABLE ct);
int toku_cleaner_thread(void *cleaner_v);
// test function. Exported in the ydb layer and used by tests that want to run DRD
// The default of 1M is too high for drd tests, so this is a mechanism to set a smaller number.
void toku_pair_list_set_lock_size(uint32_t num_locks);
#endif /* CACHETABLE_H */
......@@ -26,6 +26,7 @@
db_env_set_mvcc_garbage_collection_verification;
db_env_enable_engine_status;
db_env_set_flusher_thread_callback;
db_env_set_num_bucket_mutexes;
toku_ydb_error_all_cases;
toku_set_trace_file;
......
......@@ -127,3 +127,8 @@ db_env_enable_engine_status(uint32_t enable) {
engine_status_enable = enable;
}
void
db_env_set_num_bucket_mutexes(uint32_t num_mutexes) {
toku_pair_list_set_lock_size(num_mutexes);
}
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