refs #6040 add checkpoint period to db-update.c and set its default to 60 seconds

git-svn-id: file:///svn/toku/tokudb@53386 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Rich Prohaska 2013-04-17 00:01:29 -04:00 committed by Yoni Fogel
parent d4ea0c4ce5
commit 74eeec3ec0

View file

@ -166,6 +166,7 @@ int main(int argc, char *argv[]) {
bool do_txn = false;
u_int64_t cachesize = 1000000000;
u_int32_t pagesize = 0;
u_int32_t checkpoint_period = 60;
int i;
for (i = 1; i < argc; i++) {
@ -214,6 +215,10 @@ int main(int argc, char *argv[]) {
val_size = atoi(argv[++i]);
continue;
}
if (strcmp(arg, "--checkpoint_period") == 0 && i+1 < argc) {
checkpoint_period = atoi(argv[++i]);
continue;
}
assert(0);
}
@ -230,6 +235,15 @@ int main(int argc, char *argv[]) {
r = db_env_create(&db_env, 0); assert(r == 0);
#if defined(TOKUDB)
db_env->set_update(db_env, my_update_callback);
#endif
#if defined(TOKUDB)
if (checkpoint_period) {
r = db_env->checkpointing_set_period(db_env, checkpoint_period);
assert(r == 0);
u_int32_t period;
r = db_env->checkpointing_get_period(db_env, &period);
assert(r == 0 && period == checkpoint_period);
}
#endif
if (cachesize) {
if (verbose) printf("cachesize %llu\n", (unsigned long long)cachesize);