-
Notifications
You must be signed in to change notification settings - Fork 468
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
Style: Change Storage::SetReadOptions to DefaultScanOptions #1574
Conversation
@git-hulk By the way, when would kvrocks use |
Yes, only point lookup would enable the fill_cache option.
Sorry, I didn't get this point. Do you mean that should also enable the fill_cache for the seek operation? |
No, just make clear when would we we rocksdb::ReadOptions read_options = storage_->DefaultScanOptions();
LatestSnapShot ss(storage_);
read_options.snapshot = ss.GetSnapShot();
std::string score_bytes, member_key;
InternalKey(ns_key, member, metadata.version, storage_->IsSlotIdEncoded()).Encode(&member_key);
s = storage_->Get(read_options, member_key, &score_bytes); // member key will not be cached.
if (!s.ok()) return s.IsNotFound() ? rocksdb::Status::OK() : s; Another case is that |
Got it, thanks for your information. The origin expectation is all point lookups(include mget) should use the fill_cache, so it should be a mistake if we didn't fill the cache in mget operation. |
So get meta and point get is likely to be a Maybe I can make a separate pr for |
Yes, that's right.
Yes, it'd be better to file another PR to make the context more clear. |
Fixes #1572
Now kvrocks has SetWriteOptions and SetReadOptions. However, there syntax doesn't same. SetWriteOptions would set the Storage internal rocksdb::WriteOptions during intialize, and the detail option can be get by DefaultWriteOptions().
However, SetReadOptions only does some fixup when called:
Would we create a DefaultScanOptions, and remove SetReadOptions for that ?