[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
main
Yueh-Hsuan Chiang 10 years ago
parent eaf61ba9f3
commit e2c1d4b57f
  1. 3
      HISTORY.md
  2. 2
      db/db_impl.cc
  3. 2
      db/db_impl.h
  4. 2
      db/db_test.cc
  5. 2
      include/rocksdb/db.h
  6. 2
      include/rocksdb/utilities/stackable_db.h

@ -1,5 +1,8 @@
# Rocksdb Change Log # 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) ## 3.11.0 (5/19/2015)
### New Features ### New Features

@ -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_); std::string idfilename = IdentityFileName(dbname_);
unique_ptr<SequentialFile> idfile; unique_ptr<SequentialFile> idfile;
const EnvOptions soptions; const EnvOptions soptions;

@ -197,7 +197,7 @@ class DBImpl : public DB {
// match to our in-memory records // match to our in-memory records
virtual Status CheckConsistency(); 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, Status RunManualCompaction(ColumnFamilyData* cfd, int input_level,
int output_level, uint32_t output_path_id, int output_level, uint32_t output_path_id,

@ -8797,7 +8797,7 @@ class ModelDB: public DB {
virtual Status DeleteFile(std::string name) override { return Status::OK(); } 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(); return Status::OK();
} }

@ -590,7 +590,7 @@ class DB {
// Sets the globally unique ID created at database creation time by invoking // Sets the globally unique ID created at database creation time by invoking
// Env::GenerateUniqueId(), in identity. Returns Status::OK if identity could // Env::GenerateUniqueId(), in identity. Returns Status::OK if identity could
// be set properly // be set properly
virtual Status GetDbIdentity(std::string& identity) = 0; virtual Status GetDbIdentity(std::string& identity) const = 0;
// Returns default column family handle // Returns default column family handle
virtual ColumnFamilyHandle* DefaultColumnFamily() const = 0; virtual ColumnFamilyHandle* DefaultColumnFamily() const = 0;

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

Loading…
Cancel
Save