ShooterIT commented on code in PR #577:
URL: https://github.com/apache/incubator-kvrocks/pull/577#discussion_r873437597
##########
src/lock_manager.h:
##########
@@ -55,3 +58,25 @@ class LockGuard {
LockManager *lock_mgr_ = nullptr;
rocksdb::Slice key_;
};
+
+class MultiLockGuard {
+ public:
+ explicit MultiLockGuard(LockManager *lock_mgr, const
std::vector<std::string> &keys):
+ lock_mgr_(lock_mgr) {
+ locks_ = lock_mgr_->MultiGet(keys);
+ for (const auto &iter : locks_) {
+ iter->lock();
+ }
+ }
+
+ ~MultiLockGuard() {
+ // Lock with order `A B C` and unlock should be `C B A`
Review Comment:
why we need to unlock reversely, AFAIK, they are separate.
##########
Changelog:
##########
@@ -1,5 +1,8 @@
# Version 999.999.999
+New features
+ - Add LMove command
+
Review Comment:
```suggestion
```
you don't need to modify this file, i will do this when we release new
version.
--
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]