Skip to content

Commit

Permalink
DB::GetOptions()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
igorcanadi committed Nov 25, 2013
1 parent 793fdd6 commit 3ce3658
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions db/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
1 change: 1 addition & 0 deletions db/db_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions db/db_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions include/rocksdb/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 4 additions & 0 deletions include/utilities/stackable_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
4 changes: 4 additions & 0 deletions utilities/ttl/db_ttl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions utilities/ttl/db_ttl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 3ce3658

Please sign in to comment.