Make IsDeadlockDetect() virtual member of Transaction

Summary: Make `IsDeadlockDetect()` virtual member of base class `Transaction` for ease of use in MyRocks

Test Plan: compiles. compiles into MyRocks call-site.

Reviewers: mung

Reviewed By: mung

Subscribers: andrewkr, dhruba

Differential Revision: https://reviews.facebook.net/D65385
main
Reid Horuff 8 years ago
parent 59a7c0337b
commit 4dfaa6610a
  1. 2
      include/rocksdb/utilities/transaction.h
  2. 2
      utilities/transactions/transaction_impl.h

@ -399,6 +399,8 @@ class Transaction {
virtual TransactionID GetID() const { return 0; }
virtual bool IsDeadlockDetect() const { return false; }
virtual TransactionID GetWaitingTxn(uint32_t* column_family_id,
const std::string** key) const {
assert(false);

@ -91,7 +91,7 @@ class TransactionImpl : public TransactionBaseImpl {
// Returns true if locks were stolen successfully, false otherwise.
bool TryStealingLocks();
bool IsDeadlockDetect() const { return deadlock_detect_; }
bool IsDeadlockDetect() const override { return deadlock_detect_; }
int64_t GetDeadlockDetectDepth() const { return deadlock_detect_depth_; }

Loading…
Cancel
Save