Skip to content

Commit

Permalink
review, change batch warnings (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelch-spike authored Jul 20, 2023
1 parent 98dc132 commit ef636bd
Showing 1 changed file with 24 additions and 20 deletions.
44 changes: 24 additions & 20 deletions src/main/coordinator.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,40 +137,44 @@ coordinator_worker(void* udata)

if (stage->workload.type == WORKLOAD_TYPE_I) {
uint64_t nkeys = stage->key_end - stage->key_start;
if (nkeys % stage->batch_write_size != 0) {
blog_warn("--keys is not divisible by --batch-write-size so more than "
"--keys records will be written\n");
}

if (nkeys % (stage->batch_write_size * n_threads) != 0) {
blog_warn("--keys is not divisible by (--batch-write-size * --threads) so some records "
"outside the range defined by --keys will be written\n");
if (stage->async) {
if (nkeys % stage->batch_write_size != 0) {
blog_warn("--keys is not divisible by --batch-write-size so more than "
"--keys records will be written\n");
}
}

if (!stage->async) {
else { // TODO when async is multithreaded change this
if (stage->batch_write_size * n_threads > nkeys) {
blog_warn("--batch-write-size * --threads is greater than --keys so "
"more than --keys records will be written\n");
}

if (nkeys % (stage->batch_write_size * n_threads) != 0) {
blog_warn("--keys is not divisible by (--batch-write-size * --threads) so more than "
"--keys records will be written\n");
}
}
}

if (stage->workload.type == WORKLOAD_TYPE_D) {
uint64_t nkeys = stage->key_end - stage->key_start;
if (nkeys % stage->batch_delete_size != 0) {
blog_warn("--keys is not divisible by --batch-delete-size so some records "
"outside the range defined by --keys will be deleted\n");
}

if (nkeys % (stage->batch_delete_size * n_threads) != 0) {
blog_warn("--keys is not divisible by (--batch-delete-size * --threads) so some records "
"outside the range defined by --keys will be deleted\n");
if (stage->async) {
if (nkeys % stage->batch_delete_size != 0) {
blog_warn("--keys is not divisible by --batch-delete-size so more than "
"--keys records will be deleted\n");
}
}

if (!stage->async) {
else { // TODO when async is multithreaded change this
if (stage->batch_delete_size * n_threads > nkeys) {
blog_warn("--batch-delete-size * --threads is greater than --keys so some "
"records outside the range defined by --keys will be deleted\n");
blog_warn("--batch-delete-size * --threads is greater than --keys so more than "
"--keys records will be deleted\n");
}

if (nkeys % (stage->batch_delete_size * n_threads) != 0) {
blog_warn("--keys is not divisible by (--batch-delete-size * --threads) so more than "
"--keys records will be deleted\n");
}
}
}
Expand Down

0 comments on commit ef636bd

Please sign in to comment.