mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Expose the table properties to application
Summary: Provide a public API for users to access the table properties for each SSTable. Test Plan: Added a unit tests to test the function correctness under differnet conditions. Reviewers: haobo, dhruba, sdong Reviewed By: haobo CC: leveldb Differential Revision: https://reviews.facebook.net/D16083
This commit is contained in:
@@ -3488,6 +3488,23 @@ Status DBImpl::MakeRoomForWrite(bool force,
|
||||
return s;
|
||||
}
|
||||
|
||||
Status DBImpl::GetPropertiesOfAllTables(TablePropertiesCollection* props) {
|
||||
// Increment the ref count
|
||||
mutex_.Lock();
|
||||
auto version = versions_->current();
|
||||
version->Ref();
|
||||
mutex_.Unlock();
|
||||
|
||||
auto s = version->GetPropertiesOfAllTables(props);
|
||||
|
||||
// Decrement the ref count
|
||||
mutex_.Lock();
|
||||
version->Unref();
|
||||
mutex_.Unlock();
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
const std::string& DBImpl::GetName() const {
|
||||
return dbname_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user