[Public API Change] Make DB::GetDbIdentity() be const function.

Summary: Make DB::GetDbIdentity() be const function.

Test Plan: make db_test

Reviewers: igor, rven, sdong

Reviewed By: sdong

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D38745
This commit is contained in:
Yueh-Hsuan Chiang 2015-05-21 11:01:48 -07:00
parent eaf61ba9f3
commit e2c1d4b57f
6 changed files with 8 additions and 5 deletions

View File

@ -1,5 +1,8 @@
# Rocksdb Change Log
## Public API changes
* DB::GetDbIdentity() is now a const function. If this function is overridden in your application, be sure to also make GetDbIdentity() const to avoid compile error.
## 3.11.0 (5/19/2015)
### New Features

View File

@ -3820,7 +3820,7 @@ Status DBImpl::CheckConsistency() {
}
}
Status DBImpl::GetDbIdentity(std::string& identity) {
Status DBImpl::GetDbIdentity(std::string& identity) const {
std::string idfilename = IdentityFileName(dbname_);
unique_ptr<SequentialFile> idfile;
const EnvOptions soptions;

View File

@ -197,7 +197,7 @@ class DBImpl : public DB {
// match to our in-memory records
virtual Status CheckConsistency();
virtual Status GetDbIdentity(std::string& identity) override;
virtual Status GetDbIdentity(std::string& identity) const override;
Status RunManualCompaction(ColumnFamilyData* cfd, int input_level,
int output_level, uint32_t output_path_id,

View File

@ -8797,7 +8797,7 @@ class ModelDB: public DB {
virtual Status DeleteFile(std::string name) override { return Status::OK(); }
virtual Status GetDbIdentity(std::string& identity) override {
virtual Status GetDbIdentity(std::string& identity) const override {
return Status::OK();
}

View File

@ -590,7 +590,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) = 0;
virtual Status GetDbIdentity(std::string& identity) const = 0;
// Returns default column family handle
virtual ColumnFamilyHandle* DefaultColumnFamily() const = 0;

View File

@ -226,7 +226,7 @@ class StackableDB : public DB {
return db_->DeleteFile(name);
}
virtual Status GetDbIdentity(std::string& identity) override {
virtual Status GetDbIdentity(std::string& identity) const override {
return db_->GetDbIdentity(identity);
}