return s;
}
file->SetIOPriority(io_priority);
+ file->SetWriteLocationHint(
+ level < 0 ?
+ Env::LOCATION_UNSORTED :
+ Env::WriteLocationHint(Env::LOCATION_L0 + level));
file->SetWriteLifeTimeHint(write_hint);
file_writer.reset(new WritableFileWriter(std::move(file), env_options,
sub_compact->outputs.push_back(out);
writable_file->SetIOPriority(Env::IO_LOW);
+ writable_file->SetWriteLocationHint(
+ Env::WriteLocationHint(
+ Env::LOCATION_L0 + sub_compact->compaction->output_level()));
+
writable_file->SetWriteLifeTimeHint(write_hint_);
writable_file->SetPreallocationBlockSize(static_cast<size_t>(
sub_compact->compaction->OutputFilePreallocationSize()));
}
file->SetPreallocationBlockSize(
immutable_db_options_.manifest_preallocation_size);
+ file->SetWriteLocationHint(Env::LOCATION_UNSORTED);
unique_ptr<WritableFileWriter> file_writer(
new WritableFileWriter(std::move(file), env_options));
log::Writer log(std::move(file_writer), 0, false);
cfd->ioptions()->compression_opts, paranoid_file_checks,
cfd->internal_stats(), TableFileCreationReason::kRecovery,
&event_logger_, job_id, Env::IO_HIGH, nullptr /* table_properties */,
- -1 /* level */, current_time, write_hint);
+ 0 /* level */, current_time, write_hint);
LogFlush(immutable_db_options_.info_log);
ROCKS_LOG_DEBUG(immutable_db_options_.info_log,
"[%s] [WriteLevel0TableForRecovery]"
&lfile, opt_env_options);
if (s.ok()) {
lfile->SetWriteLifeTimeHint(write_hint);
+ lfile->SetWriteLocationHint(Env::LOCATION_WAL);
lfile->SetPreallocationBlockSize(
impl->GetWalPreallocateBlockSize(max_write_buffer_size));
{
// use preallocate_block_size instead
// of calling GetWalPreallocateBlockSize()
lfile->SetPreallocationBlockSize(preallocate_block_size);
+ lfile->SetWriteLocationHint(Env::LOCATION_WAL);
lfile->SetWriteLifeTimeHint(write_hint);
unique_ptr<WritableFileWriter> file_writer(
new WritableFileWriter(std::move(lfile), opt_env_opt));
env_, DescriptorFileName(dbname_, pending_manifest_file_number_),
&descriptor_file, opt_env_opts);
if (s.ok()) {
+ descriptor_file->SetWriteLocationHint(Env::LOCATION_UNSORTED);
descriptor_file->SetPreallocationBlockSize(
db_options_->manifest_preallocation_size);
WLTH_EXTREME, // Data written has an extremely long life time
};
+ enum WriteLocationHint {
+ LOCATION_WAL = 1,
+ LOCATION_UNSORTED = 2,
+ LOCATION_L0 = 3,
+ };\r
+
// Create an object that writes to a new file with the specified
// name. Deletes any existing file with the same name and creates a
// new file. On success, stores a pointer to the new file in
virtual Env::IOPriority GetIOPriority() { return io_priority_; }
+ virtual void SetWriteLocationHint(Env::WriteLocationHint) {
+ // do nothing
+ }\r
+
virtual void SetWriteLifeTimeHint(Env::WriteLifeTimeHint hint) {
write_hint_ = hint;
}