DB::GetOptions()

Summary: We need access to options for BackupableDB

Test Plan: make check

Reviewers: dhruba

Reviewed By: dhruba

CC: leveldb, reconnect.grayhat

Differential Revision: https://reviews.facebook.net/D14331
main
Igor Canadi 11 years ago
parent 793fdd6731
commit 3ce3658411
  1. 4
      db/db_impl.cc
  2. 1
      db/db_impl.h
  3. 4
      db/db_test.cc
  4. 3
      include/rocksdb/db.h
  5. 4
      include/utilities/stackable_db.h
  6. 4
      utilities/ttl/db_ttl.cc
  7. 2
      utilities/ttl/db_ttl.h

@ -3135,6 +3135,10 @@ Env* DBImpl::GetEnv() const {
return env_;
}
const Options& DBImpl::GetOptions() const {
return options_;
}
bool DBImpl::GetProperty(const Slice& property, std::string* value) {
value->clear();

@ -68,6 +68,7 @@ class DBImpl : public DB {
virtual int MaxMemCompactionLevel();
virtual int Level0StopWriteTrigger();
virtual Env* GetEnv() const;
virtual const Options& GetOptions() const;
virtual Status Flush(const FlushOptions& options);
virtual Status DisableFileDeletions();
virtual Status EnableFileDeletions();

@ -4466,6 +4466,10 @@ class ModelDB: public DB {
return nullptr;
}
virtual const Options& GetOptions() const {
return options_;
}
virtual Status Flush(const rocksdb::FlushOptions& options) {
Status ret;
return ret;

@ -231,6 +231,9 @@ class DB {
// Get Env object from the DB
virtual Env* GetEnv() const = 0;
// Get DB Options that we use
virtual const Options& GetOptions() const = 0;
// Flush all mem-table data.
virtual Status Flush(const FlushOptions& options) = 0;

@ -107,6 +107,10 @@ class StackableDB : public DB {
return db_->GetEnv();
}
virtual const Options& GetOptions() const override {
return db_->GetOptions();
}
virtual Status Flush(const FlushOptions& fopts) override {
return db_->Flush(fopts);
}

@ -258,6 +258,10 @@ Env* DBWithTTL::GetEnv() const {
return db_->GetEnv();
}
const Options& DBWithTTL::GetOptions() const {
return db_->GetOptions();
}
Status DBWithTTL::Flush(const FlushOptions& fopts) {
return db_->Flush(fopts);
}

@ -69,6 +69,8 @@ class DBWithTTL : public StackableDB {
virtual Env* GetEnv() const;
virtual const Options& GetOptions() const;
virtual Status Flush(const FlushOptions& fopts);
virtual Status DisableFileDeletions();

Loading…
Cancel
Save