PokIsemaine commented on code in PR #2332:
URL: https://github.com/apache/kvrocks/pull/2332#discussion_r1680533815
##########
src/storage/storage.h:
##########
@@ -358,8 +365,43 @@ class Storage {
rocksdb::WriteOptions default_write_opts_ = rocksdb::WriteOptions();
- rocksdb::Status writeToDB(const rocksdb::WriteOptions &options,
rocksdb::WriteBatch *updates);
+ rocksdb::Status writeToDB(engine::Context &ctx, const rocksdb::WriteOptions
&options, rocksdb::WriteBatch *updates);
void recordKeyspaceStat(const rocksdb::ColumnFamilyHandle *column_family,
const rocksdb::Status &s);
};
+struct Context {
+ engine::Storage *storage = nullptr;
+ const rocksdb::Snapshot *snapshot = nullptr;
+ std::unique_ptr<rocksdb::WriteBatchWithIndex> batch = nullptr;
+
+ rocksdb::ReadOptions GetReadOptions();
Review Comment:
The API has been redesigned. The original GetReadOptions is non-const
because the snapshot may be modified silently. Now the constructor Context() =
default is removed and only Context(storage) is used to ensure that there is a
certain snapshot initially. At the same time, DCHECK is added to the underlying
API of GET to check the consistency with the snpashot setting in read_options.
Also added Comment as reminder
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]