From 79edf0a7a8ab75f60692efd54b1e0ed7da7aafca Mon Sep 17 00:00:00 2001 From: Yuan Zhou Date: Fri, 31 May 2019 17:14:03 -0700 Subject: [PATCH] util: fix log_write_bench (#5335) Summary: log_write_bench doesn't compile due to some recent API changes. This patch fixes the compile by adding the missing params for OptimizeForLogWrite() and WritableFileWriter(). Signed-off-by: Yuan Zhou Pull Request resolved: https://github.com/facebook/rocksdb/pull/5335 Differential Revision: D15588875 Pulled By: miasantreble fbshipit-source-id: 726ff4dc227733e915c3b796df25bd3ab0b431ac --- util/log_write_bench.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/util/log_write_bench.cc b/util/log_write_bench.cc index 9efa43f8a3..ac4cb685b6 100644 --- a/util/log_write_bench.cc +++ b/util/log_write_bench.cc @@ -32,13 +32,16 @@ DEFINE_bool(enable_sync, false, "sync after each write."); namespace rocksdb { void RunBenchmark() { std::string file_name = test::PerThreadDBPath("log_write_benchmark.log"); + DBOptions options; Env* env = Env::Default(); - EnvOptions env_options = env->OptimizeForLogWrite(EnvOptions()); + EnvOptions env_options = env->OptimizeForLogWrite(EnvOptions(), options); env_options.bytes_per_sync = FLAGS_bytes_per_sync; std::unique_ptr file; env->NewWritableFile(file_name, &file, env_options); std::unique_ptr writer; - writer.reset(new WritableFileWriter(std::move(file), env_options)); + writer.reset(new WritableFileWriter(std::move(file), file_name, env_options, + env, nullptr /* stats */, + options.listeners)); std::string record; record.assign(FLAGS_record_size, 'X');