diff --git a/db/db_test.cc b/db/db_test.cc index a8973a102..5941dc2d2 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -7751,6 +7751,12 @@ class ModelDB: public DB { class ModelSnapshot : public Snapshot { public: KVMap map_; + + virtual SequenceNumber GetSequenceNumber() const { + // no need to call this + assert(false); + return 0; + } }; explicit ModelDB(const Options& options) : options_(options) {} diff --git a/db/snapshot.h b/db/snapshot.h index 45c66eabc..de9897f24 100644 --- a/db/snapshot.h +++ b/db/snapshot.h @@ -20,6 +20,8 @@ class SnapshotImpl : public Snapshot { public: SequenceNumber number_; // const after creation + virtual SequenceNumber GetSequenceNumber() const { return number_; } + private: friend class SnapshotList; diff --git a/include/rocksdb/db.h b/include/rocksdb/db.h index a519db7f6..a4141f38b 100644 --- a/include/rocksdb/db.h +++ b/include/rocksdb/db.h @@ -64,6 +64,10 @@ static const int kMinorVersion = __ROCKSDB_MINOR__; // A Snapshot is an immutable object and can therefore be safely // accessed from multiple threads without any external synchronization. class Snapshot { + public: + // returns Snapshot's sequence number + virtual SequenceNumber GetSequenceNumber() const = 0; + protected: virtual ~Snapshot(); };