Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions db/blob/blob_fetcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ Status BlobFetcher::FetchBlob(const Slice& user_key,
return status;
}

VersionBlobFetcherBase::VersionBlobFetcherBase(const Version* version,
BlobFileCache* blob_file_cache,
bool allow_write_path_fallback)
: version_(version),
blob_file_cache_(blob_file_cache),
allow_write_path_fallback_(allow_write_path_fallback) {
if (version_ != nullptr &&
UNLIKELY(!version_->storage_info()->GetDroppedBlobFiles().empty())) {
storage_with_dropped_blob_files_ = version_->storage_info();
}
}

Status VersionBlobFetcherBase::FetchBlob(const Slice& user_key,
const BlobIndex& blob_index,
FilePrefetchBuffer* prefetch_buffer,
Expand Down
17 changes: 13 additions & 4 deletions db/blob/blob_fetcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace ROCKSDB_NAMESPACE {

class BlobFileCache;
class Version;
class VersionStorageInfo;
class Slice;
class FilePrefetchBuffer;
class PinnableSlice;
Expand Down Expand Up @@ -45,6 +46,17 @@ class BlobFetcher {
// EmbeddedAwareBlobFetcher decorator) to resolve same-file blob references,
// which need the current read_tier.
virtual const ReadOptions& read_options() const = 0;

// The storage of the Version this fetcher reads through if that Version has
// dropped blob files (see VersionStorageInfo::GetDroppedBlobFiles()), or
// null. Reads treat values in those files as deleted, which they decide
// before fetching anything.
const VersionStorageInfo* storage_with_dropped_blob_files() const {
return storage_with_dropped_blob_files_;
}

protected:
const VersionStorageInfo* storage_with_dropped_blob_files_ = nullptr;
};

// Shared implementation of the two Version-backed BlobFetchers below. Reads
Expand Down Expand Up @@ -109,10 +121,7 @@ class VersionBlobFetcherBase : public BlobFetcher {

protected:
VersionBlobFetcherBase(const Version* version, BlobFileCache* blob_file_cache,
bool allow_write_path_fallback)
: version_(version),
blob_file_cache_(blob_file_cache),
allow_write_path_fallback_(allow_write_path_fallback) {}
bool allow_write_path_fallback);

const Version* version_;
BlobFileCache* blob_file_cache_;
Expand Down
Loading
Loading