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
main
Qizhong Mao 3 years ago committed by Facebook GitHub Bot
parent ec9f52ece6
commit 7b55554605
  1. 4
      trace_replay/trace_record_handler.cc
  2. 2
      trace_replay/trace_record_handler.h

@ -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(); }

@ -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.

Loading…
Cancel
Save