/// the current epoch if this is not being sent in response to a
/// query. This allows the recipient to disregard responses to old
/// queries.
- vector<pair<pg_notify_t,PastIntervals> > pg_list; // pgid -> version
+ using pg_list_t = std::vector<std::pair<pg_notify_t,PastIntervals>>;
+ pg_list_t pg_list; // pgid -> version
public:
version_t get_epoch() const { return epoch; }
- const vector<pair<pg_notify_t,PastIntervals> >& get_pg_list() const {
+ const pg_list_t& get_pg_list() const {
return pg_list;
}
MOSDPGNotify()
- : MessageInstance(MSG_OSD_PG_NOTIFY, HEAD_VERSION, COMPAT_VERSION) {
- set_priority(CEPH_MSG_PRIO_HIGH);
- }
- MOSDPGNotify(epoch_t e, vector<pair<pg_notify_t,PastIntervals> >& l)
+ : MOSDPGNotify(0, {})
+ {}
+ MOSDPGNotify(epoch_t e, pg_list_t&& l)
: MessageInstance(MSG_OSD_PG_NOTIFY, HEAD_VERSION, COMPAT_VERSION),
- epoch(e) {
- pg_list.swap(l);
+ epoch(e),
+ pg_list(std::move(l)) {
set_priority(CEPH_MSG_PRIO_HIGH);
}
private:
dout(7) << __func__ << " osd." << it->first
<< " on " << it->second.size() << " PGs" << dendl;
MOSDPGNotify *m = new MOSDPGNotify(curmap->get_epoch(),
- it->second);
+ std::move(it->second));
con->send_message(m);
}
}
osdmap->get_epoch(),
empty),
PastIntervals()));
- m = new MOSDPGNotify(osdmap->get_epoch(), ls);
+ m = new MOSDPGNotify(osdmap->get_epoch(), std::move(ls));
}
service.share_map_peer(q.from.osd, con.get(), osdmap);
con->send_message(m);