++p)
_buffers.push_back(*p);
}
+ void append(istream& in) {
+ while (!in.eof()) {
+ string s;
+ getline(in, s);
+ append(s.c_str(), s.length());
+ append("\n", 1);
+ }
+ }
void append_zero(unsigned len) {
ptr bp(len);
ss << *this;
r = 0;
}
+ else if (m->cmd[1] == "dump") {
+ ss << "ok";
+ r = 0;
+ stringstream ds;
+ osdmap.print(ds);
+ rdata.append(ds);
+ }
else if (m->cmd[1] == "getmap") {
osdmap.encode(rdata);
ss << "got osdmap epoch " << osdmap.get_epoch();
// dump pgmap summaries? (useful for debugging)
if (1) {
+ stringstream ds;
+ pg_map.dump(ds);
bufferlist d;
- dump(d);
+ d.append(ds);
mon->store->put_bl_sn(d, "pgmap_dump", paxosv);
}
}
}
-void PGMonitor::dump(bufferlist& bl)
-{
- stringstream ss;
- pg_map.dump(ss);
- while (!ss.eof()) {
- string s;
- getline(ss, s);
- bl.append(s.c_str(), s.length());
- bl.append("\n", 1);
- }
-}
-
bool PGMonitor::preprocess_command(MMonCommand *m)
{
int r = -1;
r = 0;
}
else if (m->cmd[1] == "dump") {
- dump(rdata);
ss << "ok";
r = 0;
+ stringstream ds;
+ pg_map.dump(ds);
+ rdata.append(ds);
}
else if (m->cmd[1] == "scrub" && m->cmd.size() == 3) {
pg_t pgid;