|
|
@ -2397,16 +2397,19 @@ class Benchmark { |
|
|
|
return nullptr; |
|
|
|
return nullptr; |
|
|
|
} |
|
|
|
} |
|
|
|
if (FLAGS_use_clock_cache) { |
|
|
|
if (FLAGS_use_clock_cache) { |
|
|
|
auto cache = NewClockCache((size_t)capacity, FLAGS_cache_numshardbits); |
|
|
|
auto cache = |
|
|
|
|
|
|
|
NewClockCache(static_cast<size_t>(capacity), FLAGS_cache_numshardbits); |
|
|
|
if (!cache) { |
|
|
|
if (!cache) { |
|
|
|
fprintf(stderr, "Clock cache not supported."); |
|
|
|
fprintf(stderr, "Clock cache not supported."); |
|
|
|
exit(1); |
|
|
|
exit(1); |
|
|
|
} |
|
|
|
} |
|
|
|
return cache; |
|
|
|
return cache; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return NewLRUCache((size_t)capacity, FLAGS_cache_numshardbits, |
|
|
|
return NewLRUCache( |
|
|
|
false /*strict_capacity_limit*/, |
|
|
|
static_cast<size_t>(capacity), |
|
|
|
FLAGS_cache_high_pri_pool_ratio); |
|
|
|
FLAGS_cache_numshardbits, |
|
|
|
|
|
|
|
false /*strict_capacity_limit*/, |
|
|
|
|
|
|
|
FLAGS_cache_high_pri_pool_ratio); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -3604,9 +3607,12 @@ class Benchmark { |
|
|
|
} |
|
|
|
} |
|
|
|
if (FLAGS_max_bytes_for_level_multiplier_additional_v.size() > 0) { |
|
|
|
if (FLAGS_max_bytes_for_level_multiplier_additional_v.size() > 0) { |
|
|
|
if (FLAGS_max_bytes_for_level_multiplier_additional_v.size() != |
|
|
|
if (FLAGS_max_bytes_for_level_multiplier_additional_v.size() != |
|
|
|
(unsigned int)FLAGS_num_levels) { |
|
|
|
static_cast<unsigned int>(FLAGS_num_levels)) { |
|
|
|
fprintf(stderr, "Insufficient number of fanouts specified %d\n", |
|
|
|
fprintf( |
|
|
|
(int)FLAGS_max_bytes_for_level_multiplier_additional_v.size()); |
|
|
|
stderr, |
|
|
|
|
|
|
|
"Insufficient number of fanouts specified %d\n", |
|
|
|
|
|
|
|
static_cast<int>( |
|
|
|
|
|
|
|
FLAGS_max_bytes_for_level_multiplier_additional_v.size())); |
|
|
|
exit(1); |
|
|
|
exit(1); |
|
|
|
} |
|
|
|
} |
|
|
|
options.max_bytes_for_level_multiplier_additional = |
|
|
|
options.max_bytes_for_level_multiplier_additional = |
|
|
@ -4791,7 +4797,7 @@ class Benchmark { |
|
|
|
if (FLAGS_multiread_stride) { |
|
|
|
if (FLAGS_multiread_stride) { |
|
|
|
int64_t key = GetRandomKey(&thread->rand); |
|
|
|
int64_t key = GetRandomKey(&thread->rand); |
|
|
|
if ((key + (entries_per_batch_ - 1) * FLAGS_multiread_stride) >= |
|
|
|
if ((key + (entries_per_batch_ - 1) * FLAGS_multiread_stride) >= |
|
|
|
(int64_t)FLAGS_num) { |
|
|
|
static_cast<int64_t>(FLAGS_num)) { |
|
|
|
key = FLAGS_num - entries_per_batch_ * FLAGS_multiread_stride; |
|
|
|
key = FLAGS_num - entries_per_batch_ * FLAGS_multiread_stride; |
|
|
|
} |
|
|
|
} |
|
|
|
for (int64_t i = 0; i < entries_per_batch_; ++i) { |
|
|
|
for (int64_t i = 0; i < entries_per_batch_; ++i) { |
|
|
@ -5161,9 +5167,10 @@ class Benchmark { |
|
|
|
FLAGS_num, &lower_bound); |
|
|
|
FLAGS_num, &lower_bound); |
|
|
|
options.iterate_lower_bound = &lower_bound; |
|
|
|
options.iterate_lower_bound = &lower_bound; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
auto min_num = |
|
|
|
|
|
|
|
std::min(FLAGS_num, seek_pos + FLAGS_max_scan_distance); |
|
|
|
GenerateKeyFromInt( |
|
|
|
GenerateKeyFromInt( |
|
|
|
(uint64_t)std::min(FLAGS_num, seek_pos + FLAGS_max_scan_distance), |
|
|
|
static_cast<uint64_t>(min_num), FLAGS_num, &upper_bound); |
|
|
|
FLAGS_num, &upper_bound); |
|
|
|
|
|
|
|
options.iterate_upper_bound = &upper_bound; |
|
|
|
options.iterate_upper_bound = &upper_bound; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -5331,7 +5338,7 @@ class Benchmark { |
|
|
|
// Wait for the writes to be finished
|
|
|
|
// Wait for the writes to be finished
|
|
|
|
if (!hint_printed) { |
|
|
|
if (!hint_printed) { |
|
|
|
fprintf(stderr, "Reads are finished. Have %d more writes to do\n", |
|
|
|
fprintf(stderr, "Reads are finished. Have %d more writes to do\n", |
|
|
|
(int)writes_ - written); |
|
|
|
static_cast<int>(writes_) - written); |
|
|
|
hint_printed = true; |
|
|
|
hint_printed = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|