From 4dfaa6610ac97efe2ba01a91fe6ab57337bdb386 Mon Sep 17 00:00:00 2001 From: Reid Horuff Date: Fri, 21 Oct 2016 11:39:15 -0700 Subject: [PATCH] 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 --- include/rocksdb/utilities/transaction.h | 2 ++ utilities/transactions/transaction_impl.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/rocksdb/utilities/transaction.h b/include/rocksdb/utilities/transaction.h index 44195778a..50b2167cd 100644 --- a/include/rocksdb/utilities/transaction.h +++ b/include/rocksdb/utilities/transaction.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); diff --git a/utilities/transactions/transaction_impl.h b/utilities/transactions/transaction_impl.h index 252a42ae5..4dfea9be5 100644 --- a/utilities/transactions/transaction_impl.h +++ b/utilities/transactions/transaction_impl.h @@ -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_; }