Skip to content

Commit

Permalink
util: fix log_write_bench (#5335)
Browse files Browse the repository at this point in the history
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 <yuan.zhou@intel.com>
Pull Request resolved: #5335

Differential Revision: D15588875

Pulled By: miasantreble

fbshipit-source-id: 726ff4dc227733e915c3b796df25bd3ab0b431ac
  • Loading branch information
zhouyuan authored and facebook-github-bot committed Jun 1, 2019
1 parent d7d8605 commit 79edf0a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions util/log_write_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<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 79edf0a

Please sign in to comment.