Make GetDbIdentity pure virtual and also implement it for StackableDB, DBWithTTL

Summary: As title

Test Plan: make clean and make

Reviewers: igor

Reviewed By: igor

CC: leveldb

Differential Revision: https://reviews.facebook.net/D14469
This commit is contained in:
Mayank Agarwal
2013-12-05 10:16:39 -08:00
parent 18802689b8
commit 92e8316118
5 changed files with 15 additions and 4 deletions

View File

@@ -295,10 +295,7 @@ class DB {
// Sets the globally unique ID created at database creation time by invoking
// Env::GenerateUniqueId(), in identity. Returns Status::OK if identity could
// be set properly
virtual Status GetDbIdentity(std::string& identity) {
identity.clear();
return Status::OK();
}
virtual Status GetDbIdentity(std::string& identity) = 0;
private:
// No copying allowed

View File

@@ -140,6 +140,10 @@ class StackableDB : public DB {
return db_->DeleteFile(name);
}
virtual Status GetDbIdentity(std::string& identity) {
return db_->GetDbIdentity(identity);
}
virtual Status GetUpdatesSince(SequenceNumber seq_number,
unique_ptr<TransactionLogIterator>* iter)
override {