Commit 2b8d2634 authored by Yoni Fogel's avatar Yoni Fogel

[t:5027] Made cli_args accessible through args. Removed redundant variables.

git-svn-id: file:///svn/toku/tokudb@44373 c7de825b-a66e-492c-adef-691d508d4ae1
parent 5574a100
...@@ -124,7 +124,7 @@ static void checkpoint_callback_2(void * extra) { ...@@ -124,7 +124,7 @@ static void checkpoint_callback_2(void * extra) {
// //
static int checkpoint_var(DB_TXN *txn, ARG arg, void* operation_extra, void *stats_extra) { static int checkpoint_var(DB_TXN *txn, ARG arg, void* operation_extra, void *stats_extra) {
int db_index = random()%arg->num_DBs; int db_index = random() % arg->cli->num_DBs;
int r = 0; int r = 0;
int val_size = *(int *)operation_extra; int val_size = *(int *)operation_extra;
DB* db = arg->dbp[db_index]; DB* db = arg->dbp[db_index];
...@@ -138,7 +138,7 @@ static int checkpoint_var(DB_TXN *txn, ARG arg, void* operation_extra, void *sta ...@@ -138,7 +138,7 @@ static int checkpoint_var(DB_TXN *txn, ARG arg, void* operation_extra, void *sta
increment_counter(stats_extra, PTQUERIES, i); increment_counter(stats_extra, PTQUERIES, i);
for (i = 0; i < 20; i++) { for (i = 0; i < 20; i++) {
// do a random insertion // do a random insertion
int rand_key = random() % arg->num_elements; int rand_key = random() % arg->cli->num_elements;
DBT key, val; DBT key, val;
r = db->put( r = db->put(
db, db,
...@@ -160,7 +160,6 @@ static void ...@@ -160,7 +160,6 @@ static void
stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) { stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) {
db_env_set_checkpoint_callback(checkpoint_callback_1, env); db_env_set_checkpoint_callback(checkpoint_callback_1, env);
db_env_set_checkpoint_callback2(checkpoint_callback_2, env); db_env_set_checkpoint_callback2(checkpoint_callback_2, env);
int n = cli_args->num_elements;
// //
// the threads that we want: // the threads that we want:
// - some threads constantly updating random values // - some threads constantly updating random values
...@@ -174,11 +173,10 @@ stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) { ...@@ -174,11 +173,10 @@ stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) {
const int num_threads = cli_args->num_ptquery_threads; const int num_threads = cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
} }
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
myargs[i].operation = checkpoint_var; myargs[i].operation = checkpoint_var;
myargs[i].crash_on_operation_failure = false;
myargs[i].operation_extra = &val_size; myargs[i].operation_extra = &val_size;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
...@@ -190,6 +188,7 @@ test_main(int argc, char *const argv[]) { ...@@ -190,6 +188,7 @@ test_main(int argc, char *const argv[]) {
args.env_args.checkpointing_period = 30; args.env_args.checkpointing_period = 30;
args.num_DBs = 4; args.num_DBs = 4;
args.num_ptquery_threads = 4; args.num_ptquery_threads = 4;
args.crash_on_operation_failure = false;
parse_stress_test_args(argc, argv, &args); parse_stress_test_args(argc, argv, &args);
stress_test_main(&args); stress_test_main(&args);
return 0; return 0;
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
static void static void
stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) { stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
// //
// the threads that we want: // the threads that we want:
// - some threads constantly updating random values // - some threads constantly updating random values
...@@ -33,9 +32,7 @@ stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) { ...@@ -33,9 +32,7 @@ stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) {
const int num_threads = cli_args->num_ptquery_threads; const int num_threads = cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
}
for (int i = 0; i < num_threads; i++) {
myargs[i].operation = cursor_create_close_op; myargs[i].operation = cursor_create_close_op;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
......
...@@ -21,14 +21,11 @@ ...@@ -21,14 +21,11 @@
static void static void
stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) { stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
if (verbose) printf("starting creation of pthreads\n"); if (verbose) printf("starting creation of pthreads\n");
const int num_threads = cli_args->num_put_threads; const int num_threads = cli_args->num_put_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
}
for (int i = 0; i < num_threads; i++) {
myargs[i].operation = random_put_op_singledb; myargs[i].operation = random_put_op_singledb;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
......
...@@ -22,14 +22,11 @@ ...@@ -22,14 +22,11 @@
static void static void
stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) { stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
if (verbose) printf("starting creation of pthreads\n"); if (verbose) printf("starting creation of pthreads\n");
const int num_threads = cli_args->num_ptquery_threads; const int num_threads = cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
}
for (int i = 0; i < num_threads; i++) {
myargs[i].operation = malloc_free_op; myargs[i].operation = malloc_free_op;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
......
...@@ -20,14 +20,11 @@ ...@@ -20,14 +20,11 @@
static void static void
stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) { stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
if (verbose) printf("starting creation of pthreads\n"); if (verbose) printf("starting creation of pthreads\n");
const int num_threads = cli_args->num_ptquery_threads; const int num_threads = cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
}
for (int i = 0; i < num_threads; i++) {
myargs[i].operation = nop; myargs[i].operation = nop;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
static void static void
stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) { stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
// //
// the threads that we want: // the threads that we want:
// - some threads constantly updating random values // - some threads constantly updating random values
...@@ -53,9 +52,7 @@ stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) { ...@@ -53,9 +52,7 @@ stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) {
const int num_threads = cli_args->num_ptquery_threads; const int num_threads = cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
}
for (int i = 0; i < num_threads; i++) {
myargs[i].operation = ptquery_op; myargs[i].operation = ptquery_op;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
......
...@@ -50,7 +50,6 @@ static int ptquery_op2(DB_TXN *txn, ARG arg, void* operation_extra, void *stats_ ...@@ -50,7 +50,6 @@ static int ptquery_op2(DB_TXN *txn, ARG arg, void* operation_extra, void *stats_
static void static void
stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) { stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
// //
// the threads that we want: // the threads that we want:
// - some threads constantly updating random values // - some threads constantly updating random values
...@@ -64,9 +63,7 @@ stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) { ...@@ -64,9 +63,7 @@ stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) {
struct arg myargs[num_threads]; struct arg myargs[num_threads];
int thread_ids[num_threads]; int thread_ids[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
}
for (int i = 0; i < num_threads; i++) {
thread_ids[i] = i % cli_args->num_DBs; thread_ids[i] = i % cli_args->num_DBs;
myargs[i].operation = ptquery_op2; myargs[i].operation = ptquery_op2;
myargs[i].operation_extra = &thread_ids[i]; myargs[i].operation_extra = &thread_ids[i];
......
...@@ -20,14 +20,11 @@ ...@@ -20,14 +20,11 @@
static void static void
stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) { stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
if (verbose) printf("starting creation of pthreads\n"); if (verbose) printf("starting creation of pthreads\n");
const int num_threads = cli_args->num_ptquery_threads; const int num_threads = cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
}
for (int i = 0; i < num_threads; i++) {
myargs[i].operation = xmalloc_free_op; myargs[i].operation = xmalloc_free_op;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
......
...@@ -46,8 +46,6 @@ static void flt_callback(int flt_state, void* extra) { ...@@ -46,8 +46,6 @@ static void flt_callback(int flt_state, void* extra) {
static void static void
stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
// //
// the threads that we want: // the threads that we want:
// - one thread constantly updating random values // - one thread constantly updating random values
...@@ -60,7 +58,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -60,7 +58,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
const int num_threads = 1; const int num_threads = 1;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
} }
// make the guy that updates the db // make the guy that updates the db
......
...@@ -40,8 +40,6 @@ ...@@ -40,8 +40,6 @@
static void static void
stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
// //
// the threads that we want: // the threads that we want:
// - one thread constantly updating random values // - one thread constantly updating random values
...@@ -54,7 +52,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -54,7 +52,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
const int num_threads = 4 + cli_args->num_update_threads + cli_args->num_ptquery_threads; const int num_threads = 4 + cli_args->num_update_threads + cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
} }
struct scan_op_extra soe[4]; struct scan_op_extra soe[4];
......
...@@ -18,15 +18,13 @@ ...@@ -18,15 +18,13 @@
static void static void
stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
if (verbose) printf("starting creation of pthreads\n"); if (verbose) printf("starting creation of pthreads\n");
const int num_threads = cli_args->num_update_threads; const int num_threads = cli_args->num_update_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
struct update_op_args uoe = get_update_op_args(cli_args, NULL); struct update_op_args uoe = get_update_op_args(cli_args, NULL);
// make the guy that updates the db // make the guy that updates the db
for (int i = 0; i < 0 + cli_args->num_update_threads; ++i) { for (int i = 0; i < 0 + cli_args->num_update_threads; ++i) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
myargs[i].operation_extra = &uoe; myargs[i].operation_extra = &uoe;
myargs[i].operation = update_op; myargs[i].operation = update_op;
} }
......
...@@ -64,8 +64,6 @@ static int manual_checkpoint(DB_TXN *UU(txn), ARG UU(arg), void* operation_extra ...@@ -64,8 +64,6 @@ static int manual_checkpoint(DB_TXN *UU(txn), ARG UU(arg), void* operation_extra
static void static void
stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
// //
// the threads that we want: // the threads that we want:
// - one thread constantly updating random values // - one thread constantly updating random values
...@@ -78,7 +76,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -78,7 +76,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
const int num_threads = 5 + cli_args->num_update_threads + cli_args->num_ptquery_threads; const int num_threads = 5 + cli_args->num_update_threads + cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
} }
struct scan_op_extra soe[4]; struct scan_op_extra soe[4];
......
...@@ -26,14 +26,11 @@ static int random_sleep(DB_TXN* UU(txn), ARG UU(arg), void* UU(operation_extra), ...@@ -26,14 +26,11 @@ static int random_sleep(DB_TXN* UU(txn), ARG UU(arg), void* UU(operation_extra),
static void static void
stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) { stress_table(DB_ENV* env, DB** dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
if (verbose) printf("starting creation of pthreads\n"); if (verbose) printf("starting creation of pthreads\n");
const int num_threads = cli_args->num_ptquery_threads; const int num_threads = cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
}
for (int i = 0; i < num_threads; i++) {
myargs[i].operation = random_sleep; myargs[i].operation = random_sleep;
} }
run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args); run_workers(myargs, num_threads, cli_args->time_of_test, false, cli_args);
......
...@@ -40,8 +40,6 @@ ...@@ -40,8 +40,6 @@
static void static void
stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
// //
// the threads that we want: // the threads that we want:
// - some threads constantly updating random values // - some threads constantly updating random values
...@@ -54,7 +52,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -54,7 +52,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
const int num_threads = 4 + cli_args->num_update_threads + cli_args->num_ptquery_threads; const int num_threads = 4 + cli_args->num_update_threads + cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
} }
struct scan_op_extra soe[4]; struct scan_op_extra soe[4];
......
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
static void static void
stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
// //
// the threads that we want: // the threads that we want:
// - one thread constantly updating random values // - one thread constantly updating random values
...@@ -48,7 +46,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -48,7 +46,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
const int num_threads = 4 + cli_args->num_update_threads + cli_args->num_ptquery_threads; const int num_threads = 4 + cli_args->num_update_threads + cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
} }
struct scan_op_extra soe[4]; struct scan_op_extra soe[4];
......
...@@ -33,8 +33,6 @@ ...@@ -33,8 +33,6 @@
static void static void
stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
// //
// the threads that we want: // the threads that we want:
// - one thread constantly updating random values // - one thread constantly updating random values
...@@ -46,7 +44,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -46,7 +44,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
const int num_threads = 5 + cli_args->num_update_threads + cli_args->num_ptquery_threads; const int num_threads = 5 + cli_args->num_update_threads + cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
} }
struct scan_op_extra soe[4]; struct scan_op_extra soe[4];
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
static void static void
stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements; int n = cli_args->num_elements;
// //
// the threads that we want: // the threads that we want:
// - one thread constantly updating random values // - one thread constantly updating random values
...@@ -46,7 +45,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -46,7 +45,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
const int num_threads = 4 + cli_args->num_update_threads + cli_args->num_ptquery_threads; const int num_threads = 4 + cli_args->num_update_threads + cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
} }
struct scan_op_extra soe[4]; struct scan_op_extra soe[4];
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
static void static void
stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
// //
// do insertions and queries with a loader lying around doing stuff // do insertions and queries with a loader lying around doing stuff
// //
...@@ -28,7 +26,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -28,7 +26,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
const int num_threads = 4 + cli_args->num_update_threads + cli_args->num_ptquery_threads; const int num_threads = 4 + cli_args->num_update_threads + cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
} }
struct scan_op_extra soe[2]; struct scan_op_extra soe[2];
......
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
static void static void
stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
// //
// the threads that we want: // the threads that we want:
// - one thread constantly updating random values // - one thread constantly updating random values
...@@ -48,7 +46,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -48,7 +46,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
const int num_threads = 5 + cli_args->num_update_threads + cli_args->num_ptquery_threads; const int num_threads = 5 + cli_args->num_update_threads + cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
} }
struct scan_op_extra soe[4]; struct scan_op_extra soe[4];
......
...@@ -18,8 +18,6 @@ ...@@ -18,8 +18,6 @@
static void static void
stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
// //
// do insertions and queries with a loader lying around doing stuff // do insertions and queries with a loader lying around doing stuff
// //
...@@ -28,7 +26,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -28,7 +26,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
const int num_threads = 4 + cli_args->num_update_threads + cli_args->num_ptquery_threads; const int num_threads = 4 + cli_args->num_update_threads + cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
} }
struct scan_op_extra soe[2]; struct scan_op_extra soe[2];
......
...@@ -24,8 +24,6 @@ ...@@ -24,8 +24,6 @@
static void static void
stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
int n = cli_args->num_elements;
// //
// do insertions and queries with a loader lying around doing stuff // do insertions and queries with a loader lying around doing stuff
// //
...@@ -34,7 +32,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) { ...@@ -34,7 +32,7 @@ stress_table(DB_ENV *env, DB **dbp, struct cli_args *cli_args) {
const int num_threads = 4 + cli_args->num_update_threads + cli_args->num_ptquery_threads; const int num_threads = 4 + cli_args->num_update_threads + cli_args->num_ptquery_threads;
struct arg myargs[num_threads]; struct arg myargs[num_threads];
for (int i = 0; i < num_threads; i++) { for (int i = 0; i < num_threads; i++) {
arg_init(&myargs[i], n, dbp, env, cli_args); arg_init(&myargs[i], dbp, env, cli_args);
} }
// make the forward fast scanner // make the forward fast scanner
struct scan_op_extra soe; struct scan_op_extra soe;
......
This diff is collapsed.
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