Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow no_io for VersionSet::GetTableProperties #211

Merged
merged 3 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion db/compaction/compaction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ std::unique_ptr<CompactionFilter> Compaction::CreateCompactionFilter(
for (auto l = inputs_.begin(); l != inputs_.end(); ++l) {
for (auto f = l->files.begin(); f != l->files.end(); ++f) {
std::shared_ptr<const TableProperties> tp;
Status s = input_version_->GetTableProperties(&tp, *f);
Status s = input_version_->GetTableProperties(&tp, *f, nullptr, false);
hicqu marked this conversation as resolved.
Show resolved Hide resolved
assert(s.ok());
context.file_numbers.push_back((*f)->fd.GetNumber());
context.table_properties.push_back(tp);
Expand Down
5 changes: 3 additions & 2 deletions db/version_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1191,12 +1191,13 @@ class BaseReferencedVersionBuilder {

Status Version::GetTableProperties(std::shared_ptr<const TableProperties>* tp,
const FileMetaData* file_meta,
const std::string* fname) const {
const std::string* fname,
bool no_io) const {
auto table_cache = cfd_->table_cache();
auto ioptions = cfd_->ioptions();
Status s = table_cache->GetTableProperties(
env_options_, cfd_->internal_comparator(), file_meta->fd, tp,
mutable_cf_options_.prefix_extractor.get(), true /* no io */);
mutable_cf_options_.prefix_extractor.get(), no_io);
if (s.ok()) {
return s;
}
Expand Down
3 changes: 2 additions & 1 deletion db/version_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,8 @@ class Version {
// file-name conversion.
Status GetTableProperties(std::shared_ptr<const TableProperties>* tp,
const FileMetaData* file_meta,
const std::string* fname = nullptr) const;
const std::string* fname = nullptr,
bool no_io = true) const;

// REQUIRES: lock is held
// On success, *props will be populated with all SSTables' table properties.
Expand Down