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

Add blob support to DBIter #7731

Closed
wants to merge 25 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bf6cd03
Store Version pointer in DBIter
ltamasi Nov 19, 2020
64b38ac
Make it possible to use different input and output Slices with Versio…
ltamasi Nov 23, 2020
0245e5f
Add a blob_value_ member to DBIter, expose it from value() when using…
ltamasi Nov 24, 2020
3752447
Read blob value in FindNextUserEntryInternal/FindValueForCurrentKey(U…
ltamasi Nov 24, 2020
5863278
Return 'BlobDB does not support merge operator' error status when hit…
ltamasi Nov 24, 2020
43abd51
Add some TODOs
ltamasi Nov 24, 2020
fc4f95c
Use the correct user key in FindValueForCurrentKey(UsingSeek)
ltamasi Nov 25, 2020
7aaf11f
Fix up method comments
ltamasi Nov 30, 2020
65ffda9
Clean up some parameter names
ltamasi Nov 30, 2020
52fedc7
Factor out the blob reading logic into a helper method SetBlobValueIf…
ltamasi Nov 30, 2020
6b6742c
Add support for iter_start_{seqnum,ts}
ltamasi Nov 30, 2020
e8acd9f
Move the setting of is_blob_ into SetBlobValueIfNeeded
ltamasi Nov 30, 2020
14e1bcb
Remove a couple of TODOs
ltamasi Nov 30, 2020
1d78128
Pass in allow_blob==true in SstFileReader so that blob indexes are ex…
ltamasi Nov 30, 2020
5f60493
Pass read_tier and verify_checksums to GetBlob
ltamasi Dec 1, 2020
e8a31d1
Rename allow_blob to expose_blob_index
ltamasi Dec 1, 2020
23051d5
More of the same
ltamasi Dec 1, 2020
12cc9c6
Fix up DBBlobIndexTest.Iterate
ltamasi Dec 1, 2020
05daf70
Add assertion to SetBlobValueIfNeeded
ltamasi Dec 1, 2020
63a4e2c
Add a unit test
ltamasi Dec 1, 2020
6c021e7
Small cleanup
ltamasi Dec 1, 2020
e851ea4
Fix formatting
ltamasi Dec 1, 2020
3cd9dc2
Fix handling of iter_start_{seqnum,ts} (ouch)
ltamasi Dec 4, 2020
89a99d3
Revert to original if..else if..else style control flow in DBIter::va…
ltamasi Dec 4, 2020
619b341
Name NewDBIterator's parameters (like sequence/max_sequential_skip_in…
ltamasi Dec 5, 2020
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
16 changes: 12 additions & 4 deletions db/db_iter.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,22 @@ class DBIter final : public Iterator {
}
Slice value() const override {
assert(valid_);

if (!allow_blob_ && is_blob_) {
return blob_value_;
}

if (current_entry_is_merged_) {
// If pinned_value_ is set then the result of merge operator is one of
// the merge operands and we should return it.
return pinned_value_.data() ? pinned_value_ : saved_value_;
} else if (direction_ == kReverse) {
}

if (direction_ == kReverse) {
ltamasi marked this conversation as resolved.
Show resolved Hide resolved
return pinned_value_;
} else {
return iter_.value();
}

return iter_.value();
}
Status status() const override {
if (status_.ok()) {
Expand All @@ -187,7 +194,7 @@ class DBIter final : public Iterator {
return ExtractTimestampFromUserKey(ukey_and_ts, timestamp_size_);
}
bool IsBlob() const {
assert(valid_ && (allow_blob_ || !is_blob_));
assert(valid_);
return is_blob_;
}

Expand Down Expand Up @@ -309,6 +316,7 @@ class DBIter final : public Iterator {
std::string saved_value_;
Slice pinned_value_;
// for prefix seek mode to support prev()
PinnableSlice blob_value_;
Statistics* statistics_;
uint64_t max_skip_;
uint64_t max_skippable_internal_keys_;
Expand Down