Replace std::shared_ptr<SystemClock> by SystemClock* in TraceExecutionHandler (#8729)

Summary:
All/most trace related APIs directly use `SystemClock*` (https://github.com/facebook/rocksdb/pull/8033). Do the same in `TraceExecutionHandler`.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/8729

Test Plan: None

Reviewed By: zhichao-cao

Differential Revision: D30672159

Pulled By: autopear

fbshipit-source-id: 017db4912c6ac1cfede842b8b122cf569a394f25
This commit is contained in:
Qizhong Mao 2021-08-31 10:56:08 -07:00 committed by Facebook GitHub Bot
parent ec9f52ece6
commit 7b55554605
2 changed files with 3 additions and 3 deletions

View File

@ -17,8 +17,7 @@ TraceExecutionHandler::TraceExecutionHandler(
: TraceRecord::Handler(), : TraceRecord::Handler(),
db_(db), db_(db),
write_opts_(WriteOptions()), write_opts_(WriteOptions()),
read_opts_(ReadOptions()), read_opts_(ReadOptions()) {
clock_(SystemClock::Default()) {
assert(db != nullptr); assert(db != nullptr);
assert(!handles.empty()); assert(!handles.empty());
cf_map_.reserve(handles.size()); cf_map_.reserve(handles.size());
@ -26,6 +25,7 @@ TraceExecutionHandler::TraceExecutionHandler(
assert(handle != nullptr); assert(handle != nullptr);
cf_map_.insert({handle->GetID(), handle}); cf_map_.insert({handle->GetID(), handle});
} }
clock_ = db_->GetEnv()->GetSystemClock().get();
} }
TraceExecutionHandler::~TraceExecutionHandler() { cf_map_.clear(); } TraceExecutionHandler::~TraceExecutionHandler() { cf_map_.clear(); }

View File

@ -38,7 +38,7 @@ class TraceExecutionHandler : public TraceRecord::Handler {
std::unordered_map<uint32_t, ColumnFamilyHandle*> cf_map_; std::unordered_map<uint32_t, ColumnFamilyHandle*> cf_map_;
WriteOptions write_opts_; WriteOptions write_opts_;
ReadOptions read_opts_; ReadOptions read_opts_;
std::shared_ptr<SystemClock> clock_; SystemClock* clock_;
}; };
// To do: Handler for trace_analyzer. // To do: Handler for trace_analyzer.