check prefix_size when using hash search in db_bench

Summary:
1. Check prefix_size when enable use_hash_search in db_bench
2. Remove include/statistics.h in db_bench

Test Plan: ./db_bench --use_hash_search=1

Reviewers: ljin, yhchiang, igor, sdong

Reviewed By: sdong

Subscribers: leveldb

Differential Revision: https://reviews.facebook.net/D21375
main
Feng Zhu 10 years ago
parent 54153ab07a
commit d3f2ec694f
  1. 6
      db/db_bench.cc

@ -30,7 +30,6 @@ int main() {
#include <gflags/gflags.h> #include <gflags/gflags.h>
#include "db/db_impl.h" #include "db/db_impl.h"
#include "db/version_set.h" #include "db/version_set.h"
#include "rocksdb/statistics.h"
#include "rocksdb/options.h" #include "rocksdb/options.h"
#include "rocksdb/cache.h" #include "rocksdb/cache.h"
#include "rocksdb/db.h" #include "rocksdb/db.h"
@ -1703,6 +1702,11 @@ class Benchmark {
} else { } else {
BlockBasedTableOptions block_based_options; BlockBasedTableOptions block_based_options;
if (FLAGS_use_hash_search) { if (FLAGS_use_hash_search) {
if (FLAGS_prefix_size == 0) {
fprintf(stderr,
"prefix_size not assigned when enable use_hash_search \n");
exit(1);
}
block_based_options.index_type = BlockBasedTableOptions::kHashSearch; block_based_options.index_type = BlockBasedTableOptions::kHashSearch;
} else { } else {
block_based_options.index_type = BlockBasedTableOptions::kBinarySearch; block_based_options.index_type = BlockBasedTableOptions::kBinarySearch;

Loading…
Cancel
Save