diff options
author | Greg Farnum <greg@inktank.com> | 2013-09-19 16:20:29 -0700 |
---|---|---|
committer | Greg Farnum <greg@inktank.com> | 2013-09-19 18:14:59 -0700 |
commit | 06e1bcadfe30cfd8850f6f5d30138a7998fa4130 (patch) | |
tree | a6c8dfc97e5e0f3562ce79ccc563e7d382738d95 | |
parent | a8bbb81b7b7b6420ea08bc4e99a39adc6c3c397a (diff) | |
download | ceph-06e1bcadfe30cfd8850f6f5d30138a7998fa4130.tar.gz |
OpTracker: move OpTracker pointer and some init code into TrackedOp
Clean up some member privacy issues while we're working on them.
Signed-off-by: Greg Farnum <greg@inktank.com>
-rw-r--r-- | src/common/TrackedOp.h | 36 | ||||
-rw-r--r-- | src/osd/OpRequest.cc | 4 | ||||
-rw-r--r-- | src/osd/OpRequest.h | 1 |
3 files changed, 24 insertions, 17 deletions
diff --git a/src/common/TrackedOp.h b/src/common/TrackedOp.h index 644fc0a6182..b10485528ab 100644 --- a/src/common/TrackedOp.h +++ b/src/common/TrackedOp.h @@ -109,28 +109,38 @@ public: }; class TrackedOp { +public: + Message *request; /// the logical request we are tracking +private: + friend class OpHistory; + friend class OpTracker; + xlist<TrackedOp*>::item xitem; protected: + OpTracker *tracker; /// the tracker we are associated with + list<pair<utime_t, string> > events; /// list of events and their times Mutex lock; /// to protect the events list -public: - // move these to private once friended OpTracker - Message *request; - xlist<TrackedOp*>::item xitem; - utime_t received_time; - // figure out how to get rid of this one? - uint8_t warn_interval_multiplier; - string current; - uint64_t seq; + utime_t received_time; /// the time the triggering Message was received + string current; /// the current state the event is in + uint64_t seq; /// a unique value set by the OpTracker - TrackedOp(Message *req) : - lock("TrackedOp::lock"), + uint8_t warn_interval_multiplier; // limits output of a given op warning + + TrackedOp(Message *req, OpTracker *_tracker) : request(req), xitem(this), - warn_interval_multiplier(1), - seq(0) {} + tracker(_tracker), + lock("TrackedOp::lock"), + seq(0), + warn_interval_multiplier(1) + { + received_time = request->get_recv_stamp(); + tracker->register_inflight_op(&xitem); + } virtual void init_from_message() {}; +public: virtual ~TrackedOp() {} utime_t get_arrived() const { diff --git a/src/osd/OpRequest.cc b/src/osd/OpRequest.cc index 81980ed2a57..345fc30f572 100644 --- a/src/osd/OpRequest.cc +++ b/src/osd/OpRequest.cc @@ -14,12 +14,10 @@ OpRequest::OpRequest(Message *req, OpTracker *tracker) : - TrackedOp(req), + TrackedOp(req, tracker), rmw_flags(0), tracker(tracker), hit_flag_points(0), latest_flag_point(0) { - received_time = request->get_recv_stamp(); - tracker->register_inflight_op(&xitem); if (req->get_priority() < tracker->cct->_conf->osd_client_op_priority) { // don't warn as quickly for low priority ops warn_interval_multiplier = tracker->cct->_conf->osd_recovery_op_warn_multiple; diff --git a/src/osd/OpRequest.h b/src/osd/OpRequest.h index 80dd08cb98f..18bfe1a1d07 100644 --- a/src/osd/OpRequest.h +++ b/src/osd/OpRequest.h @@ -62,7 +62,6 @@ struct OpRequest : public TrackedOp { void dump(utime_t now, Formatter *f) const; private: - OpTracker *tracker; osd_reqid_t reqid; uint8_t hit_flag_points; uint8_t latest_flag_point; |