Skip to content

Commit

Permalink
util: fix log_write_bench
Browse files Browse the repository at this point in the history
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 <yuan.zhou@intel.com>
  • Loading branch information
zhouyuan committed May 28, 2019
1 parent e264eeb commit 0bddcea
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions util/log_write_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ 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<WritableFile> file;
env->NewWritableFile(file_name, &file, env_options);
std::unique_ptr<WritableFileWriter> 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');
Expand Down

0 comments on commit 0bddcea

Please sign in to comment.