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

[t:4872] remove ydb lock usage for a bunch of getters and setters

git-svn-id: file:///svn/toku/tokudb@44098 c7de825b-a66e-492c-adef-691d508d4ae1
parent 1a9d2834
......@@ -1156,14 +1156,14 @@ toku_env_log_archive(DB_ENV * env, char **list[], u_int32_t flags) {
}
static int
toku_env_log_flush(DB_ENV * env, const DB_LSN * lsn __attribute__((__unused__))) {
env_log_flush(DB_ENV * env, const DB_LSN * lsn __attribute__((__unused__))) {
HANDLE_PANICKED_ENV(env);
// We just flush everything. MySQL uses lsn==0 which means flush everything. For anyone else using the log, it is correct to flush too much, so we are OK.
return toku_logger_fsync(env->i->logger);
}
static int
toku_env_set_cachesize(DB_ENV * env, u_int32_t gbytes, u_int32_t bytes, int ncache) {
env_set_cachesize(DB_ENV * env, u_int32_t gbytes, u_int32_t bytes, int ncache) {
HANDLE_PANICKED_ENV(env);
if (ncache != 1)
return EINVAL;
......@@ -1480,16 +1480,6 @@ locked_env_log_archive(DB_ENV * env, char **list[], u_int32_t flags) {
toku_ydb_lock(); int r = toku_env_log_archive(env, list, flags); toku_ydb_unlock(); return r;
}
static int
locked_env_log_flush(DB_ENV * env, const DB_LSN * lsn) {
toku_ydb_lock(); int r = toku_env_log_flush(env, lsn); toku_ydb_unlock(); return r;
}
static int
locked_env_set_cachesize(DB_ENV *env, u_int32_t gbytes, u_int32_t bytes, int ncache) {
toku_ydb_lock(); int r = toku_env_set_cachesize(env, gbytes, bytes, ncache); toku_ydb_unlock(); return r;
}
static int
env_checkpointing_set_period(DB_ENV * env, u_int32_t seconds) {
......@@ -1501,11 +1491,6 @@ env_checkpointing_set_period(DB_ENV * env, u_int32_t seconds) {
return r;
}
static int
locked_env_checkpointing_set_period(DB_ENV * env, u_int32_t seconds) {
toku_ydb_lock(); int r = env_checkpointing_set_period(env, seconds); toku_ydb_unlock(); return r;
}
static int
env_cleaner_set_period(DB_ENV * env, u_int32_t seconds) {
HANDLE_PANICKED_ENV(env);
......@@ -1516,11 +1501,6 @@ env_cleaner_set_period(DB_ENV * env, u_int32_t seconds) {
return r;
}
static int
locked_env_cleaner_set_period(DB_ENV * env, u_int32_t seconds) {
toku_ydb_lock(); int r = env_cleaner_set_period(env, seconds); toku_ydb_unlock(); return r;
}
static int
env_cleaner_set_iterations(DB_ENV * env, u_int32_t iterations) {
HANDLE_PANICKED_ENV(env);
......@@ -1531,11 +1511,6 @@ env_cleaner_set_iterations(DB_ENV * env, u_int32_t iterations) {
return r;
}
static int
locked_env_cleaner_set_iterations(DB_ENV * env, u_int32_t iterations) {
toku_ydb_lock(); int r = env_cleaner_set_iterations(env, iterations); toku_ydb_unlock(); return r;
}
static int
locked_env_create_indexer(DB_ENV *env,
DB_TXN *txn,
......@@ -1577,11 +1552,6 @@ env_checkpointing_get_period(DB_ENV * env, u_int32_t *seconds) {
return r;
}
static int
locked_env_checkpointing_get_period(DB_ENV * env, u_int32_t *seconds) {
toku_ydb_lock(); int r = env_checkpointing_get_period(env, seconds); toku_ydb_unlock(); return r;
}
static int
env_cleaner_get_period(DB_ENV * env, u_int32_t *seconds) {
HANDLE_PANICKED_ENV(env);
......@@ -1592,11 +1562,6 @@ env_cleaner_get_period(DB_ENV * env, u_int32_t *seconds) {
return r;
}
static int
locked_env_cleaner_get_period(DB_ENV * env, u_int32_t *seconds) {
toku_ydb_lock(); int r = env_cleaner_get_period(env, seconds); toku_ydb_unlock(); return r;
}
static int
env_cleaner_get_iterations(DB_ENV * env, u_int32_t *iterations) {
HANDLE_PANICKED_ENV(env);
......@@ -1607,11 +1572,6 @@ env_cleaner_get_iterations(DB_ENV * env, u_int32_t *iterations) {
return r;
}
static int
locked_env_cleaner_get_iterations(DB_ENV * env, u_int32_t *iterations) {
toku_ydb_lock(); int r = env_cleaner_get_iterations(env, iterations); toku_ydb_unlock(); return r;
}
static int
env_checkpointing_postpone(DB_ENV * env) {
HANDLE_PANICKED_ENV(env);
......@@ -2226,15 +2186,7 @@ toku_env_create(DB_ENV ** envp, u_int32_t flags) {
#define SENV(name) result->name = locked_env_ ## name
SENV(dbremove);
SENV(dbrename);
SENV(checkpointing_set_period);
SENV(checkpointing_get_period);
SENV(cleaner_set_period);
SENV(cleaner_get_period);
SENV(cleaner_set_iterations);
SENV(cleaner_get_iterations);
SENV(log_flush);
//SENV(set_noticecall);
SENV(set_cachesize);
SENV(log_archive);
SENV(create_indexer);
#undef SENV
......@@ -2263,6 +2215,13 @@ toku_env_create(DB_ENV ** envp, u_int32_t flags) {
USENV(set_errfile);
USENV(set_errpfx);
USENV(set_data_dir);
USENV(checkpointing_set_period);
USENV(checkpointing_get_period);
USENV(cleaner_set_period);
USENV(cleaner_get_period);
USENV(cleaner_set_iterations);
USENV(cleaner_get_iterations);
USENV(set_cachesize);
#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 3
USENV(get_cachesize);
#endif
......@@ -2280,6 +2239,7 @@ toku_env_create(DB_ENV ** envp, u_int32_t flags) {
USENV(get_lock_timeout);
USENV(set_lock_timeout);
USENV(set_redzone);
USENV(log_flush);
#undef USENV
......
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