diff options
author | Levi Tamasi <ltamasi@fb.com> | 2020-12-04 21:28:26 -0800 |
---|---|---|
committer | Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> | 2020-12-04 21:29:38 -0800 |
commit | 61932cdf1de3e0af7e2a62172b211af372f2fb4d (patch) | |
tree | 773a56674ff73344a1151ed86a48b447c71d47ca /table | |
parent | e102de73180a5bead2d534f27b10258dcd2386e6 (diff) |
Add blob support to DBIter (#7731)
Summary:
The patch adds iterator support to the integrated BlobDB implementation.
Whenever a blob reference is encountered during iteration, the corresponding
blob is retrieved by calling `Version::GetBlob`, assuming the `expose_blob_index`
(formerly `allow_blob`) flag is *not* set. (Note: the flag is set by the old stacked
BlobDB implementation, which has its own blob file handling/blob retrieval logic.)
In addition, `DBIter` now uniformly returns `Status::NotSupported` with the error
message `"BlobDB does not support merge operator."` when encountering a
blob reference while performing a merge (instead of potentially returning a
message that implies the database should be opened using the stacked BlobDB's
`Open`.)
TODO: We can implement support for lazily retrieving the blob value (or in other
words, bypassing the retrieval of blob values based on key) by extending the `Iterator`
API with a new `PrepareValue` method (similarly to `InternalIterator`, which already
supports lazy values).
Pull Request resolved: https://github.com/facebook/rocksdb/pull/7731
Test Plan: `make check`
Reviewed By: riversand963
Differential Revision: D25256293
Pulled By: ltamasi
fbshipit-source-id: c39cd782011495a526cdff99c16f5fca400c4811
Diffstat (limited to 'table')
-rw-r--r-- | table/sst_file_reader.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/table/sst_file_reader.cc b/table/sst_file_reader.cc index f7f22b061..9bb8bdd71 100644 --- a/table/sst_file_reader.cc +++ b/table/sst_file_reader.cc @@ -69,11 +69,12 @@ Iterator* SstFileReader::NewIterator(const ReadOptions& roptions) { ? roptions.snapshot->GetSequenceNumber() : kMaxSequenceNumber; ArenaWrappedDBIter* res = new ArenaWrappedDBIter(); - res->Init(r->options.env, roptions, r->ioptions, r->moptions, sequence, + res->Init(r->options.env, roptions, r->ioptions, r->moptions, + nullptr /* version */, sequence, r->moptions.max_sequential_skip_in_iterations, 0 /* version_number */, nullptr /* read_callback */, - nullptr /* db_impl */, nullptr /* cfd */, false /* allow_blob */, - false /* allow_refresh */); + nullptr /* db_impl */, nullptr /* cfd */, + true /* expose_blob_index */, false /* allow_refresh */); auto internal_iter = r->table_reader->NewIterator( res->GetReadOptions(), r->moptions.prefix_extractor.get(), res->GetArena(), false /* skip_filters */, |